From reid at kleckner.net Mon Aug 24 00:42:22 2009 From: reid at kleckner.net (Reid Kleckner) Date: Mon, 24 Aug 2009 05:42:22 -0000 Subject: [llvm-commits] [llvm] r79896 - /llvm/trunk/examples/Kaleidoscope/toy.cpp Message-ID: <200908240542.n7O5gMRD014092@zion.cs.uiuc.edu> Author: rnk Date: Mon Aug 24 00:42:21 2009 New Revision: 79896 URL: http://llvm.org/viewvc/llvm-project?rev=79896&view=rev Log: Fixed double free in Kaleidoscope. Fixes PR4762. Modified: llvm/trunk/examples/Kaleidoscope/toy.cpp Modified: llvm/trunk/examples/Kaleidoscope/toy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/toy.cpp?rev=79896&r1=79895&r2=79896&view=diff ============================================================================== --- llvm/trunk/examples/Kaleidoscope/toy.cpp (original) +++ llvm/trunk/examples/Kaleidoscope/toy.cpp Mon Aug 24 00:42:21 2009 @@ -1107,12 +1107,13 @@ // Make the module, which holds all the code. TheModule = new Module("my cool jit", Context); - - // Create the JIT. - TheExecutionEngine = EngineBuilder(TheModule).create(); { ExistingModuleProvider OurModuleProvider(TheModule); + + // Create the JIT. + TheExecutionEngine = EngineBuilder(&OurModuleProvider).create(); + FunctionPassManager OurFPM(&OurModuleProvider); // Set up the optimizer pipeline. Start with registering info about how the From daniel at zuster.org Mon Aug 24 02:18:07 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 07:18:07 -0000 Subject: [llvm-commits] [llvm] r79897 - /llvm/trunk/include/llvm/Support/raw_ostream.h Message-ID: <200908240718.n7O7I7bE026450@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 02:18:07 2009 New Revision: 79897 URL: http://llvm.org/viewvc/llvm-project?rev=79897&view=rev Log: Add missing include (for MSVC). Modified: llvm/trunk/include/llvm/Support/raw_ostream.h Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=79897&r1=79896&r2=79897&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Mon Aug 24 02:18:07 2009 @@ -15,6 +15,7 @@ #define LLVM_SUPPORT_RAW_OSTREAM_H #include "llvm/ADT/StringRef.h" +#include "llvm/Support/DataTypes.h" namespace llvm { class format_object_base; From baldrick at free.fr Mon Aug 24 02:21:04 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 09:21:04 +0200 Subject: [llvm-commits] [llvm] r79792 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <200908230014.n7N0EK5L020005@zion.cs.uiuc.edu> References: <200908230014.n7N0EK5L020005@zion.cs.uiuc.edu> Message-ID: <4A923F60.70104@free.fr> > Add check for completeness. Note that this doesn't actually have any > effect with the way the current code is structured. Thanks Eli. Duncan. From baldrick at free.fr Mon Aug 24 02:27:21 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 09:27:21 +0200 Subject: [llvm-commits] [llvm] r79858 - /llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp In-Reply-To: <200908231813.n7NIDnFv025846@zion.cs.uiuc.edu> References: <200908231813.n7NIDnFv025846@zion.cs.uiuc.edu> Message-ID: <4A9240D9.90200@free.fr> Hi Jim, > + // If we don't have any eh.selector calls, we can't determine the personality > + // function. Without a personality function, we can't process exceptions. > + if (!PersonalityFn) return false; can you use the C (yes, C!) personality function? It is always available since it's part of libgcc. Ciao, Duncan. From baldrick at free.fr Mon Aug 24 02:53:54 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 09:53:54 +0200 Subject: [llvm-commits] [llvm] r79880 - /llvm/trunk/test/ExecutionEngine/2007-12-14-LittleEndian.ll In-Reply-To: <200908240205.n7O25xGg019496@zion.cs.uiuc.edu> References: <200908240205.n7O25xGg019496@zion.cs.uiuc.edu> Message-ID: <4A924712.8060803@free.fr> Hi Chris, > Remove this test now that the interpreter doesn't support > interpreting the wrong endianness anymore. This fixes a > failure on clang-powerpc-darwin8 what's the reason for removing this feature? I taught the interpreter how to do loads and stores etc of the wrong endianness in a moment of boredom. That's probably where this test comes from. While it is not the world's most useful feature, I thought it might be useful for debugging endianness problems when you don't have access to a machine with that endianness. Ciao, Duncan. From baldrick at free.fr Mon Aug 24 03:32:06 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 10:32:06 +0200 Subject: [llvm-commits] [llvm] r79731 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp In-Reply-To: <200908220632.n7M6Wb2E007792@zion.cs.uiuc.edu> References: <200908220632.n7M6Wb2E007792@zion.cs.uiuc.edu> Message-ID: <4A925006.1060002@free.fr> Hi Owen, > + // All writes to this location will have the same value, so it's ok > + // to race on it. We only need to ensure that at least one write has > + // succeeded before we return the pointer into the array. unfortunately, race detectors like helgrind don't like this kind of thing, and report it as a race. Last time I asked about it I was told that fixing it would be too hard/expensive. > VTs[VT.getSimpleVT().SimpleTy] = VT; > - return &VTs[VT.getSimpleVT().SimpleTy]; > + sys::MemoryFence(); I don't think this fence actually does anything useful unless users of the pointer do a fence before reading the contents of the pointer. That said, I think alpha is the only platform where you have to worry about this kind of pointer vs pointee race. > + return VTs + VT.getSimpleVT().SimpleTy; > } > } Ciao, Duncan. From daniel at zuster.org Mon Aug 24 03:39:58 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 08:39:58 -0000 Subject: [llvm-commits] [llvm] r79898 - /llvm/trunk/lib/MC/MCAssembler.cpp Message-ID: <200908240839.n7O8dwbQ017050@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 03:39:57 2009 New Revision: 79898 URL: http://llvm.org/viewvc/llvm-project?rev=79898&view=rev Log: llvm-mc: Tweak undefined symbol handling. Modified: llvm/trunk/lib/MC/MCAssembler.cpp Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=79898&r1=79897&r2=79898&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Mon Aug 24 03:39:57 2009 @@ -294,7 +294,7 @@ // FIXME: Set private external bit. // Set external bit. - if (MSD.SymbolData->isExternal()) + if (MSD.SymbolData->isExternal() || Symbol.isUndefined()) Type |= STF_External; // struct nlist (12 bytes) @@ -339,7 +339,7 @@ ie = Asm.symbol_end(); it != ie; ++it) { MCSymbol &Symbol = it->getSymbol(); - if (!it->isExternal()) + if (!it->isExternal() && !Symbol.isUndefined()) continue; uint64_t &Entry = StringIndexMap[Symbol.getName()]; @@ -371,7 +371,7 @@ ie = Asm.symbol_end(); it != ie; ++it) { MCSymbol &Symbol = it->getSymbol(); - if (it->isExternal()) + if (it->isExternal() || Symbol.isUndefined()) continue; uint64_t &Entry = StringIndexMap[Symbol.getName()]; @@ -385,7 +385,6 @@ MSD.SymbolData = it; MSD.StringIndex = Entry; - assert(!Symbol.isUndefined() && "Local symbol can not be undefined!"); if (Symbol.isAbsolute()) { MSD.SectionIndex = 0; LocalSymbolData.push_back(MSD); From daniel at zuster.org Mon Aug 24 03:40:12 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 08:40:12 -0000 Subject: [llvm-commits] [llvm] r79899 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp lib/MC/MCMachOStreamer.cpp test/MC/MachO/symbol-flags.s Message-ID: <200908240840.n7O8eD2N017101@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 03:40:12 2009 New Revision: 79899 URL: http://llvm.org/viewvc/llvm-project?rev=79899&view=rev Log: llvm-mc/Mach-O: Support symbol attributes. - This is mostly complete, the main thing missing is .indirect_symbol support (which would be straight-forward, except that the way it is implemented in 'as' makes getting an exact .o match interesting). Added: llvm/trunk/test/MC/MachO/symbol-flags.s Modified: llvm/trunk/include/llvm/MC/MCAssembler.h llvm/trunk/lib/MC/MCAssembler.cpp llvm/trunk/lib/MC/MCMachOStreamer.cpp Modified: llvm/trunk/include/llvm/MC/MCAssembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=79899&r1=79898&r2=79899&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAssembler.h (original) +++ llvm/trunk/include/llvm/MC/MCAssembler.h Mon Aug 24 03:40:12 2009 @@ -317,6 +317,13 @@ /// unit. unsigned IsExternal : 1; + /// IsPrivateExtern - True if this symbol is private extern. + unsigned IsPrivateExtern : 1; + + /// Flags - The Flags field is used by object file implementations to store + /// additional per symbol information which is not easily classified. + uint32_t Flags; + public: // Only for use as sentinel. MCSymbolData(); @@ -334,13 +341,22 @@ uint64_t getOffset() const { return Offset; } void setOffset(uint64_t Value) { Offset = Value; } - /// @} - /// @name Symbol Attributes - /// @{ - - bool isExternal() const { return IsExternal; } - void setExternal(bool Value) { IsExternal = Value; } + /// @} + /// @name Symbol Attributes + /// @{ + + bool isExternal() const { return IsExternal; } + void setExternal(bool Value) { IsExternal = Value; } + + bool isPrivateExtern() const { return IsPrivateExtern; } + void setPrivateExtern(bool Value) { IsPrivateExtern = Value; } + + /// getFlags - Get the (implementation defined) symbol flags. + uint32_t getFlags() const { return Flags; } + /// setFlags - Set the (implementation defined) symbol flags. + void setFlags(uint32_t Value) { Flags = Value; } + /// @} }; Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=79899&r1=79898&r2=79899&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Mon Aug 24 03:40:12 2009 @@ -291,7 +291,8 @@ // FIXME: Set STAB bits. - // FIXME: Set private external bit. + if (MSD.SymbolData->isPrivateExtern()) + Type |= STF_PrivateExtern; // Set external bit. if (MSD.SymbolData->isExternal() || Symbol.isUndefined()) @@ -302,7 +303,11 @@ Write32(MSD.StringIndex); Write8(Type); Write8(MSD.SectionIndex); - Write16(0); // FIXME: Desc + + // The Mach-O streamer uses the lowest 16-bits of the flags for the 'desc' + // value. + Write16(MSD.SymbolData->getFlags() & 0xFFFF); + Write32(0); // FIXME: Value } @@ -544,7 +549,7 @@ MCSymbolData::MCSymbolData(MCSymbol &_Symbol, MCFragment *_Fragment, uint64_t _Offset, MCAssembler *A) : Symbol(_Symbol), Fragment(_Fragment), Offset(_Offset), - IsExternal(false) + IsExternal(false), IsPrivateExtern(false), Flags(0) { if (A) A->getSymbolList().push_back(this); Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=79899&r1=79898&r2=79899&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Mon Aug 24 03:40:12 2009 @@ -19,6 +19,27 @@ namespace { class MCMachOStreamer : public MCStreamer { + /// SymbolFlags - We store the value for the 'desc' symbol field in the lowest + /// 16 bits of the implementation defined flags. + enum SymbolFlags { // See . + SF_DescFlagsMask = 0xFFFF, + + // Reference type flags. + SF_ReferenceTypeMask = 0x0007, + SF_ReferenceTypeUndefinedNonLazy = 0x0000, + SF_ReferenceTypeUndefinedLazy = 0x0001, + SF_ReferenceTypeDefined = 0x0002, + SF_ReferenceTypePrivateDefined = 0x0003, + SF_ReferenceTypePrivateUndefinedNonLazy = 0x0004, + SF_ReferenceTypePrivateUndefinedLazy = 0x0005, + + // Other 'desc' flags. + SF_NoDeadStrip = 0x0020, + SF_WeakReference = 0x0040, + SF_WeakDefinition = 0x0080 + }; + +private: MCAssembler Assembler; MCSectionData *CurSectionData; @@ -121,6 +142,9 @@ assert(!SD.getFragment() && "Unexpected fragment on symbol data!"); SD.setFragment(F); SD.setOffset(F->getContents().size()); + + // This causes the reference type and weak reference flags to be cleared. + SD.setFlags(SD.getFlags() & ~(SF_WeakReference | SF_ReferenceTypeMask)); Symbol->setSection(*CurSection); } @@ -141,18 +165,71 @@ void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute) { + // Adding a symbol attribute always introduces the symbol, note that an + // important side effect of calling getSymbolData here is to register the + // symbol with the assembler. + MCSymbolData &SD = getSymbolData(*Symbol); + + // The implementation of symbol attributes is designed to match 'as', but it + // leaves much to desired. It doesn't really make sense to arbitrarily add and + // remove flags, but 'as' allows this (in particular, see .desc). + // + // In the future it might be worth trying to make these operations more well + // defined. switch (Attribute) { - default: - llvm_unreachable("FIXME: Not yet implemented!"); + case MCStreamer::Hidden: + case MCStreamer::Internal: + case MCStreamer::Protected: + case MCStreamer::Weak: + assert(0 && "Invalid symbol attribute for Mach-O!"); + break; case MCStreamer::Global: getSymbolData(*Symbol).setExternal(true); break; + + case MCStreamer::LazyReference: + // FIXME: This requires -dynamic. + SD.setFlags(SD.getFlags() | SF_NoDeadStrip); + if (Symbol->isUndefined()) + SD.setFlags(SD.getFlags() | SF_ReferenceTypeUndefinedLazy); + break; + + case MCStreamer::IndirectSymbol: + llvm_unreachable("FIXME: Not yet implemented!"); + break; + + // Since .reference sets the no dead strip bit, it is equivalent to + // .no_dead_strip in practice. + case MCStreamer::Reference: + case MCStreamer::NoDeadStrip: + SD.setFlags(SD.getFlags() | SF_NoDeadStrip); + break; + + case MCStreamer::PrivateExtern: + SD.setExternal(true); + SD.setPrivateExtern(true); + break; + + case MCStreamer::WeakReference: + // FIXME: This requires -dynamic. + if (Symbol->isUndefined()) + SD.setFlags(SD.getFlags() | SF_WeakReference); + break; + + case MCStreamer::WeakDefinition: + // FIXME: 'as' enforces that this is defined and global. The manual claims + // it has to be in a coalesced section, but this isn't enforced. + SD.setFlags(SD.getFlags() | SF_WeakDefinition); + break; } } void MCMachOStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { - llvm_unreachable("FIXME: Not yet implemented!"); + // Encode the 'desc' value into the lowest implementation defined bits. + assert(DescValue == (DescValue & SF_DescFlagsMask) && + "Invalid .desc value!"); + getSymbolData(*Symbol).setFlags(DescValue & SF_DescFlagsMask); } void MCMachOStreamer::EmitLocalSymbol(MCSymbol *Symbol, const MCValue &Value) { Added: llvm/trunk/test/MC/MachO/symbol-flags.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/symbol-flags.s?rev=79899&view=auto ============================================================================== --- llvm/trunk/test/MC/MachO/symbol-flags.s (added) +++ llvm/trunk/test/MC/MachO/symbol-flags.s Mon Aug 24 03:40:12 2009 @@ -0,0 +1,254 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s + + .reference sym_ref_A + .reference sym_ref_def_A +sym_ref_def_A: +sym_ref_def_C: + .reference sym_ref_def_C + + .weak_reference sym_weak_ref_A + .weak_reference sym_weak_ref_def_A +sym_weak_ref_def_A: +sym_weak_ref_def_B: + .weak_reference sym_weak_ref_def_B + + .data + .globl sym_weak_def_A + .weak_definition sym_weak_def_A +sym_weak_def_A: + + .lazy_reference sym_lazy_ref_A + .lazy_reference sym_lazy_ref_B +sym_lazy_ref_B: +sym_lazy_ref_C: + .lazy_reference sym_lazy_ref_C + + .private_extern sym_private_ext_A + .private_extern sym_private_ext_B +sym_private_ext_B: +sym_private_ext_C: + .private_extern sym_private_ext_C + .private_extern sym_private_ext_D + .globl sym_private_ext_D + + .no_dead_strip sym_no_dead_strip_A + + .reference sym_ref_A + .desc sym_ref_A, 1 + .desc sym_ref_A, 0x1234 + + .desc sym_desc_flags,0x47 +sym_desc_flags: + +// CHECK: ('cputype', 7) +// CHECK: ('cpusubtype', 3) +// CHECK: ('filetype', 1) +// CHECK: ('num_load_commands', 1) +// CHECK: ('load_commands_size', 296) +// CHECK: ('flag', 0) +// CHECK: ('load_commands', [ +// CHECK: # Load Command 0 +// CHECK: (('command', 1) +// CHECK: ('size', 192) +// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('vm_addr', 0) +// CHECK: ('vm_size', 0) +// CHECK: ('file_offset', 324) +// CHECK: ('file_size', 0) +// CHECK: ('maxprot', 7) +// CHECK: ('initprot', 7) +// CHECK: ('num_sections', 2) +// CHECK: ('flags', 0) +// CHECK: ('sections', [ +// CHECK: # Section 0 +// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 0) +// CHECK: ('offset', 324) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x80000000) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: # Section 1 +// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 0) +// CHECK: ('offset', 324) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x0) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 1 +// CHECK: (('command', 2) +// CHECK: ('size', 24) +// CHECK: ('symoff', 324) +// CHECK: ('nsyms', 16) +// CHECK: ('stroff', 516) +// CHECK: ('strsize', 260) +// CHECK: ('_string_data', '\x00sym_ref_A\x00sym_weak_ref_A\x00sym_weak_def_A\x00sym_lazy_ref_A\x00sym_private_ext_A\x00sym_private_ext_B\x00sym_private_ext_C\x00sym_private_ext_D\x00sym_no_dead_strip_A\x00sym_ref_def_A\x00sym_ref_def_C\x00sym_weak_ref_def_A\x00sym_weak_ref_def_B\x00sym_lazy_ref_B\x00sym_lazy_ref_C\x00sym_desc_flags\x00\x00') +// CHECK: ('_symbols', [ +// CHECK: # Symbol 0 +// CHECK: (('n_strx', 148) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 32) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_ref_def_A') +// CHECK: ), +// CHECK: # Symbol 1 +// CHECK: (('n_strx', 162) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 32) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_ref_def_C') +// CHECK: ), +// CHECK: # Symbol 2 +// CHECK: (('n_strx', 176) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_weak_ref_def_A') +// CHECK: ), +// CHECK: # Symbol 3 +// CHECK: (('n_strx', 195) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_weak_ref_def_B') +// CHECK: ), +// CHECK: # Symbol 4 +// CHECK: (('n_strx', 214) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 32) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_lazy_ref_B') +// CHECK: ), +// CHECK: # Symbol 5 +// CHECK: (('n_strx', 229) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 32) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_lazy_ref_C') +// CHECK: ), +// CHECK: # Symbol 6 +// CHECK: (('n_strx', 244) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_desc_flags') +// CHECK: ), +// CHECK: # Symbol 7 +// CHECK: (('n_strx', 74) +// CHECK: ('n_type', 0x1f) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_private_ext_B') +// CHECK: ), +// CHECK: # Symbol 8 +// CHECK: (('n_strx', 92) +// CHECK: ('n_type', 0x1f) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_private_ext_C') +// CHECK: ), +// CHECK: # Symbol 9 +// CHECK: (('n_strx', 26) +// CHECK: ('n_type', 0xf) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 128) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_weak_def_A') +// CHECK: ), +// CHECK: # Symbol 10 +// CHECK: (('n_strx', 41) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 33) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_lazy_ref_A') +// CHECK: ), +// CHECK: # Symbol 11 +// CHECK: (('n_strx', 128) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 32) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_no_dead_strip_A') +// CHECK: ), +// CHECK: # Symbol 12 +// CHECK: (('n_strx', 56) +// CHECK: ('n_type', 0x11) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_private_ext_A') +// CHECK: ), +// CHECK: # Symbol 13 +// CHECK: (('n_strx', 110) +// CHECK: ('n_type', 0x11) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_private_ext_D') +// CHECK: ), +// CHECK: # Symbol 14 +// CHECK: (('n_strx', 1) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 4660) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_ref_A') +// CHECK: ), +// CHECK: # Symbol 15 +// CHECK: (('n_strx', 11) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 64) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_weak_ref_A') +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 2 +// CHECK: (('command', 11) +// CHECK: ('size', 80) +// CHECK: ('ilocalsym', 0) +// CHECK: ('nlocalsym', 7) +// CHECK: ('iextdefsym', 7) +// CHECK: ('nextdefsym', 3) +// CHECK: ('iundefsym', 10) +// CHECK: ('nundefsym', 6) +// CHECK: ('tocoff', 0) +// CHECK: ('ntoc', 0) +// CHECK: ('modtaboff', 0) +// CHECK: ('nmodtab', 0) +// CHECK: ('extrefsymoff', 0) +// CHECK: ('nextrefsyms', 0) +// CHECK: ('indirectsymoff', 0) +// CHECK: ('nindirectsyms', 0) +// CHECK: ('extreloff', 0) +// CHECK: ('nextrel', 0) +// CHECK: ('locreloff', 0) +// CHECK: ('nlocrel', 0) +// CHECK: ('_indirect_symbols', [ +// CHECK: ]) +// CHECK: ), +// CHECK: ]) From wendling at apple.com Mon Aug 24 03:51:05 2009 From: wendling at apple.com (Bill Wendling) Date: Mon, 24 Aug 2009 01:51:05 -0700 Subject: [llvm-commits] [llvm] r79813 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ lib/Target/XCore/ In-Reply-To: <200908230341.n7N3f8uZ013446@zion.cs.uiuc.edu> References: <200908230341.n7N3f8uZ013446@zion.cs.uiuc.edu> Message-ID: On Aug 22, 2009, at 8:41 PM, Chris Lattner wrote: > Author: lattner > Date: Sat Aug 22 22:41:05 2009 > New Revision: 79813 > > URL: http://llvm.org/viewvc/llvm-project?rev=79813&view=rev > Log: > remove various std::ostream version of printing methods from > MachineInstr and MachineOperand. This required eliminating a > bunch of stuff that was using DOUT, I hope that bill doesn't > mind me stealing his fun. ;-) > Awwww!! ;-) -bw From daniel at zuster.org Mon Aug 24 04:29:24 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 09:29:24 -0000 Subject: [llvm-commits] [llvm] r79903 - /llvm/trunk/include/llvm/Support/MemoryBuffer.h Message-ID: <200908240929.n7O9TO1N023984@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 04:29:24 2009 New Revision: 79903 URL: http://llvm.org/viewvc/llvm-project?rev=79903&view=rev Log: Add MemoryBuffer::getBuffer() -> StringRef. Modified: llvm/trunk/include/llvm/Support/MemoryBuffer.h Modified: llvm/trunk/include/llvm/Support/MemoryBuffer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryBuffer.h?rev=79903&r1=79902&r2=79903&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/MemoryBuffer.h (original) +++ llvm/trunk/include/llvm/Support/MemoryBuffer.h Mon Aug 24 04:29:24 2009 @@ -14,6 +14,7 @@ #ifndef LLVM_SUPPORT_MEMORYBUFFER_H #define LLVM_SUPPORT_MEMORYBUFFER_H +#include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" #include @@ -42,6 +43,10 @@ const char *getBufferEnd() const { return BufferEnd; } size_t getBufferSize() const { return BufferEnd-BufferStart; } + StringRef getBuffer() const { + return StringRef(BufferStart, getBufferSize()); + } + /// getBufferIdentifier - Return an identifier for this buffer, typically the /// filename it was read from. virtual const char *getBufferIdentifier() const { From daniel at zuster.org Mon Aug 24 04:29:31 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 09:29:31 -0000 Subject: [llvm-commits] [llvm] r79904 - /llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h Message-ID: <200908240929.n7O9TVGE024012@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 04:29:31 2009 New Revision: 79904 URL: http://llvm.org/viewvc/llvm-project?rev=79904&view=rev Log: Add StringRef based APIs to BitstreamWriter. Modified: llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h Modified: llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h?rev=79904&r1=79903&r2=79904&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h (original) +++ llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h Mon Aug 24 04:29:31 2009 @@ -15,6 +15,7 @@ #ifndef BITSTREAM_WRITER_H #define BITSTREAM_WRITER_H +#include "llvm/ADT/StringRef.h" #include "llvm/Bitcode/BitCodes.h" #include @@ -293,7 +294,9 @@ /// known to exist at the end of the the record. template void EmitRecordWithAbbrevImpl(unsigned Abbrev, SmallVectorImpl &Vals, - const char *BlobData, unsigned BlobLen) { + const StringRef &Blob) { + const char *BlobData = Blob.data(); + unsigned BlobLen = (unsigned) Blob.size(); unsigned AbbrevNo = Abbrev-bitc::FIRST_APPLICATION_ABBREV; assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!"); BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo]; @@ -409,7 +412,7 @@ /// the first entry. template void EmitRecordWithAbbrev(unsigned Abbrev, SmallVectorImpl &Vals) { - EmitRecordWithAbbrevImpl(Abbrev, Vals, 0, 0); + EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef()); } /// EmitRecordWithBlob - Emit the specified record to the stream, using an @@ -419,16 +422,27 @@ /// of the record. template void EmitRecordWithBlob(unsigned Abbrev, SmallVectorImpl &Vals, + const StringRef &Blob) { + EmitRecordWithAbbrevImpl(Abbrev, Vals, Blob); + } + template + void EmitRecordWithBlob(unsigned Abbrev, SmallVectorImpl &Vals, const char *BlobData, unsigned BlobLen) { - EmitRecordWithAbbrevImpl(Abbrev, Vals, BlobData, BlobLen); + return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(BlobData, BlobLen)); } /// EmitRecordWithArray - Just like EmitRecordWithBlob, works with records /// that end with an array. template void EmitRecordWithArray(unsigned Abbrev, SmallVectorImpl &Vals, + const StringRef &Array) { + EmitRecordWithAbbrevImpl(Abbrev, Vals, Array); + } + template + void EmitRecordWithArray(unsigned Abbrev, SmallVectorImpl &Vals, const char *ArrayData, unsigned ArrayLen) { - EmitRecordWithAbbrevImpl(Abbrev, Vals, ArrayData, ArrayLen); + return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(ArrayData, + ArrayLen)); } //===--------------------------------------------------------------------===// From daniel at zuster.org Mon Aug 24 04:53:06 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 09:53:06 -0000 Subject: [llvm-commits] [llvm] r79906 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp Message-ID: <200908240953.n7O9r6jO026825@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 04:53:06 2009 New Revision: 79906 URL: http://llvm.org/viewvc/llvm-project?rev=79906&view=rev Log: Add llvm::Triple::getArchTypePrefix for getting the intrinsic prefix for an identifier architecture. Modified: llvm/trunk/include/llvm/ADT/Triple.h llvm/trunk/lib/Support/Triple.cpp Modified: llvm/trunk/include/llvm/ADT/Triple.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=79906&r1=79905&r2=79906&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/Triple.h (original) +++ llvm/trunk/include/llvm/ADT/Triple.h Mon Aug 24 04:53:06 2009 @@ -238,6 +238,14 @@ /// architecture. static const char *getArchTypeName(ArchType Kind); + /// getArchTypePrefix - Get the "prefix" canonical name for the \arg Kind + /// architecture. This is the prefix used by the architecture specific + /// builtins, and is suitable for passing to \see + /// Intrinsic::getIntrinsicForGCCBuiltin(). + /// + /// \return - The architecture prefix, or 0 if none is defined. + static const char *getArchTypePrefix(ArchType Kind); + /// getVendorTypeName - Get the canonical name for the \arg Kind /// vendor. static const char *getVendorTypeName(VendorType Kind); Modified: llvm/trunk/lib/Support/Triple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=79906&r1=79905&r2=79906&view=diff ============================================================================== --- llvm/trunk/lib/Support/Triple.cpp (original) +++ llvm/trunk/lib/Support/Triple.cpp Mon Aug 24 04:53:06 2009 @@ -43,6 +43,31 @@ return ""; } +const char *Triple::getArchTypePrefix(ArchType Kind) { + switch (Kind) { + default: + return 0; + + case alpha: return "alpha"; + + case arm: + case thumb: return "arm"; + + case bfin: return "bfin"; + + case cellspu: return "spu"; + + case ppc64: + case ppc: return "ppc"; + + case sparc: return "sparc"; + + case x86: + case x86_64: return "x86"; + case xcore: return "xcore"; + } +} + const char *Triple::getVendorTypeName(VendorType Kind) { switch (Kind) { case UnknownVendor: return "unknown"; From baldrick at free.fr Mon Aug 24 05:34:42 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 10:34:42 -0000 Subject: [llvm-commits] [llvm] r79908 - /llvm/trunk/lib/AsmParser/LLLexer.cpp Message-ID: <200908241034.n7OAYhAF028431@zion.cs.uiuc.edu> Author: baldrick Date: Mon Aug 24 05:34:41 2009 New Revision: 79908 URL: http://llvm.org/viewvc/llvm-project?rev=79908&view=rev Log: Fix the build with gcc-4.4 on linux: header needed for EOF. Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=79908&r1=79907&r2=79908&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Mon Aug 24 05:34:41 2009 @@ -21,6 +21,7 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Assembly/Parser.h" +#include #include #include using namespace llvm; From baldrick at free.fr Mon Aug 24 05:59:01 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 10:59:01 -0000 Subject: [llvm-commits] [llvm] r79909 - /llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <200908241059.n7OAx1xT031328@zion.cs.uiuc.edu> Author: baldrick Date: Mon Aug 24 05:59:01 2009 New Revision: 79909 URL: http://llvm.org/viewvc/llvm-project?rev=79909&view=rev Log: Fix the build when using gcc-4.4 on linux. Header needed for stderr and fprintf. Modified: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Modified: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp?rev=79909&r1=79908&r2=79909&view=diff ============================================================================== --- llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp (original) +++ llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Mon Aug 24 05:59:01 2009 @@ -37,6 +37,7 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Signals.h" +#include #include #include using namespace llvm; From daniel at zuster.org Mon Aug 24 06:56:59 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 11:56:59 -0000 Subject: [llvm-commits] [llvm] r79910 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp lib/MC/MCMachOStreamer.cpp Message-ID: <200908241156.n7OBuxuB005986@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 06:56:58 2009 New Revision: 79910 URL: http://llvm.org/viewvc/llvm-project?rev=79910&view=rev Log: llvm-mc/Mach-O: Preliminary support for indirect symbols. - The indirect table itself isn't being filled in yet. - This isn't factored properly and is rather FIXMEd, but at the moment I'm more focused on figuring out what it needs to do. Modified: llvm/trunk/include/llvm/MC/MCAssembler.h llvm/trunk/lib/MC/MCAssembler.cpp llvm/trunk/lib/MC/MCMachOStreamer.cpp Modified: llvm/trunk/include/llvm/MC/MCAssembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=79910&r1=79909&r2=79910&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAssembler.h (original) +++ llvm/trunk/include/llvm/MC/MCAssembler.h Mon Aug 24 06:56:58 2009 @@ -16,6 +16,7 @@ #include "llvm/MC/MCValue.h" #include "llvm/Support/Casting.h" #include "llvm/Support/DataTypes.h" +#include // FIXME: Shouldn't be needed. namespace llvm { class raw_ostream; @@ -360,6 +361,12 @@ /// @} }; +// FIXME: This really doesn't belong here. See comments below. +struct IndirectSymbolData { + MCSymbol *Symbol; + MCSectionData *SectionData; +}; + class MCAssembler { public: typedef iplist SectionDataListType; @@ -371,6 +378,8 @@ typedef SymbolDataListType::const_iterator const_symbol_iterator; typedef SymbolDataListType::iterator symbol_iterator; + typedef std::vector::iterator indirect_symbol_iterator; + private: MCAssembler(const MCAssembler&); // DO NOT IMPLEMENT void operator=(const MCAssembler&); // DO NOT IMPLEMENT @@ -381,6 +390,8 @@ iplist Symbols; + std::vector IndirectSymbols; + private: /// LayoutSection - Assign offsets and sizes to the fragments in the section /// \arg SD, and update the section size. The section file offset should @@ -432,6 +443,27 @@ size_t symbol_size() const { return Symbols.size(); } /// @} + /// @name Indirect Symbol List Access + /// @{ + + // FIXME: This is a total hack, this should not be here. Once things are + // factored so that the streamer has direct access to the .o writer, it can + // disappear. + std::vector &getIndirectSymbols() { + return IndirectSymbols; + } + + indirect_symbol_iterator indirect_symbol_begin() { + return IndirectSymbols.begin(); + } + + indirect_symbol_iterator indirect_symbol_end() { + return IndirectSymbols.end(); + } + + size_t indirect_symbol_size() const { return IndirectSymbols.size(); } + + /// @} }; } // end namespace llvm Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=79910&r1=79909&r2=79910&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Mon Aug 24 06:56:58 2009 @@ -311,12 +311,68 @@ Write32(0); // FIXME: Value } + void BindIndirectSymbols(MCAssembler &Asm) { + // This is the point where 'as' creates actual symbols for indirect symbols + // (in the following two passes). It would be easier for us to do this + // sooner when we see the attribute, but that makes getting the order in the + // symbol table much more complicated than it is worth. + // + // FIXME: Revisit this when the dust settles. + + // FIXME: This should not be needed. + DenseMap SymbolMap; + + for (MCAssembler::symbol_iterator it = Asm.symbol_begin(), + ie = Asm.symbol_end(); it != ie; ++it) + SymbolMap[&it->getSymbol()] = it; + + // Bind non lazy symbol pointers first. + for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(), + ie = Asm.indirect_symbol_end(); it != ie; ++it) { + // FIXME: cast<> support! + const MCSectionMachO &Section = + static_cast(it->SectionData->getSection()); + + unsigned Type = + Section.getTypeAndAttributes() & MCSectionMachO::SECTION_TYPE; + if (Type != MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS) + continue; + + MCSymbolData *&Entry = SymbolMap[it->Symbol]; + if (!Entry) + Entry = new MCSymbolData(*it->Symbol, 0, 0, &Asm); + } + + // Then lazy symbol pointers and symbol stubs. + for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(), + ie = Asm.indirect_symbol_end(); it != ie; ++it) { + // FIXME: cast<> support! + const MCSectionMachO &Section = + static_cast(it->SectionData->getSection()); + + unsigned Type = + Section.getTypeAndAttributes() & MCSectionMachO::SECTION_TYPE; + if (Type != MCSectionMachO::S_LAZY_SYMBOL_POINTERS && + Type != MCSectionMachO::S_SYMBOL_STUBS) + continue; + + MCSymbolData *&Entry = SymbolMap[it->Symbol]; + if (!Entry) { + Entry = new MCSymbolData(*it->Symbol, 0, 0, &Asm); + + // Set the symbol type to undefined lazy, but only on construction. + // + // FIXME: Do not hardcode. + Entry->setFlags(Entry->getFlags() | 0x0001); + } + } + } + /// ComputeSymbolTable - Compute the symbol table data /// /// \param StringTable [out] - The string table data. /// \param StringIndexMap [out] - Map from symbol names to offsets in the /// string table. - void ComputeSymbolTable(MCAssembler &Asm, SmallString<256> &StringTable, std::vector &LocalSymbolData, std::vector &ExternalSymbolData, @@ -414,6 +470,8 @@ void WriteObject(MCAssembler &Asm) { unsigned NumSections = Asm.size(); + BindIndirectSymbols(Asm); + // Compute symbol table information. SmallString<256> StringTable; std::vector LocalSymbolData; @@ -467,22 +525,32 @@ // Write the symbol table load command, if used. if (NumSymbols) { - // The string table is written after all the section data. - uint64_t SymbolTableOffset = SectionDataStartOffset + SectionDataSize; - uint64_t StringTableOffset = - SymbolTableOffset + NumSymbols * Nlist32Size; - WriteSymtabLoadCommand(SymbolTableOffset, NumSymbols, - StringTableOffset, StringTable.size()); - unsigned FirstLocalSymbol = 0; unsigned NumLocalSymbols = LocalSymbolData.size(); unsigned FirstExternalSymbol = FirstLocalSymbol + NumLocalSymbols; unsigned NumExternalSymbols = ExternalSymbolData.size(); unsigned FirstUndefinedSymbol = FirstExternalSymbol + NumExternalSymbols; unsigned NumUndefinedSymbols = UndefinedSymbolData.size(); - // FIXME: Get correct symbol indices and counts for indirect symbols. - unsigned IndirectSymbolOffset = 0; - unsigned NumIndirectSymbols = 0; + unsigned NumIndirectSymbols = Asm.indirect_symbol_size(); + unsigned NumSymTabSymbols = + NumLocalSymbols + NumExternalSymbols + NumUndefinedSymbols; + uint64_t IndirectSymbolSize = NumIndirectSymbols * 4; + uint64_t IndirectSymbolOffset = 0; + + // If used, the indirect symbols are written after the section data. + if (NumIndirectSymbols) + IndirectSymbolOffset = SectionDataStartOffset + SectionDataSize; + + // The symbol table is written after the indirect symbol data. + uint64_t SymbolTableOffset = + SectionDataStartOffset + SectionDataSize + IndirectSymbolSize; + + // The string table is written after symbol table. + uint64_t StringTableOffset = + SymbolTableOffset + NumSymTabSymbols * Nlist32Size; + WriteSymtabLoadCommand(SymbolTableOffset, NumSymTabSymbols, + StringTableOffset, StringTable.size()); + WriteDysymtabLoadCommand(FirstLocalSymbol, NumLocalSymbols, FirstExternalSymbol, NumExternalSymbols, FirstUndefinedSymbol, NumUndefinedSymbols, @@ -495,9 +563,13 @@ // Write the symbol table data, if used. if (NumSymbols) { - // FIXME: Check that offsets match computed ones. + // Write the indirect symbol entries. + // + // FIXME: We need the symbol index map for this. + for (unsigned i = 0, e = Asm.indirect_symbol_size(); i != e; ++i) + Write32(0); - // FIXME: Some of these are ordered by name to help the linker. + // FIXME: Check that offsets match computed ones. // Write the symbol table entries. for (unsigned i = 0, e = LocalSymbolData.size(); i != e; ++i) Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=79910&r1=79909&r2=79910&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Mon Aug 24 06:56:58 2009 @@ -165,6 +165,16 @@ void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute) { + // Indirect symbols are handled differently, to match how 'as' handles + // them. This makes writing matching .o files easier. + if (Attribute == MCStreamer::IndirectSymbol) { + IndirectSymbolData ISD; + ISD.Symbol = Symbol; + ISD.SectionData = CurSectionData; + Assembler.getIndirectSymbols().push_back(ISD); + return; + } + // Adding a symbol attribute always introduces the symbol, note that an // important side effect of calling getSymbolData here is to register the // symbol with the assembler. @@ -177,6 +187,7 @@ // In the future it might be worth trying to make these operations more well // defined. switch (Attribute) { + case MCStreamer::IndirectSymbol: case MCStreamer::Hidden: case MCStreamer::Internal: case MCStreamer::Protected: @@ -195,10 +206,6 @@ SD.setFlags(SD.getFlags() | SF_ReferenceTypeUndefinedLazy); break; - case MCStreamer::IndirectSymbol: - llvm_unreachable("FIXME: Not yet implemented!"); - break; - // Since .reference sets the no dead strip bit, it is equivalent to // .no_dead_strip in practice. case MCStreamer::Reference: From baldrick at free.fr Mon Aug 24 07:50:27 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 12:50:27 -0000 Subject: [llvm-commits] [gcc-plugin] r79914 - /gcc-plugin/trunk/Makefile Message-ID: <200908241250.n7OCoR2B012569@zion.cs.uiuc.edu> Author: baldrick Date: Mon Aug 24 07:50:27 2009 New Revision: 79914 URL: http://llvm.org/viewvc/llvm-project?rev=79914&view=rev Log: Also clean up in the target directory. Modified: gcc-plugin/trunk/Makefile Modified: gcc-plugin/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/Makefile?rev=79914&r1=79913&r2=79914&view=diff ============================================================================== --- gcc-plugin/trunk/Makefile (original) +++ gcc-plugin/trunk/Makefile Mon Aug 24 07:50:27 2009 @@ -27,4 +27,4 @@ $(CXX) -shared $^ -o $@ ${LDFLAGS} clean:: - rm -f *.o *.so + rm -f *.o *.so $(ARCH_DIR)/*.o From baldrick at free.fr Mon Aug 24 08:17:51 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 13:17:51 -0000 Subject: [llvm-commits] [gcc-plugin] r79915 - in /gcc-plugin/trunk: llvm-backend.cpp llvm-convert.cpp llvm-internal.h Message-ID: <200908241317.n7ODHq4i015929@zion.cs.uiuc.edu> Author: baldrick Date: Mon Aug 24 08:17:51 2009 New Revision: 79915 URL: http://llvm.org/viewvc/llvm-project?rev=79915&view=rev Log: Sync with llvm-gcc revision 79340. Modified: gcc-plugin/trunk/llvm-backend.cpp gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=79915&r1=79914&r2=79915&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Mon Aug 24 08:17:51 2009 @@ -47,7 +47,6 @@ #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/StandardPasses.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/FormattedStream.h" #include "llvm/System/Program.h" @@ -108,8 +107,6 @@ TargetMachine *TheTarget = 0; TargetFolder *TheFolder = 0; TypeConverter *TheTypeConverter = 0; -llvm::OStream *AsmOutFile = 0; -llvm::OStream *AsmIntermediateOutFile = 0; /// DisableLLVMOptimizations - Allow the user to specify: /// "-mllvm -disable-llvm-optzns" on the llvm-gcc command line to force llvm @@ -352,6 +349,32 @@ } } +//TODO// GuessAtInliningThreshold - Figure out a reasonable threshold to pass llvm's +//TODO// inliner. There are 12 user-settable gcc params that affect inlining. llvm +//TODO// (so far) only has one knob; the param that corresponds most closely, and +//TODO// which we use, is max-inline-insns-auto (set by -finline-limit, which is +//TODO// what most users actually use). This maps only very approximately to what +//TODO// llvm's inliner is doing, but it's the best we've got. +//TODOstatic unsigned GuessAtInliningThreshold() { +//TODO unsigned threshold = 200; +//TODO // Get the default value for gcc's max-inline-insns-auto. This is the value +//TODO // after all language and target dependent changes to the global default are +//TODO // applied, but before parsing the command line. +//TODO unsigned default_miia = default_max_inline_insns_auto; +//TODO // See if the actual value is the same as the default. +//TODO unsigned miia = MAX_INLINE_INSNS_AUTO; +//TODO if (miia == default_miia) { +//TODO if (optimize_size || optimize < 3) +//TODO // Reduce inline limit. +//TODO threshold = 50; +//TODO } else { +//TODO // We have an overriding user-specified value. Multiply by 20/9, which is +//TODO // the Magic Number converting 90 to 200. +//TODO threshold = miia * 20 / 9; +//TODO } +//TODO return threshold; +//TODO} + #ifndef LLVM_TARGET_NAME #error LLVM_TARGET_NAME macro not specified by GCC backend #endif @@ -415,9 +438,6 @@ //TODO Args.push_back("--debug-pass=Structure"); //TODO if (flag_debug_pass_arguments) //TODO Args.push_back("--debug-pass=Arguments"); -//TODO if (optimize_size || optimize < 3) -//TODO // Reduce inline limit. Default limit is 200. -//TODO Args.push_back("--inline-threshold=50"); if (flag_unwind_tables) Args.push_back("--unwind-tables"); @@ -426,6 +446,12 @@ //TODO // purposes, and shouldn't really be for general use. //TODO std::vector ArgStrings; //TODO +//TODO if (flag_inline_trees > 1) { +//TODO unsigned threshold = GuessAtInliningThreshold(); +//TODO std::string Arg("--inline-threshold="+utostr(threshold)); +//TODO ArgStrings.push_back(Arg); +//TODO } +//TODO //TODO if (flag_limited_precision > 0) { //TODO std::string Arg("--limit-float-precision="+utostr(flag_limited_precision)); //TODO ArgStrings.push_back(Arg); @@ -588,8 +614,8 @@ //TODO } //TODO //TODO if (!TheModule) { -//TODO cerr << "Error reading bytecodes from PCH file\n"; -//TODO cerr << ErrMsg << "\n"; +//TODO errs() << "Error reading bytecodes from PCH file\n"; +//TODO errs() << ErrMsg << "\n"; //TODO exit(1); //TODO } //TODO @@ -616,7 +642,6 @@ //TODO AsmOutRawStream = //TODO new formatted_raw_ostream(*new raw_os_ostream(*AsmOutStream), //TODO formatted_raw_ostream::DELETE_STREAM); -//TODO AsmOutFile = new OStream(*AsmOutStream); //TODO //TODO PerModulePasses = new PassManager(); //TODO PerModulePasses->add(new TargetData(*TheTarget->getTargetData())); @@ -700,7 +725,7 @@ //TODO OptLevel)) { //TODO default: //TODO case FileModel::Error: -//TODO cerr << "Error interfacing to target machine!\n"; +//TODO errs() << "Error interfacing to target machine!\n"; //TODO exit(1); //TODO case FileModel::AsmFile: //TODO break; @@ -708,7 +733,7 @@ //TODO //TODO if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0, //TODO OptLevel)) { -//TODO cerr << "Error interfacing to target machine!\n"; +//TODO errs() << "Error interfacing to target machine!\n"; //TODO exit(1); //TODO } //TODO } @@ -795,7 +820,7 @@ //TODO OptLevel)) { //TODO default: //TODO case FileModel::Error: -//TODO cerr << "Error interfacing to target machine!\n"; +//TODO errs() << "Error interfacing to target machine!\n"; //TODO exit(1); //TODO case FileModel::AsmFile: //TODO break; @@ -803,7 +828,7 @@ //TODO //TODO if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0, //TODO OptLevel)) { -//TODO cerr << "Error interfacing to target machine!\n"; +//TODO errs() << "Error interfacing to target machine!\n"; //TODO exit(1); //TODO } //TODO } @@ -823,7 +848,6 @@ //TODO AsmOutRawStream = //TODO new formatted_raw_ostream(*new raw_os_ostream(*AsmOutStream), //TODO formatted_raw_ostream::DELETE_STREAM); -//TODO AsmOutFile = new OStream(*AsmOutStream); //TODO //TODO flag_llvm_pch_read = 0; //TODO @@ -957,7 +981,6 @@ //TODO strcat(&asm_intermediate_out_filename[0],".0"); //TODO FILE *asm_intermediate_out_file = fopen(asm_intermediate_out_filename, "w+b"); //TODO AsmIntermediateOutStream = new oFILEstream(asm_intermediate_out_file); -//TODO AsmIntermediateOutFile = new OStream(*AsmIntermediateOutStream); //TODO raw_ostream *AsmIntermediateRawOutStream = //TODO new raw_os_ostream(*AsmIntermediateOutStream); //TODO if (emit_llvm_bc) @@ -972,8 +995,6 @@ //TODO fflush(asm_intermediate_out_file); //TODO delete AsmIntermediateOutStream; //TODO AsmIntermediateOutStream = 0; -//TODO delete AsmIntermediateOutFile; -//TODO AsmIntermediateOutFile = 0; //TODO } //TODO //TODO // Run module-level optimizers, if any are present. @@ -998,8 +1019,6 @@ //TODO AsmOutRawStream = 0; //TODO delete AsmOutStream; //TODO AsmOutStream = 0; -//TODO delete AsmOutFile; -//TODO AsmOutFile = 0; //TODO timevar_pop(TV_LLVM_PERFILE); //TODO} //TODO Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=79915&r1=79914&r2=79915&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Mon Aug 24 08:17:51 2009 @@ -1,4 +1,4 @@ -/* High-level LLVM backend interface +/* High-level LLVM backend interface Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Chris Lattner (sabre at nondot.org) @@ -171,10 +171,10 @@ Fn = 0; ReturnBB = UnwindBB = 0; ReturnOffset = 0; - + if (TheDebugInfo) { expanded_location Location = expand_location(DECL_SOURCE_LOCATION (fndecl)); - + if (Location.file) { TheDebugInfo->setLocationFile(Location.file); TheDebugInfo->setLocationLine(Location.line); @@ -269,7 +269,7 @@ const LLVMBuilder &B, CallingConv::ID &CC) : FunctionDecl(FnDecl), AI(ai), Builder(B), Offset(0), CallingConv(CC), isShadowRet(false) {} - + /// getCallingConv - This provides the desired CallingConv for the function. CallingConv::ID& getCallingConv(void) { return CallingConv; } @@ -284,11 +284,11 @@ } void clear() { assert(NameStack.size() == 1 && LocStack.size() == 1 && "Imbalance!"); - NameStack.clear(); + NameStack.clear(); LocStack.clear(); } - - void HandleAggregateShadowResult(const PointerType *PtrArgTy, + + void HandleAggregateShadowResult(const PointerType *PtrArgTy, bool RetPtr) { // If the function returns a structure by value, we transform the function // to take a pointer to the result as the first argument of the function @@ -305,14 +305,14 @@ ++AI; return; } - + // Otherwise, this must be something returned with NRVO. assert(TREE_CODE(TREE_TYPE(ResultDecl)) == REFERENCE_TYPE && "Not type match and not passing by reference?"); // Create an alloca for the ResultDecl. Value *Tmp = TheTreeToLLVM->CreateTemporary(AI->getType()); Builder.CreateStore(AI, Tmp); - + SET_DECL_LLVM(ResultDecl, Tmp); if (TheDebugInfo) { TheDebugInfo->EmitDeclare(ResultDecl, @@ -349,7 +349,7 @@ // If this is just a mismatch between integer types, this is due // to K&R prototypes, where the forward proto defines the arg as int // and the actual impls is a short or char. - assert(ArgVal->getType() == Type::getInt32Ty(Context) && + assert(ArgVal->getType() == Type::getInt32Ty(Context) && LLVMTy->isInteger() && "Lowerings don't match?"); ArgVal = Builder.CreateTrunc(ArgVal, LLVMTy,NameStack.back().c_str()); @@ -382,13 +382,13 @@ void EnterField(unsigned FieldNo, const llvm::Type *StructTy) { NameStack.push_back(NameStack.back()+"."+utostr(FieldNo)); - + Value *Loc = LocStack.back(); // This cast only involves pointers, therefore BitCast. Loc = Builder.CreateBitCast(Loc, PointerType::getUnqual(StructTy)); Loc = Builder.CreateStructGEP(Loc, FieldNo); - LocStack.push_back(Loc); + LocStack.push_back(Loc); } void ExitField() { NameStack.pop_back(); @@ -420,7 +420,7 @@ // Get the name of the function. if (tree ID = DECL_ASSEMBLER_NAME(FnDecl)) Name = IDENTIFIER_POINTER(ID); - + // Determine the FunctionType and calling convention for this function. tree static_chain = cfun->static_chain_decl; const FunctionType *FTy; @@ -429,7 +429,7 @@ // If the function has no arguments and is varargs (...), turn it into a // non-varargs function by scanning the param list for the function. This - // allows C functions declared as "T foo() {}" to be treated like + // allows C functions declared as "T foo() {}" to be treated like // "T foo(void) {}" and allows us to handle functions with K&R-style // definitions correctly. if (TYPE_ARG_TYPES(TREE_TYPE(FnDecl)) == 0) { @@ -444,7 +444,7 @@ static_chain, CallingConv, PAL); } - + // If we've already seen this function and created a prototype, and if the // proto has the right LLVM type, just use it. if (DECL_LLVM_SET_P(FnDecl) && @@ -465,7 +465,7 @@ assert(FnEntry->getCallingConv() == static_cast(CallingConv) && "Calling convention disagreement between prototype and impl!"); } - + // Otherwise, either it exists with the wrong type or it doesn't exist. In // either case create a new function. Fn = Function::Create(FTy, Function::ExternalLinkage, Name, TheModule); @@ -552,10 +552,10 @@ // Create a new basic block for the function. Builder.SetInsertPoint(BasicBlock::Create(Context, "entry", Fn)); - + if (TheDebugInfo) TheDebugInfo->EmitFunctionStart(FnDecl, Fn, Builder.GetInsertBlock()); - + // Loop over all of the arguments to the function, setting Argument names and // creating argument alloca's for the PARM_DECLs in case their address is // exposed. @@ -606,7 +606,7 @@ SET_DECL_LLVM(Args, Tmp); if (TheDebugInfo) { TheDebugInfo->EmitDeclare(Args, dwarf::DW_TAG_arg_variable, - Name, TREE_TYPE(Args), Tmp, + Name, TREE_TYPE(Args), Tmp, Builder.GetInsertBlock()); } @@ -618,7 +618,7 @@ if (POINTER_TYPE_P(TREE_TYPE(Args)) && lookup_attribute ("gcroot", TYPE_ATTRIBUTES(TREE_TYPE(Args)))) EmitTypeGcroot(Tmp, Args); - + Client.setName(Name); Client.setLocation(Tmp); ABIConverter.HandleArgument(TREE_TYPE(Args), ScalarArgs); @@ -638,7 +638,7 @@ if (cfun->nonlocal_goto_save_area) { // Not supported yet. } - + //TODO // As it turns out, not all temporaries are associated with blocks. For those //TODO // that aren't, emit them now. //TODO for (tree t = cfun->unexpanded_var_list; t; t = TREE_CHAIN(t)) { @@ -685,10 +685,10 @@ // Otherwise, this aggregate result must be something that is returned // in a scalar register for this target. We must bit convert the // aggregate to the specified scalar type, which we do by casting the - // pointer and loading. The load does not necessarily start at the + // pointer and loading. The load does not necessarily start at the // beginning of the aggregate (x86-64). if (ReturnOffset) { - RetVal = BitCastToType(RetVal, + RetVal = BitCastToType(RetVal, PointerType::getUnqual(Type::getInt8Ty(Context))); RetVal = Builder.CreateGEP(RetVal, ConstantInt::get(TD.getIntPtrType(Context), ReturnOffset)); @@ -805,7 +805,7 @@ EmitBlock(BasicBlock::Create(Context, "")); } } - + // Wrap things up. return FinishFunctionBody(); } @@ -814,9 +814,9 @@ assert((isAggregateTreeType(TREE_TYPE(exp)) == (DestLoc != 0) || TREE_CODE(exp) == MODIFY_EXPR || TREE_CODE(exp) == INIT_EXPR) && "Didn't pass DestLoc to an aggregate expr, or passed it to scalar!"); - + Value *Result = 0; - + if (TheDebugInfo) { if (EXPR_HAS_LOCATION(exp)) { // Set new location on the way up the tree. @@ -826,7 +826,7 @@ TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock()); } - + switch (TREE_CODE(exp)) { default: std::cerr << "Unhandled expression!\n" @@ -881,8 +881,8 @@ case TRUTH_NOT_EXPR: Result = EmitTRUTH_NOT_EXPR(exp); break; // Binary Operators - case LT_EXPR: - Result = EmitCompare(exp, ICmpInst::ICMP_ULT, ICmpInst::ICMP_SLT, + case LT_EXPR: + Result = EmitCompare(exp, ICmpInst::ICMP_ULT, ICmpInst::ICMP_SLT, FCmpInst::FCMP_OLT); break; case LE_EXPR: @@ -894,21 +894,21 @@ FCmpInst::FCMP_OGT); break; case GE_EXPR: - Result = EmitCompare(exp, ICmpInst::ICMP_UGE, ICmpInst::ICMP_SGE, + Result = EmitCompare(exp, ICmpInst::ICMP_UGE, ICmpInst::ICMP_SGE, FCmpInst::FCMP_OGE); break; case EQ_EXPR: - Result = EmitCompare(exp, ICmpInst::ICMP_EQ, ICmpInst::ICMP_EQ, + Result = EmitCompare(exp, ICmpInst::ICMP_EQ, ICmpInst::ICMP_EQ, FCmpInst::FCMP_OEQ); break; case NE_EXPR: - Result = EmitCompare(exp, ICmpInst::ICMP_NE, ICmpInst::ICMP_NE, + Result = EmitCompare(exp, ICmpInst::ICMP_NE, ICmpInst::ICMP_NE, FCmpInst::FCMP_UNE); break; - case UNORDERED_EXPR: + case UNORDERED_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_UNO); break; - case ORDERED_EXPR: + case ORDERED_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_ORD); break; case UNLT_EXPR: Result = EmitCompare(exp, 0, 0, FCmpInst::FCMP_ULT); break; @@ -936,17 +936,17 @@ Instruction::Mul); break; case EXACT_DIV_EXPR: Result = EmitEXACT_DIV_EXPR(exp, DestLoc); break; - case TRUNC_DIV_EXPR: + case TRUNC_DIV_EXPR: if (TYPE_UNSIGNED(TREE_TYPE(exp))) Result = EmitBinOp(exp, DestLoc, Instruction::UDiv); - else + else Result = EmitBinOp(exp, DestLoc, Instruction::SDiv); break; case RDIV_EXPR: Result = EmitBinOp(exp, DestLoc, Instruction::FDiv); break; case CEIL_DIV_EXPR: Result = EmitCEIL_DIV_EXPR(exp); break; case FLOOR_DIV_EXPR: Result = EmitFLOOR_DIV_EXPR(exp); break; case ROUND_DIV_EXPR: Result = EmitROUND_DIV_EXPR(exp); break; - case TRUNC_MOD_EXPR: + case TRUNC_MOD_EXPR: if (TYPE_UNSIGNED(TREE_TYPE(exp))) Result = EmitBinOp(exp, DestLoc, Instruction::URem); else @@ -964,14 +964,14 @@ TYPE_UNSIGNED(TREE_TYPE(exp)) ? Instruction::LShr : Instruction::AShr); break; case LSHIFT_EXPR: Result = EmitShiftOp(exp,DestLoc,Instruction::Shl);break; - case RROTATE_EXPR: + case RROTATE_EXPR: Result = EmitRotateOp(exp, Instruction::LShr, Instruction::Shl); break; case LROTATE_EXPR: Result = EmitRotateOp(exp, Instruction::Shl, Instruction::LShr); break; - case MIN_EXPR: - Result = EmitMinMaxExpr(exp, ICmpInst::ICMP_ULE, ICmpInst::ICMP_SLE, + case MIN_EXPR: + Result = EmitMinMaxExpr(exp, ICmpInst::ICMP_ULE, ICmpInst::ICMP_SLE, FCmpInst::FCMP_OLE); break; case MAX_EXPR: @@ -979,11 +979,11 @@ FCmpInst::FCMP_OGE); break; case CONSTRUCTOR: Result = EmitCONSTRUCTOR(exp, DestLoc); break; - + // Complex Math Expressions. case COMPLEX_CST: EmitCOMPLEX_CST (exp, DestLoc); break; case COMPLEX_EXPR: EmitCOMPLEX_EXPR(exp, DestLoc); break; - + // Constant Expressions case INTEGER_CST: Result = TreeConstantToLLVM::ConvertINTEGER_CST(exp); @@ -1003,7 +1003,7 @@ } assert(((DestLoc && Result == 0) || DestLoc == 0) && - "Expected a scalar or aggregate but got the wrong thing!"); + "Expected a scalar or aggregate but got the wrong thing!"); // Check that the type of the result matches that of the tree node. If the // result is not used then GCC sometimes sets the tree type to VOID_TYPE, so // don't take VOID_TYPE too seriously here. @@ -1028,7 +1028,7 @@ std::cerr << "Unhandled lvalue expression!\n"; debug_tree(exp); abort(); - + case PARM_DECL: case VAR_DECL: case FUNCTION_DECL: @@ -1110,7 +1110,7 @@ void TreeToLLVM::TODO(tree exp) { std::cerr << "Unhandled tree node\n"; if (exp) debug_tree(exp); - abort(); + abort(); } /// CastToType - Cast the specified value to the specified type if it is @@ -1128,7 +1128,7 @@ /// CastToAnyType - Cast the specified value to the specified type making no /// assumptions about the types of the arguments. This creates an inferred cast. -Value *TreeToLLVM::CastToAnyType(Value *V, bool VisSigned, +Value *TreeToLLVM::CastToAnyType(Value *V, bool VisSigned, const Type* Ty, bool TyIsSigned) { // Eliminate useless casts of a type to itself. if (V->getType() == Ty) @@ -1136,7 +1136,7 @@ // The types are different so we must cast. Use getCastOpcode to create an // inferred cast opcode. - Instruction::CastOps opc = + Instruction::CastOps opc = CastInst::getCastOpcode(V, VisSigned, Ty, TyIsSigned); // Generate the cast and return it. @@ -1154,7 +1154,7 @@ unsigned DstBits = Ty->getPrimitiveSizeInBits(); assert(SrcBits != DstBits && "Types are different but have same #bits?"); - Instruction::CastOps opcode = + Instruction::CastOps opcode = (SrcBits > DstBits ? Instruction::Trunc : Instruction::ZExt); return CastToType(opcode, V, Ty); } @@ -1170,7 +1170,7 @@ unsigned DstBits = Ty->getPrimitiveSizeInBits(); assert(SrcBits != DstBits && "Types are different but have same #bits?"); - Instruction::CastOps opcode = + Instruction::CastOps opcode = (SrcBits > DstBits ? Instruction::Trunc : Instruction::SExt); return CastToType(opcode, V, Ty); } @@ -1182,12 +1182,12 @@ unsigned DstBits = Ty->getPrimitiveSizeInBits(); if (SrcBits == DstBits) return V; - Instruction::CastOps opcode = (SrcBits > DstBits ? + Instruction::CastOps opcode = (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt); return CastToType(opcode, V, Ty); } -/// BitCastToType - Insert a BitCast from V to Ty if needed. This is just a +/// BitCastToType - Insert a BitCast from V to Ty if needed. This is just a /// shorthand convenience function for CastToType(Instruction::BitCast,V,Ty). Value *TreeToLLVM::BitCastToType(Value *V, const Type *Ty) { return CastToType(Instruction::BitCast, V, Ty); @@ -1235,7 +1235,7 @@ // Otherwise, fall through to this block. Builder.CreateBr(BB); } - + // Add this block. Fn->getBasicBlockList().push_back(BB); Builder.SetInsertPoint(BB); // It is now the current block. @@ -1299,7 +1299,7 @@ } } -/// containsFPField - indicates whether the given LLVM type +/// containsFPField - indicates whether the given LLVM type /// contains any floating point elements. static bool containsFPField(const Type *LLVMTy) { @@ -1307,7 +1307,7 @@ return true; const StructType* STy = dyn_cast(LLVMTy); if (STy) { - for (StructType::element_iterator I = STy->element_begin(), + for (StructType::element_iterator I = STy->element_begin(), E = STy->element_end(); I != E; I++) { const Type *Ty = *I; if (Ty->isFloatingPoint()) @@ -1349,12 +1349,12 @@ // If the GCC type is not fully covered by the LLVM type, use memcpy. This // can occur with unions etc. if ((TREE_CODE(type) != UNION_TYPE || !containsFPField(LLVMTy)) && - !TheTypeConverter->GCCTypeOverlapsWithLLVMTypePadding(type, LLVMTy) && + !TheTypeConverter->GCCTypeOverlapsWithLLVMTypePadding(type, LLVMTy) && // Don't copy tons of tiny elements. CountAggregateElements(LLVMTy) <= 8) { - DestLoc.Ptr = BitCastToType(DestLoc.Ptr, + DestLoc.Ptr = BitCastToType(DestLoc.Ptr, PointerType::getUnqual(LLVMTy)); - SrcLoc.Ptr = BitCastToType(SrcLoc.Ptr, + SrcLoc.Ptr = BitCastToType(SrcLoc.Ptr, PointerType::getUnqual(LLVMTy)); CopyAggregate(DestLoc, SrcLoc, Builder, type); return; @@ -1407,7 +1407,7 @@ if (!TheTypeConverter->GCCTypeOverlapsWithLLVMTypePadding(type, LLVMTy) && // Don't zero tons of tiny elements. CountAggregateElements(LLVMTy) <= 8) { - DestLoc.Ptr = BitCastToType(DestLoc.Ptr, + DestLoc.Ptr = BitCastToType(DestLoc.Ptr, PointerType::getUnqual(LLVMTy)); ZeroAggregate(DestLoc, Builder); return; @@ -1460,7 +1460,7 @@ CastToSIntType(Size, IntPtr), ConstantInt::get(Type::getInt32Ty(Context), Align) }; - + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::memset, &IntPtr, 1), Ops, Ops+4); return Ops[0]; @@ -1474,30 +1474,30 @@ Function *gcrootFun = Intrinsic::getDeclaration(TheModule, Intrinsic::gcroot); - + // The idea is that it's a pointer to type "Value" // which is opaque* but the routine expects i8** and i8*. const PointerType *Ty = PointerType::getUnqual(Type::getInt8Ty(Context)); V = Builder.CreateBitCast(V, PointerType::getUnqual(Ty)); - + Value *Ops[2] = { V, ConstantPointerNull::get(Ty) }; - + Builder.CreateCall(gcrootFun, Ops, Ops+2); -} +} // Emits annotate intrinsic if the decl has the annotate attribute set. void TreeToLLVM::EmitAnnotateIntrinsic(Value *V, tree decl) { - + // Handle annotate attribute on global. tree annotateAttr = lookup_attribute("annotate", DECL_ATTRIBUTES (decl)); - + if (!annotateAttr) return; - Function *annotateFun = Intrinsic::getDeclaration(TheModule, + Function *annotateFun = Intrinsic::getDeclaration(TheModule, Intrinsic::var_annotation); // Get file and line number @@ -1506,21 +1506,21 @@ Constant *file = ConvertMetadataStringToGV(DECL_SOURCE_FILE(decl)); const Type *SBP= PointerType::getUnqual(Type::getInt8Ty(Context)); file = Builder.getFolder().CreateBitCast(file, SBP); - - // There may be multiple annotate attributes. Pass return of lookup_attr + + // There may be multiple annotate attributes. Pass return of lookup_attr // to successive lookups. while (annotateAttr) { - + // Each annotate attribute is a tree list. // Get value of list which is our linked list of args. tree args = TREE_VALUE(annotateAttr); - + // Each annotate attribute may have multiple args. // Treat each arg as if it were a separate annotate attribute. for (tree a = args; a; a = TREE_CHAIN(a)) { // Each element of the arg list is a tree list, so get value tree val = TREE_VALUE(a); - + // Assert its a string, and then get that string. assert(TREE_CODE(val) == STRING_CST && "Annotate attribute arg should always be a string"); @@ -1529,13 +1529,13 @@ Value *Ops[4] = { BitCastToType(V, SBP), BitCastToType(strGV, SBP), - file, + file, lineNo }; - + Builder.CreateCall(annotateFun, Ops, Ops+4); } - + // Get next annotate attribute. annotateAttr = TREE_CHAIN(annotateAttr); if (annotateAttr) @@ -1551,12 +1551,12 @@ /// function and set DECL_LLVM for the decl to the right pointer. void TreeToLLVM::EmitAutomaticVariableDecl(tree decl) { tree type = TREE_TYPE(decl); - + // An LLVM value pointer for this decl may already be set, for example, if the // named return value optimization is being applied to this function, and // this variable is the one being returned. assert(!DECL_LLVM_SET_P(decl) && "Shouldn't call this on an emitted var!"); - + // For a CONST_DECL, set mode, alignment, and sizes from those of the // type in case this node is used in a reference. if (TREE_CODE(decl) == CONST_DECL) { @@ -1566,7 +1566,7 @@ DECL_SIZE_UNIT(decl) = TYPE_SIZE_UNIT(type); return; } - + // Otherwise, only automatic (and result) variables need any expansion done. // Static and external variables, and external functions, will be handled by // `assemble_variable' (called from finish_decl). TYPE_DECL requires nothing. @@ -1579,7 +1579,7 @@ // definition is encountered. if (isGimpleTemporary(decl)) return; - + // If this is just the rotten husk of a variable that the gimplifier // eliminated all uses of, but is preserving for debug info, ignore it. if (TREE_CODE(decl) == VAR_DECL && DECL_VALUE_EXPR(decl)) @@ -1646,11 +1646,11 @@ } else { AI = Builder.CreateAlloca(Ty, Size, Name); } - + AI->setAlignment(Alignment); - + SET_DECL_LLVM(decl, AI); - + // Handle annotate attributes if (DECL_ATTRIBUTES(decl)) EmitAnnotateIntrinsic(AI, decl); @@ -1665,7 +1665,7 @@ EmitTypeGcroot(AI, decl); Builder.CreateStore(Constant::getNullValue(T), AI); } - + if (TheDebugInfo) { if (DECL_NAME(decl)) { TheDebugInfo->EmitDeclare(decl, dwarf::DW_TAG_auto_variable, @@ -1688,7 +1688,7 @@ Constant *TreeToLLVM::getIndirectGotoBlockNumber(BasicBlock *BB) { ConstantInt *&Val = AddressTakenBBNumbers[BB]; if (Val) return Val; - + // Assign the new ID, update AddressTakenBBNumbers to remember it. uint64_t BlockNo = ++NumAddressTakenBlocks; BlockNo &= ~0ULL >> (64-TD.getPointerSizeInBits()); @@ -1706,12 +1706,12 @@ // Create a temporary for the value to be switched on. IndirectGotoValue = CreateTemporary(TD.getIntPtrType(Context)); - + // Create the block, emit a load, and emit the switch in the block. IndirectGotoBlock = BasicBlock::Create(Context, "indirectgoto"); Value *Ld = new LoadInst(IndirectGotoValue, "gotodest", IndirectGotoBlock); SwitchInst::Create(Ld, IndirectGotoBlock, 0, IndirectGotoBlock); - + // Finally, return it. return IndirectGotoBlock; } @@ -1741,7 +1741,7 @@ Value *V = Emit(TREE_OPERAND(exp, 0), 0); V = CastToType(Instruction::PtrToInt, V, TD.getIntPtrType(Context)); Builder.CreateStore(V, IndirectGotoValue); - + // NOTE: This is HORRIBLY INCORRECT in the presence of exception handlers. // There should be one collector block per cleanup level! Note that // standard GCC gets this wrong as well. @@ -1758,7 +1758,7 @@ tree retval = TREE_OPERAND(exp, 0); assert((!retval || TREE_CODE(retval) == RESULT_DECL || - ((TREE_CODE(retval) == MODIFY_EXPR + ((TREE_CODE(retval) == MODIFY_EXPR || TREE_CODE(retval) == INIT_EXPR) && TREE_CODE(TREE_OPERAND(retval, 0)) == RESULT_DECL)) && "RETURN_EXPR not gimple!"); @@ -1775,7 +1775,7 @@ Value *TreeToLLVM::EmitCOND_EXPR(tree exp) { tree exp_cond = COND_EXPR_COND(exp); - + // Emit the conditional expression. Special case comparisons since they are // very common and we want to avoid an extension to 'int' of the intermediate // result. @@ -1783,7 +1783,7 @@ Value *Cond; switch (TREE_CODE(exp_cond)) { default: break; - case LT_EXPR: + case LT_EXPR: UIPred = ICmpInst::ICMP_ULT; SIPred = ICmpInst::ICMP_SLT; FPPred = FCmpInst::FCMP_OLT; @@ -1832,7 +1832,7 @@ Cond = EmitCompare(exp_cond, UIPred, SIPred, FPPred, Type::getInt1Ty(Context)); assert(Cond->getType() == Type::getInt1Ty(Context)); } - + tree Then = COND_EXPR_THEN(exp); tree Else = COND_EXPR_ELSE(exp); assert(TREE_CODE(Then) == GOTO_EXPR && TREE_CODE(Else) == GOTO_EXPR @@ -1847,11 +1847,11 @@ Value *TreeToLLVM::EmitSWITCH_EXPR(tree exp) { tree Cases = SWITCH_LABELS(exp); - + // Emit the condition. Value *SwitchExp = Emit(SWITCH_COND(exp), 0); bool ExpIsSigned = !TYPE_UNSIGNED(TREE_TYPE(SWITCH_COND(exp))); - + // Emit the switch instruction. SwitchInst *SI = Builder.CreateSwitch(SwitchExp, Builder.GetInsertBlock(), TREE_VEC_LENGTH(Cases)); @@ -2120,7 +2120,7 @@ //FIXME Value *Cond = NULL; //FIXME for (; TypeList; TypeList = TREE_CHAIN (TypeList)) { //FIXME Value *TType = Emit(lookup_type_for_runtime(TREE_VALUE(TypeList)), 0); -//FIXME TType = BitCastToType(TType, +//FIXME TType = BitCastToType(TType, //FIXME PointerType::getUnqual(Type::getInt8Ty(Context))); //FIXME //FIXME // Call get eh type id. @@ -2201,7 +2201,21 @@ Value *Arg = Builder.CreateLoad(ExceptionValue, "eh_ptr"); abort();//FIXME //FIXME assert(llvm_unwind_resume_libfunc && "no unwind resume function!"); +//FIXME +//FIXME // As we're emitting a naked call (not an expression) going through +//FIXME // EmitCallOf would be wasteful and incorrect. Manually adjust +//FIXME // the calling convention for this call here if necessary. +//FIXME#ifdef TARGET_ADJUST_LLVM_CC +//FIXME tree fntype = TREE_TYPE(llvm_unwind_resume_libfunc); +//FIXME CallingConv::ID CallingConvention = CallingConv::C; +//FIXME +//FIXME TARGET_ADJUST_LLVM_CC(CallingConvention, fntype); +//FIXME CallInst *Call = Builder.CreateCall(DECL_LLVM(llvm_unwind_resume_libfunc), +//FIXME Arg); +//FIXME Call->setCallingConv(CallingConvention); +//FIXME#else //FIXME Builder.CreateCall(DECL_LLVM(llvm_unwind_resume_libfunc), Arg); +//FIXME#endif Builder.CreateUnreachable(); } } @@ -2256,14 +2270,14 @@ bool isVolatile = TREE_THIS_VOLATILE(exp); const Type *Ty = ConvertType(TREE_TYPE(exp)); unsigned Alignment = LV.getAlignment(); - if (TREE_CODE(exp) == COMPONENT_REF) - if (const StructType *STy = + if (TREE_CODE(exp) == COMPONENT_REF) + if (const StructType *STy = dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0))))) if (STy->isPacked()) // Packed struct members use 1 byte alignment Alignment = 1; - - + + if (!LV.isBitfield()) { if (!DestLoc) { // Scalar value: emit a load. @@ -2547,12 +2561,12 @@ /// HandleAggregateResultAsScalar - This callback is invoked if the function /// returns an aggregate value by bit converting it to the specified scalar /// type and returning that. - void HandleAggregateResultAsScalar(const Type *ScalarTy, + void HandleAggregateResultAsScalar(const Type *ScalarTy, unsigned Offset = 0) { this->Offset = Offset; } - /// HandleAggregateResultAsAggregate - This callback is invoked if the + /// HandleAggregateResultAsAggregate - This callback is invoked if the /// function returns an aggregate value using multiple return values. void HandleAggregateResultAsAggregate(const Type *AggrTy) { // There is nothing to do here. @@ -2730,7 +2744,7 @@ TheLLVMABI ABIConverter(Client); // Handle the result, including struct returns. - ABIConverter.HandleReturnType(TREE_TYPE(exp), + ABIConverter.HandleReturnType(TREE_TYPE(exp), fndecl ? fndecl : exp, fndecl ? DECL_BUILT_IN(fndecl) : false); @@ -2760,7 +2774,7 @@ } Attributes Attrs = Attribute::None; - + unsigned OldSize = CallOperands.size(); ABIConverter.HandleArgument(type, ScalarArgs, &Attrs); @@ -2798,7 +2812,7 @@ } } } - + Value *Call; if (!LandingPad) { Call = Builder.CreateCall(Callee, CallOperands.begin(), CallOperands.end()); @@ -2955,8 +2969,8 @@ LValue LV = EmitLV(lhs); bool isVolatile = TREE_THIS_VOLATILE(lhs); unsigned Alignment = LV.getAlignment(); - if (TREE_CODE(lhs) == COMPONENT_REF) - if (const StructType *STy = + if (TREE_CODE(lhs) == COMPONENT_REF) + if (const StructType *STy = dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(lhs, 0))))) if (STy->isPacked()) // Packed struct members use 1 byte alignment @@ -2972,7 +2986,7 @@ if (PT->getElementType()->canLosslesslyBitCastTo(RHS->getType())) RHS = CastToAnyType(RHS, RHSSigned, PT->getElementType(), LHSSigned); else - LV.Ptr = BitCastToType(LV.Ptr, + LV.Ptr = BitCastToType(LV.Ptr, PointerType::getUnqual(RHS->getType())); StoreInst *SI = Builder.CreateStore(RHS, LV.Ptr, isVolatile); SI->setAlignment(Alignment); @@ -3089,11 +3103,11 @@ Value *OpVal = Emit(Op, &NewLoc); assert(OpVal == 0 && "Shouldn't cast scalar to aggregate!"); return 0; - } + } // Scalar to aggregate copy. Value *OpVal = Emit(Op, 0); - Value *Ptr = BitCastToType(DestLoc->Ptr, + Value *Ptr = BitCastToType(DestLoc->Ptr, PointerType::getUnqual(OpVal->getType())); StoreInst *St = Builder.CreateStore(OpVal, Ptr, DestLoc->Volatile); St->setAlignment(DestLoc->getAlignment()); @@ -3164,7 +3178,7 @@ return Builder.CreateLoad(BitCastToType(Target.Ptr, PointerType::getUnqual(ExpTy))); } - + if (DestLoc) { // The input is a scalar the output is an aggregate, just eval the input, // then store into DestLoc. @@ -3181,7 +3195,7 @@ Value *OpVal = Emit(Op, 0); assert(OpVal && "Expected a scalar result!"); const Type *DestTy = ConvertType(TREE_TYPE(exp)); - + // If the source is a pointer, use ptrtoint to get it to something // bitcast'able. This supports things like v_c_e(foo*, float). if (isa(OpVal->getType())) { @@ -3190,7 +3204,7 @@ // Otherwise, ptrtoint to intptr_t first. OpVal = Builder.CreatePtrToInt(OpVal, TD.getIntPtrType(Context)); } - + // If the destination type is a pointer, use inttoptr. if (isa(DestTy)) return Builder.CreateIntToPtr(OpVal, DestTy); @@ -3206,14 +3220,14 @@ return Builder.CreateFNeg(V); if (!isa(V->getType())) return Builder.CreateNeg(V); - + // GCC allows NEGATE_EXPR on pointers as well. Cast to int, negate, cast // back. V = CastToAnyType(V, false, TD.getIntPtrType(Context), false); V = Builder.CreateNeg(V); return CastToType(Instruction::IntToPtr, V, ConvertType(TREE_TYPE(exp))); } - + // Emit the operand to a temporary. const Type *ComplexTy = cast(DestLoc->Ptr->getType())->getElementType(); @@ -3259,7 +3273,7 @@ Value *OpN = Builder.CreateNeg(Op, (Op->getNameStr()+"neg").c_str()); ICmpInst::Predicate pred = TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))) ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_SGE; - Value *Cmp = Builder.CreateICmp(pred, Op, + Value *Cmp = Builder.CreateICmp(pred, Op, Constant::getNullValue(Op->getType()), "abscond"); return Builder.CreateSelect(Cmp, Op, OpN, "abs"); } @@ -3310,13 +3324,13 @@ cast(Ty)->getElementType()->isFloatingPoint())) { Op = BitCastToType(Op, getSuitableBitCastIntType(Ty)); } - return BitCastToType(Builder.CreateNot(Op, + return BitCastToType(Builder.CreateNot(Op, (Op->getNameStr()+"not").c_str()),Ty); } Value *TreeToLLVM::EmitTRUTH_NOT_EXPR(tree exp) { Value *V = Emit(TREE_OPERAND(exp, 0), 0); - if (V->getType() != Type::getInt1Ty(Context)) + if (V->getType() != Type::getInt1Ty(Context)) V = Builder.CreateICmpNE(V, Constant::getNullValue(V->getType()), "toBool"); V = Builder.CreateNot(V, (V->getNameStr()+"not").c_str()); @@ -3331,7 +3345,7 @@ /// If DestTy is specified, make sure to return the result with the specified /// integer type. Otherwise, return the expression as whatever TREE_TYPE(exp) /// corresponds to. -Value *TreeToLLVM::EmitCompare(tree exp, unsigned UIOpc, unsigned SIOpc, +Value *TreeToLLVM::EmitCompare(tree exp, unsigned UIOpc, unsigned SIOpc, unsigned FPPred, const Type *DestTy) { // Get the type of the operands tree Op0Ty = TREE_TYPE(TREE_OPERAND(exp,0)); @@ -3357,7 +3371,7 @@ } else { // Handle the integer/pointer cases. Determine which predicate to use based // on signedness. - ICmpInst::Predicate pred = + ICmpInst::Predicate pred = ICmpInst::Predicate(TYPE_UNSIGNED(Op0Ty) ? UIOpc : SIOpc); // Get the compare instructions @@ -3365,10 +3379,10 @@ } } assert(Result->getType() == Type::getInt1Ty(Context) && "Expected i1 result for compare"); - + if (DestTy == 0) DestTy = ConvertType(TREE_TYPE(exp)); - + // The GCC type is probably an int, not a bool. ZExt to the right size. if (Result->getType() == DestTy) return Result; @@ -3385,10 +3399,10 @@ return EmitComplexBinOp(exp, DestLoc); assert(Ty->isSingleValueType() && DestLoc == 0 && "Bad binary operation!"); - + Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); - + // GCC has no problem with things like "xor uint X, int 17", and X-Y, where // X and Y are pointer types, but the result is an integer. As such, convert // everything to the result type. @@ -3408,7 +3422,7 @@ const Type *ResTy = Ty; if (isLogicalOp && (Ty->isFloatingPoint() || - (isa(Ty) && + (isa(Ty) && cast(Ty)->getElementType()->isFloatingPoint()))) { Ty = getSuitableBitCastIntType(Ty); LHS = BitCastToType(LHS, Ty); @@ -3431,24 +3445,24 @@ /// Value *TreeToLLVM::EmitPtrBinOp(tree exp, unsigned Opc) { Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); - + // If this is an expression like (P+4), try to turn this into // "getelementptr P, 1". if ((Opc == Instruction::Add || Opc == Instruction::Sub) && TREE_CODE(TREE_OPERAND(exp, 1)) == INTEGER_CST) { int64_t Offset = getINTEGER_CSTVal(TREE_OPERAND(exp, 1)); - + // If POINTER_SIZE is 32-bits and the offset is signed, sign extend it. if (POINTER_SIZE == 32 && !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1)))) Offset = (Offset << 32) >> 32; - + // Figure out how large the element pointed to is. const Type *ElTy = cast(LHS->getType())->getElementType(); // We can't get the type size (and thus convert to using a GEP instr) from // pointers to opaque structs if the type isn't abstract. if (ElTy->isSized()) { int64_t EltSize = TD.getTypeAllocSize(ElTy); - + // If EltSize exactly divides Offset, then we know that we can turn this // into a getelementptr instruction. int64_t EltOffset = EltSize ? Offset/EltSize : 0; @@ -3464,8 +3478,8 @@ } } } - - + + Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); const Type *IntPtrTy = TD.getIntPtrType(Context); @@ -3483,16 +3497,16 @@ Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))); bool RHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1))); - + // This is a truth operation like the strict &&,||,^^. Convert to bool as // a test against zero - LHS = Builder.CreateICmpNE(LHS, + LHS = Builder.CreateICmpNE(LHS, Constant::getNullValue(LHS->getType()), "toBool"); - RHS = Builder.CreateICmpNE(RHS, + RHS = Builder.CreateICmpNE(RHS, Constant::getNullValue(RHS->getType()), "toBool"); - + Value *Res = Builder.CreateBinOp((Instruction::BinaryOps)Opc, LHS, RHS); return CastToType(Instruction::ZExt, Res, ConvertType(TREE_TYPE(exp))); } @@ -3502,38 +3516,47 @@ assert(DestLoc == 0 && "aggregate shift?"); const Type *Ty = ConvertType(TREE_TYPE(exp)); assert(!isa(Ty) && "Pointer arithmetic!?"); - + Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); if (RHS->getType() != LHS->getType()) RHS = Builder.CreateIntCast(RHS, LHS->getType(), false, (RHS->getNameStr()+".cast").c_str()); - + return Builder.CreateBinOp((Instruction::BinaryOps)Opc, LHS, RHS); } Value *TreeToLLVM::EmitRotateOp(tree exp, unsigned Opc1, unsigned Opc2) { Value *In = Emit(TREE_OPERAND(exp, 0), 0); Value *Amt = Emit(TREE_OPERAND(exp, 1), 0); + + if (isa(In->getType())) { + const Type *Ty = + IntegerType::get(Context, + TYPE_PRECISION(TREE_TYPE (TREE_OPERAND (exp, 0)))); + In = Builder.CreatePtrToInt(In, Ty, + (In->getNameStr()+".cast").c_str()); + } + if (Amt->getType() != In->getType()) Amt = Builder.CreateIntCast(Amt, In->getType(), false, (Amt->getNameStr()+".cast").c_str()); Value *TypeSize = ConstantInt::get(In->getType(), - In->getType()->getPrimitiveSizeInBits()); - + In->getType()->getPrimitiveSizeInBits()); + // Do the two shifts. Value *V1 = Builder.CreateBinOp((Instruction::BinaryOps)Opc1, In, Amt); Value *OtherShift = Builder.CreateSub(TypeSize, Amt); Value *V2 = Builder.CreateBinOp((Instruction::BinaryOps)Opc2, In, OtherShift); - + // Or the two together to return them. Value *Merge = Builder.CreateOr(V1, V2); return CastToUIntType(Merge, ConvertType(TREE_TYPE(exp))); } -Value *TreeToLLVM::EmitMinMaxExpr(tree exp, unsigned UIPred, unsigned SIPred, +Value *TreeToLLVM::EmitMinMaxExpr(tree exp, unsigned UIPred, unsigned SIPred, unsigned FPPred) { Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); @@ -3541,17 +3564,17 @@ const Type *Ty = ConvertType(TREE_TYPE(exp)); // The LHS, RHS and Ty could be integer, floating or pointer typed. We need - // to convert the LHS and RHS into the destination type before doing the + // to convert the LHS and RHS into the destination type before doing the // comparison. Use CastInst::getCastOpcode to get this right. bool TyIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp)); bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))); bool RHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1))); - Instruction::CastOps opcode = + Instruction::CastOps opcode = CastInst::getCastOpcode(LHS, LHSIsSigned, Ty, TyIsSigned); LHS = CastToType(opcode, LHS, Ty); opcode = CastInst::getCastOpcode(RHS, RHSIsSigned, Ty, TyIsSigned); RHS = CastToType(opcode, RHS, Ty); - + Value *Compare; if (LHS->getType()->isFloatingPoint()) Compare = Builder.CreateFCmp(FCmpInst::Predicate(FPPred), LHS, RHS); @@ -3575,7 +3598,7 @@ Value *TreeToLLVM::EmitFLOOR_MOD_EXPR(tree exp, const MemRef *DestLoc) { // Notation: FLOOR_MOD_EXPR <-> Mod, TRUNC_MOD_EXPR <-> Rem. - + // We express Mod in terms of Rem as follows: if RHS exactly divides LHS, // or the values of LHS and RHS have the same sign, then Mod equals Rem. // Otherwise Mod equals Rem + RHS. This means that LHS Mod RHS traps iff @@ -3583,25 +3606,25 @@ if (TYPE_UNSIGNED(TREE_TYPE(exp))) // LHS and RHS values must have the same sign if their type is unsigned. return EmitBinOp(exp, DestLoc, Instruction::URem); - + const Type *Ty = ConvertType(TREE_TYPE(exp)); Constant *Zero = ConstantInt::get(Ty, 0); - + Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); - + // The two possible values for Mod. Value *Rem = Builder.CreateSRem(LHS, RHS, "rem"); Value *RemPlusRHS = Builder.CreateAdd(Rem, RHS); - + // HaveSameSign: (LHS >= 0) == (RHS >= 0). Value *LHSIsPositive = Builder.CreateICmpSGE(LHS, Zero); Value *RHSIsPositive = Builder.CreateICmpSGE(RHS, Zero); Value *HaveSameSign = Builder.CreateICmpEQ(LHSIsPositive,RHSIsPositive); - + // RHS exactly divides LHS iff Rem is zero. Value *RemIsZero = Builder.CreateICmpEQ(Rem, Zero); - + Value *SameAsRem = Builder.CreateOr(HaveSameSign, RemIsZero); return Builder.CreateSelect(SameAsRem, Rem, RemPlusRHS, "mod"); } @@ -3722,7 +3745,7 @@ Value *TreeToLLVM::EmitROUND_DIV_EXPR(tree exp) { // Notation: ROUND_DIV_EXPR <-> RDiv, TRUNC_DIV_EXPR <-> Div. - + // RDiv calculates LHS/RHS by rounding to the nearest integer. Ties // are broken by rounding away from zero. In terms of Div this means: // LHS RDiv RHS = (LHS + (RHS Div 2)) Div RHS @@ -3732,30 +3755,30 @@ // expressions in these formulae can overflow, so some tweaking is // required to ensure correct results. The details depend on whether // we are doing signed or unsigned arithmetic. - + const Type *Ty = ConvertType(TREE_TYPE(exp)); Constant *Zero = ConstantInt::get(Ty, 0); Constant *Two = ConstantInt::get(Ty, 2); - + Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); - + if (!TYPE_UNSIGNED(TREE_TYPE(exp))) { // In the case of signed arithmetic, we calculate RDiv as follows: // LHS RDiv RHS = (sign) ( (|LHS| + (|RHS| UDiv 2)) UDiv |RHS| ), // where sign is +1 if LHS and RHS have the same sign, -1 if their // signs differ. Doing the computation unsigned ensures that there // is no overflow. - + // On some machines INT_MIN Div -1 traps. You might expect a trap for // INT_MIN RDiv -1 too, but this implementation will not generate one. // Quick quiz question: what value is returned for INT_MIN RDiv -1? - + // Determine the signs of LHS and RHS, and whether they have the same sign. Value *LHSIsPositive = Builder.CreateICmpSGE(LHS, Zero); Value *RHSIsPositive = Builder.CreateICmpSGE(RHS, Zero); Value *HaveSameSign = Builder.CreateICmpEQ(LHSIsPositive, RHSIsPositive); - + // Calculate |LHS| ... Value *MinusLHS = Builder.CreateNeg(LHS); Value *AbsLHS = Builder.CreateSelect(LHSIsPositive, LHS, MinusLHS, @@ -3764,18 +3787,18 @@ Value *MinusRHS = Builder.CreateNeg(RHS); Value *AbsRHS = Builder.CreateSelect(RHSIsPositive, RHS, MinusRHS, (RHS->getNameStr()+".abs").c_str()); - + // Calculate AbsRDiv = (|LHS| + (|RHS| UDiv 2)) UDiv |RHS|. Value *HalfAbsRHS = Builder.CreateUDiv(AbsRHS, Two); Value *Numerator = Builder.CreateAdd(AbsLHS, HalfAbsRHS); Value *AbsRDiv = Builder.CreateUDiv(Numerator, AbsRHS); - + // Return AbsRDiv or -AbsRDiv according to whether LHS and RHS have the // same sign or not. Value *MinusAbsRDiv = Builder.CreateNeg(AbsRDiv); return Builder.CreateSelect(HaveSameSign, AbsRDiv, MinusAbsRDiv, "rdiv"); } - + // In the case of unsigned arithmetic, LHS and RHS necessarily have the // same sign, however overflow is a problem. We want to use the formula // LHS RDiv RHS = (LHS + (RHS Div 2)) Div RHS, @@ -3784,21 +3807,21 @@ // simple solution of explicitly checking for overflow, and using // LHS RDiv RHS = ((LHS + (RHS Div 2)) - RHS) Div RHS + 1 // if it occurred. - + // Usually the numerator is LHS + (RHS Div 2); calculate this. Value *HalfRHS = Builder.CreateUDiv(RHS, Two); Value *Numerator = Builder.CreateAdd(LHS, HalfRHS); - + // Did the calculation overflow? Value *Overflowed = Builder.CreateICmpULT(Numerator, HalfRHS); - + // If so, use (LHS + (RHS Div 2)) - RHS for the numerator instead. Value *AltNumerator = Builder.CreateSub(Numerator, RHS); Numerator = Builder.CreateSelect(Overflowed, AltNumerator, Numerator); - + // Quotient = Numerator / RHS. Value *Quotient = Builder.CreateUDiv(Numerator, RHS); - + // Return Quotient unless we overflowed, in which case return Quotient + 1. return Builder.CreateAdd(Quotient, CastToUIntType(Overflowed, Ty), "rdiv"); } @@ -3933,12 +3956,12 @@ } } } - + // Expand [name] symbolic operand names. str = resolve_asm_operand_names(str, ASM_OUTPUTS(exp), ASM_INPUTS(exp)); const char *InStr = TREE_STRING_POINTER(str); - + std::string Result; while (1) { switch (*InStr++) { @@ -3967,7 +3990,7 @@ // syntax. char *EndPtr; unsigned long OpNum = strtoul(InStr, &EndPtr, 10); - + if (InStr == EndPtr) { error_at(EXPR_LOCATION(exp),"operand number missing after %%-letter"); return Result; @@ -4002,7 +4025,7 @@ /// alternatives, etc. static std::string CanonicalizeConstraint(const char *Constraint) { std::string Result; - + // Skip over modifier characters. bool DoneModifiers = false; while (!DoneModifiers) { @@ -4023,7 +4046,7 @@ return Result; } } - + while (*Constraint) { char ConstraintChar = *Constraint++; @@ -4039,13 +4062,13 @@ // a valid address. if (ConstraintChar == 'p') ConstraintChar = 'r'; - + // See if this is a regclass constraint. unsigned RegClass; if (ConstraintChar == 'r') // REG_CLASS_FROM_CONSTRAINT doesn't support 'r' for some reason. RegClass = GENERAL_REGS; - else + else RegClass = REG_CLASS_FROM_CONSTRAINT(Constraint[-1], Constraint-1); if (RegClass == NO_REGS) { // not a reg class. @@ -4056,10 +4079,10 @@ // Look to see if the specified regclass has exactly one member, and if so, // what it is. Cache this information in AnalyzedRegClasses once computed. static std::map AnalyzedRegClasses; - + std::map::iterator I = AnalyzedRegClasses.lower_bound(RegClass); - + int RegMember; if (I != AnalyzedRegClasses.end() && I->first == RegClass) { // We've already computed this, reuse value. @@ -4089,7 +4112,7 @@ Result += ConstraintChar; } } - + return Result; } @@ -4166,9 +4189,9 @@ // RunningConstraints is pointers into the Constraints strings which // are incremented as we go to point to the beginning of each // comma-separated alternative. - const char** RunningConstraints = + const char** RunningConstraints = (const char**)alloca((NumInputs+NumOutputs)*sizeof(const char*)); - memcpy(RunningConstraints, Constraints, + memcpy(RunningConstraints, Constraints, (NumInputs+NumOutputs) * sizeof(const char*)); // The entire point of this loop is to compute CommasToSkip. for (unsigned int i=0; i CallArgTypes; std::string NewAsmStr = ConvertInlineAsmStr(exp, NumOutputs+NumInputs); std::string ConstraintStr; - + // StoreCallResultAddr - The pointer to store the result of the call through. SmallVector StoreCallResultAddrs; SmallVector CallResultTypes; SmallVector CallResultIsSigned; - + // Process outputs. ValNum = 0; - for (tree Output = ASM_OUTPUTS(exp); Output; + for (tree Output = ASM_OUTPUTS(exp); Output; Output = TREE_CHAIN(Output), ++ValNum) { tree Operand = TREE_VALUE(Output); tree type = TREE_TYPE(Operand); - + // Parse the output constraint. const char *Constraint = Constraints[ValNum]; bool IsInOut, AllowsReg, AllowsMem; @@ -4378,7 +4401,7 @@ if (NumChoices>1) FreeConstTupleStrings(ReplacementStrings, NumInputs+NumOutputs); return 0; - } + } assert(Constraint[0] == '=' && "Not an output constraint?"); // Output constraints must be addressable if they aren't simple register @@ -4417,11 +4440,11 @@ } else { SimplifiedConstraint = CanonicalizeConstraint(Constraint+1); } - + LValue Dest = EmitLV(Operand); const Type *DestValTy = cast(Dest.Ptr->getType())->getElementType(); - + assert(!Dest.isBitfield() && "Cannot assign into a bitfield!"); if (!AllowsMem && DestValTy->isSingleValueType()) {// Reg dest -> asm return StoreCallResultAddrs.push_back(Dest.Ptr); @@ -4436,12 +4459,12 @@ CallArgTypes.push_back(Dest.Ptr->getType()); } } - + // Process inputs. for (tree Input = ASM_INPUTS(exp); Input; Input = TREE_CHAIN(Input),++ValNum){ tree Val = TREE_VALUE(Input); tree type = TREE_TYPE(Val); - + const char *Constraint = Constraints[ValNum]; bool AllowsReg, AllowsMem; @@ -4451,7 +4474,7 @@ if (NumChoices>1) FreeConstTupleStrings(ReplacementStrings, NumInputs+NumOutputs); return 0; - } + } bool isIndirect = false; if (AllowsReg || !AllowsMem) { // Register operand. const Type *LLVMTy = ConvertType(type); @@ -4469,7 +4492,7 @@ } else { LValue LV = EmitLV(Val); assert(!LV.isBitfield() && "Inline asm can't have bitfield operand"); - + // Structs and unions are permitted here, as long as they're the // same size as a register. uint64_t TySize = TD.getTypeSizeInBits(LLVMTy); @@ -4519,7 +4542,7 @@ Op = CastToAnyType(Op, !TYPE_UNSIGNED(type), OTy, CallResultIsSigned[Match]); if (BYTES_BIG_ENDIAN) { - Constant *ShAmt = ConstantInt::get(Op->getType(), + Constant *ShAmt = ConstantInt::get(Op->getType(), OTyBits-OpTyBits); Op = Builder.CreateLShr(Op, ShAmt); } @@ -4527,7 +4550,7 @@ } } } - + CallOps.push_back(Op); CallArgTypes.push_back(OpTy); } else { // Memory operand. @@ -4538,11 +4561,11 @@ CallOps.push_back(Src.Ptr); CallArgTypes.push_back(Src.Ptr->getType()); } - + ConstraintStr += ','; if (isIndirect) ConstraintStr += '*'; - + // If this output register is pinned to a machine register, use that machine // register instead of the specified constraint. if (TREE_CODE(Val) == VAR_DECL && DECL_HARD_REGISTER(Val)) { @@ -4570,7 +4593,7 @@ for (; Clobbers; Clobbers = TREE_CHAIN(Clobbers)) { const char *RegName = TREE_STRING_POINTER(TREE_VALUE(Clobbers)); int RegCode = decode_reg_name(RegName); - + switch (RegCode) { case -1: // Nothing specified? case -2: // Invalid. @@ -4593,25 +4616,25 @@ break; } } - + const Type *CallResultType; switch (CallResultTypes.size()) { case 0: CallResultType = Type::getVoidTy(Context); break; case 1: CallResultType = CallResultTypes[0]; break; - default: + default: std::vector TmpVec(CallResultTypes.begin(), CallResultTypes.end()); CallResultType = StructType::get(Context, TmpVec); break; } - - const FunctionType *FTy = + + const FunctionType *FTy = FunctionType::get(CallResultType, CallArgTypes, false); - + // Remove the leading comma if we have operands. if (!ConstraintStr.empty()) ConstraintStr.erase(ConstraintStr.begin()); - + // Make sure we're created a valid inline asm expression. if (!InlineAsm::Verify(FTy, ConstraintStr)) { error_at(EXPR_LOCATION(exp), "Invalid or unsupported inline assembly!"); @@ -4619,9 +4642,9 @@ FreeConstTupleStrings(ReplacementStrings, NumInputs+NumOutputs); return 0; } - + Value *Asm = InlineAsm::get(FTy, NewAsmStr, ConstraintStr, - ASM_VOLATILE_P(exp) || !ASM_OUTPUTS(exp)); + ASM_VOLATILE_P(exp) || !ASM_OUTPUTS(exp)); CallInst *CV = Builder.CreateCall(Asm, CallOps.begin(), CallOps.end(), CallResultTypes.empty() ? "" : "asmtmp"); CV->setDoesNotThrow(); @@ -4635,13 +4658,13 @@ Builder.CreateStore(ValI, StoreCallResultAddrs[i]); } } - + // Give the backend a chance to upgrade the inline asm to LLVM code. This // handles some common cases that LLVM has intrinsics for, e.g. x86 bswap -> // llvm.bswap. if (const TargetLowering *TLI = TheTarget->getTargetLowering()) TLI->ExpandInlineAsm(CV); - + if (NumChoices>1) FreeConstTupleStrings(ReplacementStrings, NumInputs+NumOutputs); return 0; @@ -4657,7 +4680,7 @@ bool AllConstants = true; for (unsigned i = 0, e = Ops.size(); i != e && AllConstants; ++i) AllConstants &= isa(Ops[i]); - + // If this is a constant vector, create a ConstantVector. if (AllConstants) { std::vector CstOps; @@ -4665,15 +4688,15 @@ CstOps.push_back(cast(Ops[i])); return ConstantVector::get(CstOps); } - + // Otherwise, insertelement the values to build the vector. - Value *Result = + Value *Result = UndefValue::get(VectorType::get(Ops[0]->getType(), Ops.size())); - + for (unsigned i = 0, e = Ops.size(); i != e; ++i) - Result = Builder.CreateInsertElement(Result, Ops[i], + Result = Builder.CreateInsertElement(Result, Ops[i], ConstantInt::get(Type::getInt32Ty(Context), i)); - + return Result; } @@ -4684,12 +4707,12 @@ std::vector Ops; va_list VA; va_start(VA, Elt); - + Ops.push_back(Elt); while (Value *Arg = va_arg(VA, Value *)) Ops.push_back(Arg); va_end(VA); - + return BuildVector(Ops); } @@ -4701,7 +4724,7 @@ /// Undef values may be specified by passing in -1 as the result value. /// Value *TreeToLLVM::BuildVectorShuffle(Value *InVec1, Value *InVec2, ...) { - assert(isa(InVec1->getType()) && + assert(isa(InVec1->getType()) && InVec1->getType() == InVec2->getType() && "Invalid shuffle!"); unsigned NumElements = cast(InVec1->getType())->getNumElements(); @@ -4721,7 +4744,7 @@ va_end(VA); // Turn this into the appropriate shuffle operation. - return Builder.CreateShuffleVector(InVec1, InVec2, + return Builder.CreateShuffleVector(InVec1, InVec2, ConstantVector::get(Idxs)); } @@ -4753,7 +4776,7 @@ Operands.push_back(Emit(OpVal, NULL)); } } - + unsigned FnCode = DECL_FUNCTION_CODE(fndecl); return LLVM_TARGET_INTRINSIC_LOWER(exp, FnCode, DestLoc, Result, ResultType, Operands); @@ -4799,7 +4822,7 @@ // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - Value *Result = + Value *Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, id, Ty, 2), C, C + 2); @@ -4827,16 +4850,16 @@ // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - Value *Result = - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::atomic_cmp_swap, + Value *Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::atomic_cmp_swap, Ty, 2), C, C + 3); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - + if (isBool) Result = CastToUIntType(Builder.CreateICmpEQ(Result, C[1]), ConvertType(boolean_type_node)); @@ -4854,7 +4877,7 @@ unsigned FnCode = DECL_FUNCTION_CODE(fndecl); if (TargetBuiltinCache.size() <= FnCode) TargetBuiltinCache.resize(FnCode+1); - + // If we haven't converted this intrinsic over yet, do so now. if (TargetBuiltinCache[FnCode] == 0) { const char *TargetPrefix = ""; @@ -4864,12 +4887,12 @@ // If this builtin directly corresponds to an LLVM intrinsic, get the // IntrinsicID now. const char *BuiltinName = IDENTIFIER_POINTER(DECL_NAME(fndecl)); - Intrinsic::ID IntrinsicID = + Intrinsic::ID IntrinsicID = Intrinsic::getIntrinsicForGCCBuiltin(TargetPrefix, BuiltinName); if (IntrinsicID == Intrinsic::not_intrinsic) { if (EmitFrontendExpandedBuiltinCall(exp, fndecl, DestLoc, Result)) return true; - + error_at(EXPR_LOCATION(exp), "unsupported target builtin %<%s%> used", BuiltinName); const Type *ResTy = ConvertType(TREE_TYPE(exp)); @@ -4877,9 +4900,9 @@ Result = UndefValue::get(ResTy); return true; } - + // Finally, map the intrinsic ID back to a name. - TargetBuiltinCache[FnCode] = + TargetBuiltinCache[FnCode] = Intrinsic::getDeclaration(TheModule, IntrinsicID); } @@ -4964,13 +4987,13 @@ return true; } // Unary bit counting intrinsics. - // NOTE: do not merge these case statements. That will cause the memoized + // NOTE: do not merge these case statements. That will cause the memoized // Function* to be incorrectly shared across the different typed functions. case BUILT_IN_CLZ: // These GCC builtins always return int. case BUILT_IN_CLZL: case BUILT_IN_CLZLL: { Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); - EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctlz); + EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctlz); const Type *DestTy = ConvertType(TREE_TYPE(exp)); Result = Builder.CreateIntCast(Result, DestTy, "cast"); return true; @@ -4988,8 +5011,8 @@ case BUILT_IN_PARITYL: case BUILT_IN_PARITY: { Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); - EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctpop); - Result = Builder.CreateBinOp(Instruction::And, Result, + EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctpop); + Result = Builder.CreateBinOp(Instruction::And, Result, ConstantInt::get(Result->getType(), 1)); return true; } @@ -4997,7 +5020,7 @@ case BUILT_IN_POPCOUNTL: case BUILT_IN_POPCOUNTLL: { Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); - EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctpop); + EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctpop); const Type *DestTy = ConvertType(TREE_TYPE(exp)); Result = Builder.CreateIntCast(Result, DestTy, "cast"); return true; @@ -5005,20 +5028,20 @@ case BUILT_IN_BSWAP32: case BUILT_IN_BSWAP64: { Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); - EmitBuiltinUnaryOp(Amt, Result, Intrinsic::bswap); + EmitBuiltinUnaryOp(Amt, Result, Intrinsic::bswap); const Type *DestTy = ConvertType(TREE_TYPE(exp)); Result = Builder.CreateIntCast(Result, DestTy, "cast"); return true; } - - case BUILT_IN_SQRT: + + case BUILT_IN_SQRT: case BUILT_IN_SQRTF: case BUILT_IN_SQRTL: // If errno math has been disabled, expand these to llvm.sqrt calls. if (!flag_errno_math) { Result = EmitBuiltinSQRT(exp); Result = CastToFPType(Result, ConvertType(TREE_TYPE(exp))); - return true; + return true; } break; case BUILT_IN_POWI: @@ -5059,7 +5082,7 @@ break; case BUILT_IN_LOG10: case BUILT_IN_LOG10F: - case BUILT_IN_LOG10L: + case BUILT_IN_LOG10L: // If errno math has been disabled, expand these to llvm.log10 calls. if (!flag_errno_math) { Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); @@ -5096,12 +5119,12 @@ // The argument and return type of cttz should match the argument type of // the ffs, but should ignore the return type of ffs. Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); - EmitBuiltinUnaryOp(Amt, Result, Intrinsic::cttz); + EmitBuiltinUnaryOp(Amt, Result, Intrinsic::cttz); Result = Builder.CreateAdd(Result, ConstantInt::get(Result->getType(), 1)); Result = CastToUIntType(Result, ConvertType(TREE_TYPE(exp))); Value *Cond = - Builder.CreateICmpEQ(Amt, + Builder.CreateICmpEQ(Amt, Constant::getNullValue(Amt->getType())); Result = Builder.CreateSelect(Cond, Constant::getNullValue(Result->getType()), @@ -5158,8 +5181,8 @@ Value* C[5]; C[0] = C[1] = C[2] = C[3] = ConstantInt::get(Type::getInt1Ty(Context), 1); C[4] = ConstantInt::get(Type::getInt1Ty(Context), 0); - - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::memory_barrier), C, C + 5); return true; @@ -5180,20 +5203,20 @@ } case BUILT_IN_BOOL_COMPARE_AND_SWAP_2: { Result = BuildCmpAndSwapAtomicBuiltin(exp, short_unsigned_type_node, true); - return true; + return true; } case BUILT_IN_BOOL_COMPARE_AND_SWAP_4: { Result = BuildCmpAndSwapAtomicBuiltin(exp, unsigned_type_node, true); - return true; + return true; } case BUILT_IN_BOOL_COMPARE_AND_SWAP_8: { #if defined(TARGET_POWERPC) if (!TARGET_64BIT) return false; #endif - Result = BuildCmpAndSwapAtomicBuiltin(exp, long_long_unsigned_type_node, + Result = BuildCmpAndSwapAtomicBuiltin(exp, long_long_unsigned_type_node, true); - return true; + return true; } case BUILT_IN_VAL_COMPARE_AND_SWAP_8: @@ -5206,7 +5229,7 @@ case BUILT_IN_VAL_COMPARE_AND_SWAP_4: { tree type = TREE_TYPE(exp); Result = BuildCmpAndSwapAtomicBuiltin(exp, type, false); - return true; + return true; } case BUILT_IN_FETCH_AND_ADD_8: #if defined(TARGET_POWERPC) @@ -5285,7 +5308,7 @@ Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_swap); return true; } - + case BUILT_IN_ADD_AND_FETCH_8: #if defined(TARGET_POWERPC) if (!TARGET_64BIT) @@ -5305,14 +5328,14 @@ Ty[1] = PointerType::getUnqual(ResultTy); C[0] = Builder.CreateBitCast(C[0], Ty[1]); C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - - Result = - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::atomic_load_add, + + Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::atomic_load_add, Ty, 2), C, C + 2); @@ -5343,14 +5366,14 @@ Ty[1] = PointerType::getUnqual(ResultTy); C[0] = Builder.CreateBitCast(C[0], Ty[1]); C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - - Result = - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::atomic_load_sub, + + Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::atomic_load_sub, Ty, 2), C, C + 2); @@ -5381,17 +5404,17 @@ Ty[1] = PointerType::getUnqual(ResultTy); C[0] = Builder.CreateBitCast(C[0], Ty[1]); C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - - Result = - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::atomic_load_or, + + Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::atomic_load_or, Ty, 2), C, C + 2); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); @@ -5419,13 +5442,13 @@ Ty[1] = PointerType::getUnqual(ResultTy); C[0] = Builder.CreateBitCast(C[0], Ty[1]); C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - - Result = - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + + Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::atomic_load_and, Ty, 2), C, C + 2); @@ -5457,21 +5480,21 @@ Ty[1] = PointerType::getUnqual(ResultTy); C[0] = Builder.CreateBitCast(C[0], Ty[1]); C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - - Result = - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::atomic_load_xor, + + Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::atomic_load_xor, Ty, 2), C, C + 2); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - + Result = Builder.CreateXor(Result, C[1]); Result = Builder.CreateIntToPtr(Result, ResultTy); return true; @@ -5495,21 +5518,21 @@ Ty[1] = PointerType::getUnqual(ResultTy); C[0] = Builder.CreateBitCast(C[0], Ty[1]); C[1] = Builder.CreateIntCast(C[1], Ty[0], "cast"); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - - Result = - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::atomic_load_nand, + + Result = + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::atomic_load_nand, Ty, 2), C, C + 2); - + // The gcc builtins are also full memory barriers. // FIXME: __sync_lock_test_and_set and __sync_lock_release require less. EmitMemoryBarrier(true, true, true, true); - + Result = Builder.CreateAnd(Builder.CreateNot(Result), C[1]); Result = Builder.CreateIntToPtr(Result, ResultTy); return true; @@ -5541,7 +5564,7 @@ tree arglist = TREE_OPERAND(exp, 1); tree t1 = build1 (INDIRECT_REF, type, TREE_VALUE (arglist)); TREE_THIS_VOLATILE(t1) = 1; - tree t = build2 (MODIFY_EXPR, type, t1, + tree t = build2 (MODIFY_EXPR, type, t1, build_int_cst (type, (HOST_WIDE_INT)0)); EmitMODIFY_EXPR(t, 0); Result = 0; @@ -5593,7 +5616,7 @@ bool TreeToLLVM::EmitBuiltinUnaryOp(Value *InVal, Value *&Result, Intrinsic::ID Id) { // The intrinsic might be overloaded in which case the argument is of - // varying type. Make sure that we specify the actual type for "iAny" + // varying type. Make sure that we specify the actual type for "iAny" // by passing it as the 3rd and 4th parameters. This isn't needed for // most intrinsics, but is needed for ctpop, cttz, ctlz. const Type *Ty = InVal->getType(); @@ -5605,8 +5628,8 @@ Value *TreeToLLVM::EmitBuiltinSQRT(tree exp) { Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); const Type* Ty = Amt->getType(); - - return Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + + return Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::sqrt, &Ty, 1), Amt); } @@ -5624,7 +5647,7 @@ SmallVector Args; Args.push_back(Val); Args.push_back(Pow); - return Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + return Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::powi, &Ty, 1), Args.begin(), Args.end()); } @@ -5641,7 +5664,7 @@ SmallVector Args; Args.push_back(Val); Args.push_back(Pow); - return Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + return Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::pow, &Ty, 1), Args.begin(), Args.end()); } @@ -5656,7 +5679,7 @@ Value *Amt = Emit(TREE_VALUE(arglist), 0); bool AmtIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_VALUE(arglist))); bool ExpIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp)); - Result = CastToAnyType(Amt, AmtIsSigned, ConvertType(TREE_TYPE(exp)), + Result = CastToAnyType(Amt, AmtIsSigned, ConvertType(TREE_TYPE(exp)), ExpIsSigned); return true; } @@ -5689,17 +5712,17 @@ return true; } -/// EmitBuiltinMemCopy - Emit an llvm.memcpy or llvm.memmove intrinsic, +/// EmitBuiltinMemCopy - Emit an llvm.memcpy or llvm.memmove intrinsic, /// depending on the value of isMemMove. bool TreeToLLVM::EmitBuiltinMemCopy(tree exp, Value *&Result, bool isMemMove, bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); if (SizeCheck) { - if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, + if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) return false; } else { - if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, + if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) return false; } @@ -5728,11 +5751,11 @@ bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result, bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); if (SizeCheck) { - if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, + if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) return false; } else { - if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, + if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) return false; } @@ -5776,7 +5799,7 @@ Value *Ptr = Emit(TREE_VALUE(arglist), 0); Value *ReadWrite = 0; Value *Locality = 0; - + if (TREE_CHAIN(arglist)) { // Args 1/2 are optional ReadWrite = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0); if (!isa(ReadWrite)) { @@ -5790,7 +5813,7 @@ ReadWrite = Builder.getFolder().CreateIntCast(cast(ReadWrite), Type::getInt32Ty(Context), false); } - + if (TREE_CHAIN(TREE_CHAIN(arglist))) { Locality = Emit(TREE_VALUE(TREE_CHAIN(TREE_CHAIN(arglist))), 0); if (!isa(Locality)) { @@ -5805,15 +5828,15 @@ } } } - + // Default to highly local read. if (ReadWrite == 0) ReadWrite = Constant::getNullValue(Type::getInt32Ty(Context)); if (Locality == 0) Locality = ConstantInt::get(Type::getInt32Ty(Context), 3); - + Ptr = BitCastToType(Ptr, PointerType::getUnqual(Type::getInt8Ty(Context))); - + Value *Ops[3] = { Ptr, ReadWrite, Locality }; Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::prefetch), Ops, Ops+3); @@ -5826,7 +5849,7 @@ tree arglist = TREE_OPERAND(exp, 1); if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) return false; - + ConstantInt *Level = dyn_cast(Emit(TREE_VALUE(arglist), 0)); if (!Level) { if (isFrame) @@ -5835,7 +5858,7 @@ error("invalid argument to %<__builtin_return_address%>"); return false; } - + Intrinsic::ID IID = !isFrame ? Intrinsic::returnaddress : Intrinsic::frameaddress; Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, IID), Level); @@ -5854,7 +5877,7 @@ // offset are defined. This seems to be needed for: ARM, MIPS, Sparc. // Unfortunately, these constants are defined as RTL expressions and // should be handled separately. - + Result = BitCastToType(Ptr, PointerType::getUnqual(Type::getInt8Ty(Context))); return true; @@ -5870,7 +5893,7 @@ // Result = Ptr - RETURN_ADDR_OFFSET, if offset is defined. This seems to be // needed for: MIPS, Sparc. Unfortunately, these constants are defined // as RTL expressions and should be handled separately. - + Result = BitCastToType(Ptr, PointerType::getUnqual(Type::getInt8Ty(Context))); return true; @@ -5880,7 +5903,7 @@ tree arglist = TREE_OPERAND(exp, 1); if (!validate_arglist(arglist, VOID_TYPE)) return false; - + Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::stacksave)); return true; @@ -6068,7 +6091,7 @@ tree arglist = TREE_OPERAND(exp, 1); if (!validate_arglist(arglist, POINTER_TYPE, VOID_TYPE)) return false; - + Value *Ptr = Emit(TREE_VALUE(arglist), 0); Ptr = BitCastToType(Ptr, PointerType::getUnqual(Type::getInt8Ty(Context))); @@ -6102,22 +6125,22 @@ bool TreeToLLVM::EmitBuiltinVAStart(tree exp) { tree arglist = TREE_OPERAND(exp, 1); tree fntype = TREE_TYPE(current_function_decl); - + if (TYPE_ARG_TYPES(fntype) == 0 || (TREE_VALUE(tree_last(TYPE_ARG_TYPES(fntype))) == void_type_node)) { error("`va_start' used in function with fixed args"); return true; } - + tree last_parm = tree_last(DECL_ARGUMENTS(current_function_decl)); tree chain = TREE_CHAIN(arglist); // Check for errors. if (fold_builtin_next_arg (chain, true)) return true; - + tree arg = TREE_VALUE(chain); - + Value *ArgVal = Emit(TREE_VALUE(arglist), 0); Constant *llvm_va_start_fn = Intrinsic::getDeclaration(TheModule, @@ -6140,7 +6163,7 @@ bool TreeToLLVM::EmitBuiltinVACopy(tree exp) { tree Arg1T = TREE_VALUE(TREE_OPERAND(exp, 1)); tree Arg2T = TREE_VALUE(TREE_CHAIN(TREE_OPERAND(exp, 1))); - + Value *Arg1 = Emit(Arg1T, 0); // Emit the address of the destination. // The second arg of llvm.va_copy is a pointer to a valist. Value *Arg2; @@ -6321,7 +6344,7 @@ DSTi = Builder.CreateICmpEQ(LHSi, RHSi, "tmpi"); } return Builder.CreateAnd(DSTr, DSTi); - case NE_EXPR: // (a+ib) != (c+id) = (a != c) | (b != d) + case NE_EXPR: // (a+ib) != (c+id) = (a != c) | (b != d) if (LHSr->getType()->isFloatingPoint()) { DSTr = Builder.CreateFCmpUNE(LHSr, RHSr, "tmpr"); DSTi = Builder.CreateFCmpUNE(LHSi, RHSi, "tmpi"); @@ -6904,9 +6927,9 @@ const Type *Ty = ConvertType(type); if (const VectorType *PTy = dyn_cast(Ty)) { assert(DestLoc == 0 && "Dest location for packed value?"); - + std::vector BuildVecOps; - + // Insert zero initializers for any uninitialized values. Constant *Zero = Constant::getNullValue(PTy->getElementType()); BuildVecOps.resize(cast(Ty)->getNumElements(), Zero); @@ -6916,22 +6939,22 @@ tree purpose, value; FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), ix, purpose, value) { if (!purpose) continue; // Not actually initialized? - + unsigned FieldNo = TREE_INT_CST_LOW(purpose); // Update the element. if (FieldNo < BuildVecOps.size()) BuildVecOps[FieldNo] = Emit(value, 0); } - + return BuildVector(BuildVecOps); } assert(!Ty->isSingleValueType() && "Constructor for scalar type??"); - + // Start out with the value zero'd out. EmitAggregateZero(*DestLoc, type); - + VEC(constructor_elt, gc) *elt = CONSTRUCTOR_ELTS(exp); switch (TREE_CODE(TREE_TYPE(exp))) { case ARRAY_TYPE: @@ -6961,7 +6984,7 @@ } else { // Scalar value. Evaluate to a register, then do the store. Value *V = Emit(tree_value, 0); - Value *Ptr = BitCastToType(DestLoc->Ptr, + Value *Ptr = BitCastToType(DestLoc->Ptr, PointerType::getUnqual(V->getType())); StoreInst *St = Builder.CreateStore(V, Ptr, DestLoc->Volatile); St->setAlignment(DestLoc->getAlignment()); @@ -6976,8 +6999,8 @@ "Isn't a constant!"); switch (TREE_CODE(exp)) { case FDESC_EXPR: // Needed on itanium - default: - debug_tree(exp); + default: + debug_tree(exp); assert(0 && "Unknown constant to convert!"); abort(); case INTEGER_CST: return ConvertINTEGER_CST(exp); @@ -6991,7 +7014,7 @@ case MINUS_EXPR: return ConvertBinOp_CST(exp); case CONSTRUCTOR: return ConvertCONSTRUCTOR(exp); case VIEW_CONVERT_EXPR: return Convert(TREE_OPERAND(exp, 0)); - case ADDR_EXPR: + case ADDR_EXPR: return TheFolder->CreateBitCast(EmitLV(TREE_OPERAND(exp, 0)), ConvertType(TREE_TYPE(exp))); } @@ -6999,7 +7022,7 @@ Constant *TreeConstantToLLVM::ConvertINTEGER_CST(tree exp) { const Type *Ty = ConvertType(TREE_TYPE(exp)); - + // Handle i128 specially. if (const IntegerType *IT = dyn_cast(Ty)) { if (IT->getBitWidth() == 128) { @@ -7010,12 +7033,12 @@ return ConstantInt::get(Context, APInt(128, 2, Bits)); } } - + // Build the value as a ulong constant, then constant fold it to the right // type. This handles overflow and other things appropriately. uint64_t IntValue = getINTEGER_CSTVal(exp); ConstantInt *C = ConstantInt::get(Type::getInt64Ty(Context), IntValue); - // The destination type can be a pointer, integer or floating point + // The destination type can be a pointer, integer or floating point // so we need a generalized cast here Instruction::CastOps opcode = CastInst::getCastOpcode(C, false, Ty, !TYPE_UNSIGNED(TREE_TYPE(exp))); @@ -7042,11 +7065,11 @@ // This, then, makes the conversion pretty simple. The tricky part is // getting the byte ordering correct and make sure you don't print any // more than 32 bits per integer on platforms with ints > 32 bits. - // - // We want to switch the words of UArr if host and target endianness + // + // We want to switch the words of UArr if host and target endianness // do not match. FLOAT_WORDS_BIG_ENDIAN describes the target endianness. // The host's used to be available in HOST_WORDS_BIG_ENDIAN, but the gcc - // maintainers removed this in a fit of cleanliness between 4.0 + // maintainers removed this in a fit of cleanliness between 4.0 // and 4.2. llvm::sys has a substitute. UArr[0] = RealArr[0]; // Long -> int convert @@ -7088,7 +7111,7 @@ std::vector Elts; for (tree elt = TREE_VECTOR_CST_ELTS(exp); elt; elt = TREE_CHAIN(elt)) Elts.push_back(Convert(TREE_VALUE(elt))); - + // The vector should be zero filled if insufficient elements are provided. if (Elts.size() < TYPE_VECTOR_SUBPARTS(TREE_TYPE(exp))) { tree EltType = TREE_TYPE(TREE_TYPE(exp)); @@ -7096,16 +7119,16 @@ while (Elts.size() < TYPE_VECTOR_SUBPARTS(TREE_TYPE(exp))) Elts.push_back(Zero); } - + return ConstantVector::get(Elts); } Constant *TreeConstantToLLVM::ConvertSTRING_CST(tree exp) { const ArrayType *StrTy = cast(ConvertType(TREE_TYPE(exp))); const Type *ElTy = StrTy->getElementType(); - + unsigned Len = (unsigned)TREE_STRING_LENGTH(exp); - + std::vector Elts; if (ElTy == Type::getInt8Ty(Context)) { const unsigned char *InStr =(const unsigned char *)TREE_STRING_POINTER(exp); @@ -7141,11 +7164,11 @@ } else { assert(0 && "Unknown character type!"); } - + unsigned LenInElts = Len / TREE_INT_CST_LOW(TYPE_SIZE_UNIT(TREE_TYPE(TREE_TYPE(exp)))); unsigned ConstantSize = StrTy->getNumElements(); - + if (LenInElts != ConstantSize) { // If this is a variable sized array type, set the length to LenInElts. if (ConstantSize == 0) { @@ -7155,7 +7178,7 @@ StrTy = ArrayType::get(ElTy, LenInElts); } } - + if (ConstantSize < LenInElts) { // Only some chars are being used, truncate the string: char X[2] = "foo"; Elts.resize(ConstantSize); @@ -7181,11 +7204,11 @@ const Type *Ty = ConvertType(TREE_TYPE(exp)); bool EltIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))); bool TyIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp)); - + // If this is a structure-to-structure cast, just return the uncasted value. if (!Elt->getType()->isSingleValueType() || !Ty->isSingleValueType()) return Elt; - + // Elt and Ty can be integer, float or pointer here: need generalized cast Instruction::CastOps opcode = CastInst::getCastOpcode(Elt, EltIsSigned, Ty, TyIsSigned); @@ -7197,8 +7220,8 @@ bool EltIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))); const Type *Ty = ConvertType(TREE_TYPE(exp)); bool TyIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp)); - Instruction::CastOps opcode = CastInst::getCastOpcode(Elt, EltIsSigned, Ty, - TyIsSigned); + Instruction::CastOps opcode = CastInst::getCastOpcode(Elt, EltIsSigned, Ty, + TyIsSigned); return TheFolder->CreateCast(opcode, Elt, Ty); } @@ -7222,7 +7245,7 @@ case PLUS_EXPR: Result = TheFolder->CreateAdd(LHS, RHS); break; case MINUS_EXPR: Result = TheFolder->CreateSub(LHS, RHS); break; } - + const Type *Ty = ConvertType(TREE_TYPE(exp)); bool TyIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp)); opcode = CastInst::getCastOpcode(Result, LHSIsSigned, Ty, TyIsSigned); @@ -7238,7 +7261,7 @@ return Constant::getNullValue(ConvertType(TREE_TYPE(exp))); switch (TREE_CODE(TREE_TYPE(exp))) { - default: + default: debug_tree(exp); assert(0 && "Unknown ctor!"); case VECTOR_TYPE: @@ -7252,12 +7275,12 @@ Constant *TreeConstantToLLVM::ConvertArrayCONSTRUCTOR(tree exp) { // Vectors are like arrays, but the domain is stored via an array // type indirectly. - + // If we have a lower bound for the range of the type, get it. tree InitType = TREE_TYPE(exp); tree min_element = size_zero_node; std::vector ResultElts; - + if (TREE_CODE(InitType) == VECTOR_TYPE) { ResultElts.resize(TYPE_VECTOR_SUBPARTS(InitType)); } else { @@ -7265,7 +7288,7 @@ tree Domain = TYPE_DOMAIN(InitType); if (Domain && TYPE_MIN_VALUE(Domain)) min_element = fold_convert(sizetype, TYPE_MIN_VALUE(Domain)); - + if (Domain && TYPE_MAX_VALUE(Domain)) { tree max_element = fold_convert(sizetype, TYPE_MAX_VALUE(Domain)); tree size = size_binop (MINUS_EXPR, max_element, min_element); @@ -7284,11 +7307,11 @@ // Find and decode the constructor's value. Constant *Val = Convert(elt_value); SomeVal = Val; - + // Get the index position of the element within the array. Note that this // can be NULL_TREE, which means that it belongs in the next available slot. tree index = elt_index; - + // The first and last field to fill in, inclusive. unsigned FieldOffset, FieldLastOffset; if (index && TREE_CODE(index) == RANGE_EXPR) { @@ -7312,7 +7335,7 @@ FieldOffset = NextFieldToFill; FieldLastOffset = FieldOffset; } - + // Process all of the elements in the range. for (--FieldOffset; FieldOffset != FieldLastOffset; ) { ++FieldOffset; @@ -7323,17 +7346,17 @@ ResultElts.resize(FieldOffset+1); ResultElts[FieldOffset] = Val; } - + NextFieldToFill = FieldOffset+1; } } - + // Zero length array. if (ResultElts.empty()) return ConstantArray::get( cast(ConvertType(TREE_TYPE(exp))), ResultElts); assert(SomeVal && "If we had some initializer, we should have some value!"); - + // Do a post-pass over all of the elements. We're taking care of two things // here: // #1. If any elements did not have initializers specified, provide them @@ -7350,12 +7373,12 @@ else if (ResultElts[i]->getType() != ElTy) AllEltsSameType = false; } - + if (TREE_CODE(InitType) == VECTOR_TYPE) { assert(AllEltsSameType && "Vector of heterogeneous element types?"); return ConstantVector::get(ResultElts); } - + if (AllEltsSameType) return ConstantArray::get( ArrayType::get(ElTy, ResultElts.size()), ResultElts); @@ -7427,9 +7450,9 @@ const Type *PadTy = Type::getInt8Ty(Context); if (AlignedEltOffs-EltOffs != 1) PadTy = ArrayType::get(PadTy, AlignedEltOffs-EltOffs); - ResultElts.insert(ResultElts.begin()+i, + ResultElts.insert(ResultElts.begin()+i, Constant::getNullValue(PadTy)); - + // The padding is now element "i" and just bumped us up to "AlignedEltOffs". EltOffs = AlignedEltOffs; ++e; // One extra element to scan. @@ -7500,7 +7523,7 @@ ConvertToPacked(); assert(NextFieldByteStart*8 <= GCCFieldOffsetInBits && "Packing didn't fix the problem!"); - + // Recurse to add the field after converting to packed. return AddFieldToRecordConstant(Val, GCCFieldOffsetInBits); } @@ -7518,7 +7541,7 @@ ResultElts.push_back(Constant::getNullValue(FillTy)); NextFieldByteStart = GCCFieldOffsetInBits/8; - + // Recurse to add the field. This handles the case when the LLVM struct // needs to be converted to packed after inserting tail padding. return AddFieldToRecordConstant(Val, GCCFieldOffsetInBits); @@ -7703,7 +7726,7 @@ FillTy = ArrayType::get(FillTy, GCCStructSize - NextFieldByteStart); ResultElts.push_back(Constant::getNullValue(FillTy)); NextFieldByteStart = GCCStructSize; - + // At this point, we know that our struct should have the right size. // However, if the size of the struct is not a multiple of the largest // element alignment, the rounding could bump up the struct more. In this @@ -7759,7 +7782,7 @@ ConstantInt *ValC = cast(Val); uint64_t FieldSizeInBits = getInt64(DECL_SIZE(Field), true); uint64_t ValueSizeInBits = Val->getType()->getPrimitiveSizeInBits(); - + // G++ has various bugs handling {} initializers where it doesn't // synthesize a zero node of the right type. Instead of figuring out G++, // just hack around it by special casing zero and allowing it to be the @@ -7769,7 +7792,7 @@ ValC = ConstantInt::get(Context, ValAsInt.zext(FieldSizeInBits)); ValueSizeInBits = FieldSizeInBits; } - + assert(ValueSizeInBits >= FieldSizeInBits && "disagreement between LLVM and GCC on bitfield size"); if (ValueSizeInBits != FieldSizeInBits) { @@ -7791,7 +7814,7 @@ LayoutInfo.HandleTailPadding(getInt64(StructTypeSizeTree, true)); // Okay, we're done, return the computed elements. - return ConstantStruct::get(Context, LayoutInfo.ResultElts, + return ConstantStruct::get(Context, LayoutInfo.ResultElts, LayoutInfo.StructIsPacked); } @@ -7835,8 +7858,8 @@ Constant *LV; switch (TREE_CODE(exp)) { - default: - debug_tree(exp); + default: + debug_tree(exp); assert(0 && "Unknown constant lvalue to convert!"); abort(); case FUNCTION_DECL: @@ -7865,11 +7888,11 @@ LV = Convert(TREE_OPERAND(exp, 0)); break; case COMPOUND_LITERAL_EXPR: // FIXME: not gimple - defined by C front-end - /* This used to read + /* This used to read return EmitLV(COMPOUND_LITERAL_EXPR_DECL(exp)); - but gcc warns about that and there doesn't seem to be any way to stop it + but gcc warns about that and there doesn't seem to be any way to stop it with casts or the like. The following is equivalent with no checking - (since we know TREE_CODE(exp) is COMPOUND_LITERAL_EXPR the checking + (since we know TREE_CODE(exp) is COMPOUND_LITERAL_EXPR the checking doesn't accomplish anything anyway). */ LV = EmitLV(DECL_EXPR_DECL (TREE_OPERAND (exp, 0))); break; @@ -7919,7 +7942,7 @@ // the type of the initializer. Correct for this now. const Type *Ty = ConvertType(TREE_TYPE(exp)); if (Ty == Type::getVoidTy(Context)) Ty = Type::getInt8Ty(Context); // void* -> i8*. - + return TheFolder->CreateBitCast(Val, Ty->getPointerTo()); } @@ -7927,7 +7950,7 @@ Constant *TreeConstantToLLVM::EmitLV_LABEL_DECL(tree exp) { assert(TheTreeToLLVM && "taking the address of a label while not compiling the function!"); - + // Figure out which function this is for, verify it's the one we're compiling. if (DECL_CONTEXT(exp)) { assert(TREE_CODE(DECL_CONTEXT(exp)) == FUNCTION_DECL && @@ -7935,7 +7958,7 @@ assert(TheTreeToLLVM->getFUNCTION_DECL() == DECL_CONTEXT(exp) && "Taking the address of a label that isn't in the current fn!?"); } - + BasicBlock *BB = getLabelDeclBlock(exp); Constant *C = TheTreeToLLVM->getIndirectGotoBlockNumber(BB); return @@ -8006,7 +8029,7 @@ } else { ArrayAddr = Convert(Array); } - + Constant *IndexVal = Convert(Index); const Type *IntPtrTy = getTargetData().getIntPtrType(Context); @@ -8024,17 +8047,17 @@ Constant *TreeConstantToLLVM::EmitLV_COMPONENT_REF(tree exp) { Constant *StructAddrLV = EmitLV(TREE_OPERAND(exp, 0)); - + // Ensure that the struct type has been converted, so that the fielddecls // are laid out. const Type *StructTy = ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0))); - + tree FieldDecl = TREE_OPERAND(exp, 1); - + StructAddrLV = TheFolder->CreateBitCast(StructAddrLV, PointerType::getUnqual(StructTy)); const Type *FieldTy = ConvertType(getDeclaredType(FieldDecl)); - + // BitStart - This is the actual offset of the field from the start of the // struct, in bits. For bitfields this may be on a non-byte boundary. unsigned BitStart = getComponentRefOffsetInBits(exp); @@ -8053,23 +8076,23 @@ ConstantInt::get(Type::getInt32Ty(Context), MemberIndex) }; FieldPtr = TheFolder->CreateGetElementPtr(StructAddrLV, Ops+1, 2); - + FieldPtr = ConstantFoldInstOperands(Instruction::GetElementPtr, FieldPtr->getType(), Ops, - 3, Context, &TD); - + 3, Context, &TD); + // Now that we did an offset from the start of the struct, subtract off // the offset from BitStart. if (MemberIndex) { const StructLayout *SL = TD.getStructLayout(cast(StructTy)); BitStart -= SL->getElementOffset(MemberIndex) * 8; } - + } else { Constant *Offset = Convert(field_offset); Constant *Ptr = TheFolder->CreatePtrToInt(StructAddrLV, Offset->getType()); Ptr = TheFolder->CreateAdd(Ptr, Offset); - FieldPtr = TheFolder->CreateIntToPtr(Ptr, + FieldPtr = TheFolder->CreateIntToPtr(Ptr, PointerType::getUnqual(FieldTy)); } Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=79915&r1=79914&r2=79915&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Mon Aug 24 08:17:51 2009 @@ -36,8 +36,8 @@ #include "llvm/Support/DataTypes.h" #include "llvm/Support/IRBuilder.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Streams.h" #include "llvm/Support/TargetFolder.h" +#include "llvm/Support/raw_os_ostream.h" // System headers #include @@ -85,10 +85,6 @@ /// getTargetData - Return the current TargetData object from TheTarget. const TargetData &getTargetData(); -/// AsmOutFile - A C++ ostream wrapper around asm_out_file. -/// -extern llvm::OStream *AsmOutFile; - /// AttributeUsedGlobals - The list of globals that are marked attribute(used). extern SmallSetVector AttributeUsedGlobals; From baldrick at free.fr Mon Aug 24 08:54:57 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 13:54:57 -0000 Subject: [llvm-commits] [gcc-plugin] r79918 - in /gcc-plugin/trunk: llvm-backend.cpp llvm-file-ostream.h Message-ID: <200908241354.n7ODsvjd020760@zion.cs.uiuc.edu> Author: baldrick Date: Mon Aug 24 08:54:57 2009 New Revision: 79918 URL: http://llvm.org/viewvc/llvm-project?rev=79918&view=rev Log: Do not use oFILEstream for dumping, use raw_fd_ostream. Removed: gcc-plugin/trunk/llvm-file-ostream.h Modified: gcc-plugin/trunk/llvm-backend.cpp Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=79918&r1=79917&r2=79918&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Mon Aug 24 08:54:57 2009 @@ -84,9 +84,7 @@ // Plugin headers #include "llvm-internal.h" #include "llvm-debug.h" -#include "llvm-file-ostream.h" #include "llvm-target.h" -//TODO#include "llvm-file-ostream.h" #include "bits_and_bobs.h" // Non-zero if bytecode from PCH is successfully read. @@ -1898,14 +1896,6 @@ TreeToLLVM Emitter(current_function_decl); Function *Fn = Emitter.EmitFunction(); -//TODO#if 0 -//TODO if (dump_file) { -//TODO fprintf (dump_file, -//TODO "\n\n;;\n;; Full LLVM generated for this function:\n;;\n"); -//TODO Fn->dump(); -//TODO } -//TODO#endif -//TODO //TODO performLateBackendInitialization(); //TODO createPerFunctionOptimizationPasses(); //TODO @@ -1922,7 +1912,7 @@ // When debugging, append the LLVM IR to the dump file. if (dump_file) { - oFILEstream dump_stream(dump_file); + raw_fd_ostream dump_stream(fileno(dump_file), false); Fn->print(dump_stream); } Removed: gcc-plugin/trunk/llvm-file-ostream.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-file-ostream.h?rev=79917&view=auto ============================================================================== --- gcc-plugin/trunk/llvm-file-ostream.h (original) +++ gcc-plugin/trunk/llvm-file-ostream.h (removed) @@ -1,45 +0,0 @@ -/* LLVM LOCAL begin (ENTIRE FILE!) */ -/* Definition of the oFILEstream class -Copyright (C) 2005 Free Software Foundation, Inc. -Contributed by Chris Lattner (sabre at nondot.org) - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -#ifndef LLVM_FILE_OSTREAM_H -#define LLVM_FILE_OSTREAM_H - -#include -#include - -/// oFILEstream - An ostream that outputs all of its data to the specified C -/// FILE* file stream. -/// -/// FIXME: eliminate G++ dependency. -class oFILEstream : public std::ostream { - __gnu_cxx::stdio_filebuf sb; -public: - typedef char char_type; - typedef int int_type; - typedef std::streampos pos_type; - typedef std::streamoff off_type; - - explicit oFILEstream(FILE *F) - : std::ostream(&sb), sb(F, std::ios_base::out) { } -}; - -#endif From baldrick at free.fr Mon Aug 24 10:27:00 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 15:27:00 -0000 Subject: [llvm-commits] [gcc-plugin] r79920 - /gcc-plugin/trunk/llvm-backend.cpp Message-ID: <200908241527.n7OFR1Pp032470@zion.cs.uiuc.edu> Author: baldrick Date: Mon Aug 24 10:27:00 2009 New Revision: 79920 URL: http://llvm.org/viewvc/llvm-project?rev=79920&view=rev Log: If the plugin is not compatible with the gcc it is being loaded into, exit without calling any further gcc routines. Modified: gcc-plugin/trunk/llvm-backend.cpp Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=79920&r1=79919&r2=79920&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Mon Aug 24 10:27:00 2009 @@ -2008,14 +2008,9 @@ // Check that the running gcc is the same as the gcc we were built against. // If not, refuse to load. This seems wise when developing against a fast - // moving gcc tree. - // TODO: Make the check milder if doing a "release build". + // moving gcc tree. TODO: Use a milder check if doing a "release build". if (!plugin_default_version_check (version, &gcc_version)) { - // TODO: calling a gcc routine when there is a version mismatch is - // dangerous. On the other hand, failing without an explanation is - // obscure. Could send a message to std::cerr instead, but bypassing - // the gcc error reporting and translating mechanism is kind of sucky. - error(G_("plugin %qs: gcc version mismatch"), plugin_name); + errs() << "Incompatible plugin version\n"; return 1; } From daniel at zuster.org Mon Aug 24 11:00:56 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 09:00:56 -0700 Subject: [llvm-commits] [PATCH] Preparation for Optimal Edge Profiling: Add calculation of maximum spanning tree. In-Reply-To: <4A8C23BA.5060800@student.tuwien.ac.at> References: <4A8C23BA.5060800@student.tuwien.ac.at> Message-ID: <6a8523d60908240900n6e631092he03fc4830f66a9b8@mail.gmail.com> Hi Andreas, On Wed, Aug 19, 2009 at 9:09 AM, Andreas Neustifter wrote: > Hi, > > this is a preparation patch for Optimal Edge Profiling, it adds a module to > calculate the maximum spanning tree of an function according to an given > ProfileInformation. This class is specialized to ProfileInfo, so I don't think it should go into the generic headers. Can it just live where the optimal edge profiling implementation does, as private helper class? Also, MSTForest is just union find, right? Can it use llvm/ADT/EquivalenceClasses.h instead? Similarly, MaximumSpanningTree should say 'Kruskal's algorithm' somewhere. Also, would it make more sense to just implement MST, and have clients use set_difference if they want the complement, instead of the inverted flag? I would find this easier to read (I think). It isn't necessary, but I think this code might be simpler and easier to read if it was just a generic implementation of Kruskal's algorithm, which the Optimal Edge Profiling could manage its own instantiation of. Then it would make sense to drop it in ADT/ - Daniel From daniel at zuster.org Mon Aug 24 11:05:21 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 09:05:21 -0700 Subject: [llvm-commits] [PATCH] Preparation for Optimal Edge Profiling: Build libprofile as bytecode. In-Reply-To: <4A8C2948.9050504@student.tuwien.ac.at> References: <4A8C2948.9050504@student.tuwien.ac.at> Message-ID: <6a8523d60908240905q668b231eg349bb59c3c5b705e@mail.gmail.com> Hi Andreas, The exported change is fine, but I don't think MODULE_NAME is necessary. libprofile_rt.bca (a bitcode archive) is already getting built, isn't that good enough? - Daniel On Wed, Aug 19, 2009 at 9:33 AM, Andreas Neustifter wrote: > Hi, > > this is a preparation patch for Optimal Edge Profiling, it provides building > of the runtime library for profiling (./runtime/libprofile) as llvm > bytecode. > > Andi > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From daniel at zuster.org Mon Aug 24 11:06:58 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 09:06:58 -0700 Subject: [llvm-commits] [PATCH] Cleanup and Improve ProfileEstimator and MaximumSpanningTree In-Reply-To: <4A8C2A0B.4010103@student.tuwien.ac.at> References: <4A8C2A0B.4010103@student.tuwien.ac.at> Message-ID: <6a8523d60908240906q1e705593ufed5aa77b1209a9c@mail.gmail.com> Can you go ahead and apply the comment fixes parts of this (minus the changes to stuff not in the tree, of course). Thanks, - Daniel On Wed, Aug 19, 2009 at 9:36 AM, Andreas Neustifter wrote: > Since Daniel had some comments (see > http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-August/024735.html) to an > previous patch of mine that were not addressed, this is the follow-up to > correct this issues. > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From clattner at apple.com Mon Aug 24 12:20:31 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 24 Aug 2009 10:20:31 -0700 Subject: [llvm-commits] [llvm] r79896 - /llvm/trunk/examples/Kaleidoscope/toy.cpp In-Reply-To: <200908240542.n7O5gMRD014092@zion.cs.uiuc.edu> References: <200908240542.n7O5gMRD014092@zion.cs.uiuc.edu> Message-ID: On Aug 23, 2009, at 10:42 PM, Reid Kleckner wrote: > Author: rnk > Date: Mon Aug 24 00:42:21 2009 > New Revision: 79896 > > URL: http://llvm.org/viewvc/llvm-project?rev=79896&view=rev > Log: > Fixed double free in Kaleidoscope. Fixes PR4762. > > Modified: > llvm/trunk/examples/Kaleidoscope/toy.cpp > > Modified: llvm/trunk/examples/Kaleidoscope/toy.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/toy.cpp?rev=79896&r1=79895&r2=79896&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/examples/Kaleidoscope/toy.cpp (original) > +++ llvm/trunk/examples/Kaleidoscope/toy.cpp Mon Aug 24 00:42:21 2009 > @@ -1107,12 +1107,13 @@ > > // Make the module, which holds all the code. > TheModule = new Module("my cool jit", Context); > - > - // Create the JIT. > - TheExecutionEngine = EngineBuilder(TheModule).create(); > > { > ExistingModuleProvider OurModuleProvider(TheModule); > + > + // Create the JIT. > + TheExecutionEngine = EngineBuilder(&OurModuleProvider).create(); Hi Reid, Are you sure that this will fix it? IT seems that we'd need something like: > ExistingModuleProvider *OurModuleProvider = new > ExistingModuleProvider(TheModule); > TheExecutionEngine = EngineBuilder(OurModuleProvider).create(); -Chris > + > FunctionPassManager OurFPM(&OurModuleProvider); > > // Set up the optimizer pipeline. Start with registering info > about how the > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ofv at wanadoo.es Mon Aug 24 12:20:58 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Mon, 24 Aug 2009 19:20:58 +0200 Subject: [llvm-commits] [llvm] r79732 - /llvm/trunk/cmake/modules/TableGen.cmake References: <200908220700.n7M70L8D011322@zion.cs.uiuc.edu> Message-ID: <87eir1qgat.fsf@telefonica.net> Douglas Gregor writes: > Author: dgregor > Date: Sat Aug 22 02:00:18 2009 > New Revision: 79732 > > URL: http://llvm.org/viewvc/llvm-project?rev=79732&view=rev > Log: > CMake: Don't use copy_if_different for TableGen output, because it does not work with IDE targets What means "does not work"? Which IDEs have this problem? -- ?scar From clattner at apple.com Mon Aug 24 12:21:48 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 24 Aug 2009 10:21:48 -0700 Subject: [llvm-commits] [llvm] r79880 - /llvm/trunk/test/ExecutionEngine/2007-12-14-LittleEndian.ll In-Reply-To: <4A924712.8060803@free.fr> References: <200908240205.n7O25xGg019496@zion.cs.uiuc.edu> <4A924712.8060803@free.fr> Message-ID: <7D85AF6D-E677-4FE7-9785-467E9F5C95B1@apple.com> On Aug 24, 2009, at 12:53 AM, Duncan Sands wrote: > Hi Chris, > >> Remove this test now that the interpreter doesn't support >> interpreting the wrong endianness anymore. This fixes a >> failure on clang-powerpc-darwin8 > > what's the reason for removing this feature? I taught the interpreter > how to do loads and stores etc of the wrong endianness in a moment of > boredom. That's probably where this test comes from. While it is not > the world's most useful feature, I thought it might be useful for > debugging endianness problems when you don't have access to a machine > with that endianness. IMO it's a useless feature. Endianness isn't the only problem, things like struct field alignment, pointer size, and many other things will conspire to make the code not work. -Chris From dgregor at apple.com Mon Aug 24 12:40:13 2009 From: dgregor at apple.com (Douglas Gregor) Date: Mon, 24 Aug 2009 10:40:13 -0700 Subject: [llvm-commits] [llvm] r79732 - /llvm/trunk/cmake/modules/TableGen.cmake In-Reply-To: <87eir1qgat.fsf@telefonica.net> References: <200908220700.n7M70L8D011322@zion.cs.uiuc.edu> <87eir1qgat.fsf@telefonica.net> Message-ID: <733304B8-2E7B-41DC-A9E8-B1038991A3E9@apple.com> On Aug 24, 2009, at 10:20 AM, ?scar Fuentes wrote: > Douglas Gregor writes: > >> Author: dgregor >> Date: Sat Aug 22 02:00:18 2009 >> New Revision: 79732 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=79732&view=rev >> Log: >> CMake: Don't use copy_if_different for TableGen output, because it >> does not work with IDE targets > > What means "does not work"? > > Which IDEs have this problem? Both Xcode and Visual C++ have different problems. In Xcode, one has to build *twice* after changing a .td file. The first time rebuilds the .inc files, then the second time rebuilds anything that depends on the .inc files. In Visual C++, targets that depend on the .inc files end up getting rebuilt every time we hit "build", even if the .td files haven't changed. (At least, this is what I hear; I don't have Visual C++ around to verify). - Doug From dalej at apple.com Mon Aug 24 12:51:20 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 24 Aug 2009 17:51:20 -0000 Subject: [llvm-commits] [llvm] r79926 - in /llvm/trunk/test/CodeGen: ARM/2009-08-23-linkerprivate.ll Generic/2009-08-23-linkerprivate.ll PowerPC/2009-08-23-linkerprivate.ll X86/2009-08-23-linkerprivate.ll Message-ID: <200908241751.n7OHpKCl018025@zion.cs.uiuc.edu> Author: johannes Date: Mon Aug 24 12:51:19 2009 New Revision: 79926 URL: http://llvm.org/viewvc/llvm-project?rev=79926&view=rev Log: Split test into 3. Added: llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll Removed: llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll Added: llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll?rev=79926&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2009-08-23-linkerprivate.ll Mon Aug 24 12:51:19 2009 @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-apple-darwin | FileCheck %s + +; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm' + +@"\01l_objc_msgSend_fixup_alloc" = linker_private hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16 ; [#uses=0] + +; CHECK: .globl l_objc_msgSend_fixup_alloc +; CHECK: .weak_definition l_objc_msgSend_fixup_alloc Removed: llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll?rev=79925&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll (removed) @@ -1,10 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin | FileCheck %s -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=ppc-apple-darwin | FileCheck %s -; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-apple-darwin | FileCheck %s - -; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm' - -@"\01l_objc_msgSend_fixup_alloc" = linker_private hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16 ; [#uses=0] - -; CHECK: .globl l_objc_msgSend_fixup_alloc -; CHECK: .weak_definition l_objc_msgSend_fixup_alloc Added: llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll?rev=79926&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll Mon Aug 24 12:51:19 2009 @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=ppc-apple-darwin | FileCheck %s + +; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm' + +@"\01l_objc_msgSend_fixup_alloc" = linker_private hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16 ; [#uses=0] + +; CHECK: .globl l_objc_msgSend_fixup_alloc +; CHECK: .weak_definition l_objc_msgSend_fixup_alloc Added: llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll?rev=79926&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-08-23-linkerprivate.ll Mon Aug 24 12:51:19 2009 @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin | FileCheck %s + +; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm' + +@"\01l_objc_msgSend_fixup_alloc" = linker_private hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16 ; [#uses=0] + +; CHECK: .globl l_objc_msgSend_fixup_alloc +; CHECK: .weak_definition l_objc_msgSend_fixup_alloc From grosbach at apple.com Mon Aug 24 13:47:19 2009 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 24 Aug 2009 11:47:19 -0700 Subject: [llvm-commits] [llvm] r79858 - /llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp In-Reply-To: <4A9240D9.90200@free.fr> References: <200908231813.n7NIDnFv025846@zion.cs.uiuc.edu> <4A9240D9.90200@free.fr> Message-ID: <3A376DB9-9E8B-4330-9522-72A2E6768246@apple.com> On Aug 24, 2009, at 12:27 AM, Duncan Sands wrote: > Hi Jim, > >> + // If we don't have any eh.selector calls, we can't determine >> the personality >> + // function. Without a personality function, we can't process >> exceptions. >> + if (!PersonalityFn) return false; > > can you use the C (yes, C!) personality function? It is always > available since it's part of libgcc. > Hi Duncan, If I pick an arbitrary personality function, there's no guarantee things will be compatible with how the context and LSDA are expected to be used. Realistically, when we get input code like this (still have invokes and landing pads, but no eh.selectors), I'm not sure it's valid code at all. It's definitely outside the scope of what the SjLj exception handling is designed to handle. Thus, I think the conservative answer is to punt rather than guess. -Jim From baldrick at free.fr Mon Aug 24 14:02:02 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 24 Aug 2009 21:02:02 +0200 Subject: [llvm-commits] [llvm] r79858 - /llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp In-Reply-To: <3A376DB9-9E8B-4330-9522-72A2E6768246@apple.com> References: <200908231813.n7NIDnFv025846@zion.cs.uiuc.edu> <4A9240D9.90200@free.fr> <3A376DB9-9E8B-4330-9522-72A2E6768246@apple.com> Message-ID: <4A92E3AA.9040606@free.fr> Hi Jim, > If I pick an arbitrary personality function, there's no guarantee things > will be compatible with how the context and LSDA are expected to be > used. the C personality function is compatible with the dwarf info we output. I don't know about sj/lj. It is only knows about cleanups. Realistically, when we get input code like this (still have > invokes and landing pads, but no eh.selectors), I'm not sure it's valid > code at all. In the long term I would like to treat this situation as equivalent to a cleanup. It's definitely outside the scope of what the SjLj > exception handling is designed to handle. Thus, I think the conservative > answer is to punt rather than guess. For the moment we can punt. That's what the dwarf stuff does too. Ciao, Duncan. From e0325716 at student.tuwien.ac.at Mon Aug 24 14:06:54 2009 From: e0325716 at student.tuwien.ac.at (Andreas Neustifter) Date: Mon, 24 Aug 2009 21:06:54 +0200 Subject: [llvm-commits] [PATCH] Preparation for Optimal Edge Profiling: Build libprofile as bytecode. In-Reply-To: <6a8523d60908240905q668b231eg349bb59c3c5b705e@mail.gmail.com> References: <4A8C2948.9050504@student.tuwien.ac.at> <6a8523d60908240905q668b231eg349bb59c3c5b705e@mail.gmail.com> Message-ID: <4A92E4CE.7000404@student.tuwien.ac.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Daniel, Daniel Dunbar wrote: > Hi Andreas, > > The exported change is fine, but I don't think MODULE_NAME is > necessary. libprofile_rt.bca (a bitcode archive) is already getting > built, isn't that good enough? I used that for bytecode linking of the whole module, there its not possible to use the libprofile_rt.bca. But its also possible to link the libprofile_rt.so instead later on. I will commit only the symbol export. Andi - -- ========================================================================== This email is signed, for more information see http://web.student.tuwien.ac.at/~e0325716/gpg.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqS5MwACgkQPiYq0rq7s/BcmACeMxsgbEulGzVIIYii6s2Zz3eF J1EAoIE9vgPDOROo0I1boyP6e/mdG5RN =s8YD -----END PGP SIGNATURE----- From daniel at zuster.org Mon Aug 24 14:38:47 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 12:38:47 -0700 Subject: [llvm-commits] [llvm] r79615 - in /llvm/trunk/test/Analysis/Profiling: ./ 2009-08-21-irregular-loop.ll 2009-08-21-only-one-block.ll 2009-08-21-several-blocks.ll dg.exp In-Reply-To: <4A8EBD43.60501@gmx.at> References: <200908210936.n7L9aScH013127@zion.cs.uiuc.edu> <76A6DF93-A31D-470D-8504-A9FB859FD2B8@apple.com> <4A8EBD43.60501@gmx.at> Message-ID: <6a8523d60908241238v435742bbxbf7df11512a598c7@mail.gmail.com> Hi Andreas, I talked with Chris about this the morning, and I think we agreed that lli based tests for this stuff are ok, as long as we limit them to just a few. The main thing we basically need lli for is to test the generation of the profiling information; I think a single solid test for that would be good enough for now. We should solve the problem that this requires the JIT, though. A simple first option is to disable the test if there is no JIT support. A slightly better one would be to run it using the .bca version of the profiling information, but that of course requires that the user configure with llvm-gcc support. I think we can find ways to test some of the other stuff without using lli. For example, the static profile provider should be good enough to test llvm-prof's output. Sound OK? - Daniel On Fri, Aug 21, 2009 at 8:29 AM, Andreas Neustifter wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Chris Lattner wrote: >> >> On Aug 21, 2009, at 2:36 AM, Andreas Neustifter wrote: >> >>> Author: astifter >>> Date: Fri Aug 21 04:36:28 2009 >>> New Revision: 79615 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=79615&view=rev >>> Log: >>> Added tests for Profiling Infrastructure. >> >> Hi Andreas, >> >> We'd really prefer to avoid executable (e.g. that run lli) tests in the >> llvm/test suite. ?Is there any other way to do this sort of thing? >> Among other things, these will fail on hosts that don't have JIT >> support. ?Can you pull this out until after 2.6 branches (today)? >> >> -Chris > > Yeah, sure. Sorry for the trouble. Pulled in r79633. > > I will try to think of another way to test this, I'm not sure if its > possible tough. > > Andi. > >> >>> >>> Added: >>> ? ?llvm/trunk/test/Analysis/Profiling/ >>> ? ?llvm/trunk/test/Analysis/Profiling/2009-08-21-irregular-loop.ll >>> ? ?llvm/trunk/test/Analysis/Profiling/2009-08-21-only-one-block.ll >>> ? ?llvm/trunk/test/Analysis/Profiling/2009-08-21-several-blocks.ll >>> ? ?llvm/trunk/test/Analysis/Profiling/dg.exp >>> >>> Added: llvm/trunk/test/Analysis/Profiling/2009-08-21-irregular-loop.ll >>> URL: >>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Profiling/2009-08-21-irregular-loop.ll?rev=79615&view=auto >>> >>> >>> ============================================================================== >>> >>> --- llvm/trunk/test/Analysis/Profiling/2009-08-21-irregular-loop.ll >>> (added) >>> +++ llvm/trunk/test/Analysis/Profiling/2009-08-21-irregular-loop.ll >>> Fri Aug 21 04:36:28 2009 >>> @@ -0,0 +1,154 @@ >>> +; RUN: llvm-as < %s | opt -insert-edge-profiling > %t1 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 2 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 2 3 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 2 3 4 >>> +; RUN: mv llvmprof.out %t2 >>> +; RUN: llvm-prof -print-all-code %t1 %t2 | tee %t3 | FileCheck %s >>> +; CHECK: ?1. ? ? 5/5 main >>> +; CHECK: ?1. ?19.6% ? ?46/235 ? ?main() - bb6 >>> +; CHECK: ?2. ?15.7% ? ?37/235 ? ?main() - bb2 >>> +; CHECK: ?3. ?15.3% ? ?36/235 ? ?main() - bb3 >>> +; CHECK: ?4. ?15.3% ? ?36/235 ? ?main() - bb5 >>> +; CHECK: ?5. ?7.23% ? ?17/235 ? ?main() - bb10 >>> +; CHECK: ?6. ?5.53% ? ?13/235 ? ?main() - bb >>> +; CHECK: ?7. ?5.11% ? ?12/235 ? ?main() - bb9 >>> +; CHECK: ?8. ?4.26% ? ?10/235 ? ?main() - bb1 >>> +; CHECK: ?9. ?3.83% ? ? 9/235 ? ?main() - bb7 >>> +; CHECK: 10. ?2.55% ? ? 6/235 ? ?main() - bb11 >>> +; CHECK: 11. ?2.13% ? ? 5/235 ? ?main() - entry >>> +; CHECK: 12. ? 1.7% ? ? 4/235 ? ?main() - bb10.bb11_crit_edge >>> +; CHECK: 13. ?1.28% ? ? 3/235 ? ?main() - bb8 >>> +; CHECK: 14. 0.426% ? ? 1/235 ? ?main() - bb4 >>> +; ModuleID = '' >>> +target datalayout = >>> "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" >>> >>> +target triple = "x86_64-unknown-linux-gnu" >>> + at .str = internal constant [6 x i8] c"franz\00" ? ? ? ?; <[6 x i8]*> >>> [#uses=1] >>> + at .str1 = internal constant [9 x i8] c"argc > 2\00" ? ? ? ?; <[9 x >>> i8]*> [#uses=1] >>> + at .str2 = internal constant [9 x i8] c"argc = 1\00" ? ? ? ?; <[9 x >>> i8]*> [#uses=1] >>> + at .str3 = internal constant [6 x i8] c"fritz\00" ? ? ? ?; <[6 x i8]*> >>> [#uses=1] >>> + at .str4 = internal constant [10 x i8] c"argc <= 1\00" ? ? ? ?; <[10 x >>> i8]*> [#uses=1] >>> + >>> +; CHECK:;;; %main called 5 times. >>> +; CHECK:;;; >>> +define i32 @main(i32 %argc, i8** %argv) nounwind { >>> +entry: >>> +; CHECK:entry: >>> +; CHECK: ? ?;;; Basic block executed 5 times. >>> + ? ?%argc_addr = alloca i32 ? ? ? ?; [#uses=4] >>> + ? ?%argv_addr = alloca i8** ? ? ? ?; [#uses=1] >>> + ? ?%retval = alloca i32 ? ? ? ?; [#uses=2] >>> + ? ?%j = alloca i32 ? ? ? ?; [#uses=4] >>> + ? ?%i = alloca i32 ? ? ? ?; [#uses=4] >>> + ? ?%0 = alloca i32 ? ? ? ?; [#uses=2] >>> + ? ?%"alloca point" = bitcast i32 0 to i32 ? ? ? ?; [#uses=0] >>> + ? ?store i32 %argc, i32* %argc_addr >>> + ? ?store i8** %argv, i8*** %argv_addr >>> + ? ?store i32 0, i32* %i, align 4 >>> + ? ?br label %bb10 >>> +; CHECK: ? ?;;; Out-edge counts: [5.000000e+00 -> bb10] >>> + >>> +bb: ? ? ? ?; preds = %bb10 >>> +; CHECK:bb: >>> +; CHECK: ? ?;;; Basic block executed 13 times. >>> + ? ?%1 = load i32* %argc_addr, align 4 ? ? ? ?; [#uses=1] >>> + ? ?%2 = icmp sgt i32 %1, 1 ? ? ? ?; [#uses=1] >>> + ? ?br i1 %2, label %bb1, label %bb8 >>> +; CHECK: ? ?;;; Out-edge counts: [1.000000e+01 -> bb1] [3.000000e+00 >>> -> bb8] >>> + >>> +bb1: ? ? ? ?; preds = %bb >>> +; CHECK:bb1: >>> +; CHECK: ? ?;;; Basic block executed 10 times. >>> + ? ?store i32 0, i32* %j, align 4 >>> + ? ?br label %bb6 >>> +; CHECK: ? ?;;; Out-edge counts: [1.000000e+01 -> bb6] >>> + >>> +bb2: ? ? ? ?; preds = %bb6 >>> +; CHECK:bb2: >>> +; CHECK: ? ?;;; Basic block executed 37 times. >>> + ? ?%3 = call i32 @puts(i8* getelementptr ([6 x i8]* @.str, i64 0, >>> i64 0)) nounwind ? ? ? ?; [#uses=0] >>> + ? ?%4 = load i32* %argc_addr, align 4 ? ? ? ?; [#uses=1] >>> + ? ?%5 = icmp sgt i32 %4, 2 ? ? ? ?; [#uses=1] >>> + ? ?br i1 %5, label %bb3, label %bb4 >>> +; CHECK: ? ?;;; Out-edge counts: [3.600000e+01 -> bb3] [1.000000e+00 >>> -> bb4] >>> + >>> +bb3: ? ? ? ?; preds = %bb2 >>> +; CHECK:bb3: >>> +; CHECK: ? ?;;; Basic block executed 36 times. >>> + ? ?%6 = call i32 @puts(i8* getelementptr ([9 x i8]* @.str1, i64 0, >>> i64 0)) nounwind ? ? ? ?; [#uses=0] >>> + ? ?br label %bb5 >>> +; CHECK: ? ?;;; Out-edge counts: [3.600000e+01 -> bb5] >>> + >>> +bb4: ? ? ? ?; preds = %bb2 >>> +; CHECK:bb4: >>> +; CHECK: ? ?;;; Basic block executed 1 times. >>> + ? ?%7 = call i32 @puts(i8* getelementptr ([9 x i8]* @.str2, i64 0, >>> i64 0)) nounwind ? ? ? ?; [#uses=0] >>> + ? ?br label %bb11 >>> +; CHECK: ? ?;;; Out-edge counts: [1.000000e+00 -> bb11] >>> + >>> +bb5: ? ? ? ?; preds = %bb3 >>> +; CHECK:bb5: >>> +; CHECK: ? ?;;; Basic block executed 36 times. >>> + ? ?%8 = call i32 @puts(i8* getelementptr ([6 x i8]* @.str3, i64 0, >>> i64 0)) nounwind ? ? ? ?; [#uses=0] >>> + ? ?%9 = load i32* %j, align 4 ? ? ? ?; [#uses=1] >>> + ? ?%10 = add i32 %9, 1 ? ? ? ?; [#uses=1] >>> + ? ?store i32 %10, i32* %j, align 4 >>> + ? ?br label %bb6 >>> +; CHECK: ? ?;;; Out-edge counts: [3.600000e+01 -> bb6] >>> + >>> +bb6: ? ? ? ?; preds = %bb5, %bb1 >>> +; CHECK:bb6: >>> +; CHECK: ? ?;;; Basic block executed 46 times. >>> + ? ?%11 = load i32* %j, align 4 ? ? ? ?; [#uses=1] >>> + ? ?%12 = load i32* %argc_addr, align 4 ? ? ? ?; [#uses=1] >>> + ? ?%13 = icmp slt i32 %11, %12 ? ? ? ?; [#uses=1] >>> + ? ?br i1 %13, label %bb2, label %bb7 >>> +; CHECK: ? ?;;; Out-edge counts: [3.700000e+01 -> bb2] [9.000000e+00 >>> -> bb7] >>> + >>> +bb7: ? ? ? ?; preds = %bb6 >>> +; CHECK:bb7: >>> +; CHECK: ? ?;;; Basic block executed 9 times. >>> + ? ?br label %bb9 >>> +; CHECK: ? ?;;; Out-edge counts: [9.000000e+00 -> bb9] >>> + >>> +bb8: ? ? ? ?; preds = %bb >>> +; CHECK:bb8: >>> +; CHECK: ? ?;;; Basic block executed 3 times. >>> + ? ?%14 = call i32 @puts(i8* getelementptr ([10 x i8]* @.str4, i64 0, >>> i64 0)) nounwind ? ? ? ?; [#uses=0] >>> + ? ?br label %bb9 >>> +; CHECK: ? ?;;; Out-edge counts: [3.000000e+00 -> bb9] >>> + >>> +bb9: ? ? ? ?; preds = %bb8, %bb7 >>> +; CHECK:bb9: >>> +; CHECK: ? ?;;; Basic block executed 12 times. >>> + ? ?%15 = load i32* %i, align 4 ? ? ? ?; [#uses=1] >>> + ? ?%16 = add i32 %15, 1 ? ? ? ?; [#uses=1] >>> + ? ?store i32 %16, i32* %i, align 4 >>> + ? ?br label %bb10 >>> +; CHECK: ? ?;;; Out-edge counts: [1.200000e+01 -> bb10] >>> + >>> +bb10: ? ? ? ?; preds = %bb9, %entry >>> +; CHECK: ? ?;;; Basic block executed 17 times. >>> + ? ?%17 = load i32* %i, align 4 ? ? ? ?; [#uses=1] >>> + ? ?%18 = icmp ne i32 %17, 3 ? ? ? ?; [#uses=1] >>> + ? ?br i1 %18, label %bb, label %bb11 >>> +; CHECK: ? ?;;; Out-edge counts: [1.300000e+01 -> bb] [4.000000e+00 >>> -> bb10.bb11_crit_edge] >>> +; CHECK: ? ?;;; Basic block executed 4 times. >>> +; CHECK: ? ?;;; Out-edge counts: [5.000000e+00 -> bb11] >>> + >>> +bb11: ? ? ? ?; preds = %bb10, %bb4 >>> +; CHECK:bb11: >>> +; CHECK: ? ?;;; Basic block executed 6 times. >>> + ? ?store i32 0, i32* %0, align 4 >>> + ? ?%19 = load i32* %0, align 4 ? ? ? ?; [#uses=1] >>> + ? ?store i32 %19, i32* %retval, align 4 >>> + ? ?br label %return >>> + >>> +return: ? ? ? ?; preds = %bb11 >>> +; CHECK:return: >>> + ? ?%retval12 = load i32* %retval ? ? ? ?; [#uses=1] >>> + ? ?ret i32 %retval12 >>> +} >>> + >>> +declare i32 @puts(i8*) >>> >>> Added: llvm/trunk/test/Analysis/Profiling/2009-08-21-only-one-block.ll >>> URL: >>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Profiling/2009-08-21-only-one-block.ll?rev=79615&view=auto >>> >>> >>> ============================================================================== >>> >>> --- llvm/trunk/test/Analysis/Profiling/2009-08-21-only-one-block.ll >>> (added) >>> +++ llvm/trunk/test/Analysis/Profiling/2009-08-21-only-one-block.ll >>> Fri Aug 21 04:36:28 2009 >>> @@ -0,0 +1,18 @@ >>> +; RUN: llvm-as < %s | opt -insert-edge-profiling > %t1 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 >>> +; RUN: mv llvmprof.out %t2 >>> +; RUN: llvm-prof -print-all-code %t1 %t2 | tee %t3 | FileCheck %s >>> +; CHECK: ?1. ? ? 1/1 main >>> +; CHECK: ?1. ? 100% ? ? 1/1 ? ?main() - entry >>> +; ModuleID = '' >>> +target datalayout = >>> "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" >>> >>> +target triple = "x86_64-unknown-linux-gnu" >>> + >>> +; CHECK:;;; %main called 1 times. >>> +; CHECK:;;; >>> +define i32 @main() nounwind readnone { >>> +entry: >>> +; CHECK:entry: >>> +; CHECK: ? ?;;; Basic block executed 1 times. >>> + ?ret i32 undef >>> +} >>> >>> Added: llvm/trunk/test/Analysis/Profiling/2009-08-21-several-blocks.ll >>> URL: >>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Profiling/2009-08-21-several-blocks.ll?rev=79615&view=auto >>> >>> >>> ============================================================================== >>> >>> --- llvm/trunk/test/Analysis/Profiling/2009-08-21-several-blocks.ll >>> (added) >>> +++ llvm/trunk/test/Analysis/Profiling/2009-08-21-several-blocks.ll >>> Fri Aug 21 04:36:28 2009 >>> @@ -0,0 +1,154 @@ >>> +; RUN: llvm-as < %s | opt -insert-edge-profiling > %t1 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 2 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 2 3 >>> +; RUN: lli -load %llvmlibsdir/profile_rt%shlibext %t1 1 2 3 4 >>> +; RUN: mv llvmprof.out %t2 >>> +; RUN: llvm-prof -print-all-code %t1 %t2 | tee %t3 | FileCheck %s >>> +; CHECK: ?1. ? ? 5/5 main >>> +; CHECK: ?1. ?19.9% ? ?54/272 ? ?main() - bb6 >>> +; CHECK: ?2. ?15.4% ? ?42/272 ? ?main() - bb2 >>> +; CHECK: ?3. ?15.4% ? ?42/272 ? ?main() - bb5 >>> +; CHECK: ?4. ?13.2% ? ?36/272 ? ?main() - bb3 >>> +; CHECK: ?5. ?7.35% ? ?20/272 ? ?main() - bb10 >>> +; CHECK: ?6. ?5.51% ? ?15/272 ? ?main() - bb >>> +; CHECK: ?7. ?5.51% ? ?15/272 ? ?main() - bb9 >>> +; CHECK: ?8. ?4.41% ? ?12/272 ? ?main() - bb1 >>> +; CHECK: ?9. ?4.41% ? ?12/272 ? ?main() - bb7 >>> +; CHECK: 10. ?2.21% ? ? 6/272 ? ?main() - bb4 >>> +; CHECK: 11. ?1.84% ? ? 5/272 ? ?main() - entry >>> +; CHECK: 12. ?1.84% ? ? 5/272 ? ?main() - bb11 >>> +; CHECK: 13. ?1.84% ? ? 5/272 ? ?main() - return >>> +; CHECK: 14. ? 1.1% ? ? 3/272 ? ?main() - bb8 >>> +; ModuleID = '' >>> +target datalayout = >>> "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" >>> >>> +target triple = "x86_64-unknown-linux-gnu" >>> + >>> + at .str = private constant [6 x i8] c"franz\00", align 1 ; <[6 x i8]*> >>> [#uses=1] >>> + at .str1 = private constant [9 x i8] c"argc > 2\00", align 1 ; <[9 x >>> i8]*> [#uses=1] >>> + at .str2 = private constant [9 x i8] c"argc = 1\00", align 1 ; <[9 x >>> i8]*> [#uses=1] >>> + at .str3 = private constant [6 x i8] c"fritz\00", align 1 ; <[6 x i8]*> >>> [#uses=1] >>> + at .str4 = private constant [10 x i8] c"argc <= 1\00", align 1 ; <[10 x >>> i8]*> [#uses=1] >>> + >>> +; CHECK:;;; %main called 5 times. >>> +; CHECK:;;; >>> +define i32 @main(i32 %argc, i8** %argv) nounwind { >>> +entry: >>> +; CHECK:entry: >>> +; CHECK: ? ?;;; Basic block executed 5 times. >>> + ?%argc_addr = alloca i32 ? ? ? ? ? ? ? ? ? ? ? ? ; [#uses=4] >>> + ?%argv_addr = alloca i8** ? ? ? ? ? ? ? ? ? ? ? ?; [#uses=1] >>> + ?%retval = alloca i32 ? ? ? ? ? ? ? ? ? ? ? ? ? ?; [#uses=2] >>> + ?%j = alloca i32 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; [#uses=4] >>> + ?%i = alloca i32 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; [#uses=4] >>> + ?%0 = alloca i32 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; [#uses=2] >>> + ?%"alloca point" = bitcast i32 0 to i32 ? ? ? ? ?; [#uses=0] >>> + ?store i32 %argc, i32* %argc_addr >>> + ?store i8** %argv, i8*** %argv_addr >>> + ?store i32 0, i32* %i, align 4 >>> + ?br label %bb10 >>> +; CHECK: ? ?;;; Out-edge counts: [5.000000e+00 -> bb10] >>> + >>> +bb: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %bb10 >>> +; CHECK:bb: >>> +; CHECK: ? ?;;; Basic block executed 15 times. >>> + ?%1 = load i32* %argc_addr, align 4 ? ? ? ? ? ? ?; [#uses=1] >>> + ?%2 = icmp sgt i32 %1, 1 ? ? ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?br i1 %2, label %bb1, label %bb8 >>> +; CHECK: ? ?;;; Out-edge counts: [1.200000e+01 -> bb1] [3.000000e+00 >>> -> bb8] >>> + >>> +bb1: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb >>> +; CHECK:bb1: >>> +; CHECK: ? ?;;; Basic block executed 12 times. >>> + ?store i32 0, i32* %j, align 4 >>> + ?br label %bb6 >>> +; CHECK: ? ?;;; Out-edge counts: [1.200000e+01 -> bb6] >>> + >>> +bb2: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb6 >>> +; CHECK:bb2: >>> +; CHECK: ? ?;;; Basic block executed 42 times. >>> + ?%3 = call i32 @puts(i8* getelementptr ([6 x i8]* @.str, i64 0, i64 >>> 0)) nounwind ; [#uses=0] >>> + ?%4 = load i32* %argc_addr, align 4 ? ? ? ? ? ? ?; [#uses=1] >>> + ?%5 = icmp sgt i32 %4, 2 ? ? ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?br i1 %5, label %bb3, label %bb4 >>> +; CHECK: ? ?;;; Out-edge counts: [3.600000e+01 -> bb3] [6.000000e+00 >>> -> bb4] >>> + >>> +bb3: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb2 >>> +; CHECK:bb3: >>> +; CHECK: ? ?;;; Basic block executed 36 times. >>> + ?%6 = call i32 @puts(i8* getelementptr ([9 x i8]* @.str1, i64 0, i64 >>> 0)) nounwind ; [#uses=0] >>> + ?br label %bb5 >>> +; CHECK: ? ?;;; Out-edge counts: [3.600000e+01 -> bb5] >>> + >>> +bb4: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb2 >>> +; CHECK:bb4: >>> +; CHECK: ? ?;;; Basic block executed 6 times. >>> + ?%7 = call i32 @puts(i8* getelementptr ([9 x i8]* @.str2, i64 0, i64 >>> 0)) nounwind ; [#uses=0] >>> + ?br label %bb5 >>> +; CHECK: ? ?;;; Out-edge counts: [6.000000e+00 -> bb5] >>> + >>> +bb5: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb4, %bb3 >>> +; CHECK:bb5: >>> +; CHECK: ? ?;;; Basic block executed 42 times. >>> + ?%8 = call i32 @puts(i8* getelementptr ([6 x i8]* @.str3, i64 0, i64 >>> 0)) nounwind ; [#uses=0] >>> + ?%9 = load i32* %j, align 4 ? ? ? ? ? ? ? ? ? ? ?; [#uses=1] >>> + ?%10 = add i32 %9, 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?store i32 %10, i32* %j, align 4 >>> + ?br label %bb6 >>> +; CHECK: ? ?;;; Out-edge counts: [4.200000e+01 -> bb6] >>> + >>> +bb6: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb5, %bb1 >>> +; CHECK:bb6: >>> +; CHECK: ? ?;;; Basic block executed 54 times. >>> + ?%11 = load i32* %j, align 4 ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?%12 = load i32* %argc_addr, align 4 ? ? ? ? ? ? ; [#uses=1] >>> + ?%13 = icmp slt i32 %11, %12 ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?br i1 %13, label %bb2, label %bb7 >>> +; CHECK: ? ?;;; Out-edge counts: [4.200000e+01 -> bb2] [1.200000e+01 >>> -> bb7] >>> + >>> +bb7: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb6 >>> +; CHECK:bb7: >>> +; CHECK: ? ?;;; Basic block executed 12 times. >>> + ?br label %bb9 >>> +; CHECK: ? ?;;; Out-edge counts: [1.200000e+01 -> bb9] >>> + >>> +bb8: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb >>> +; CHECK:bb8: >>> +; CHECK: ? ?;;; Basic block executed 3 times. >>> + ?%14 = call i32 @puts(i8* getelementptr ([10 x i8]* @.str4, i64 0, >>> i64 0)) nounwind ; [#uses=0] >>> + ?br label %bb9 >>> +; CHECK: ? ?;;; Out-edge counts: [3.000000e+00 -> bb9] >>> + >>> +bb9: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %bb8, %bb7 >>> +; CHECK:bb9: >>> +; CHECK: ? ?;;; Basic block executed 15 times. >>> + ?%15 = load i32* %i, align 4 ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?%16 = add i32 %15, 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ?; [#uses=1] >>> + ?store i32 %16, i32* %i, align 4 >>> + ?br label %bb10 >>> +; CHECK: ? ?;;; Out-edge counts: [1.500000e+01 -> bb10] >>> + >>> +bb10: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %bb9, %entry >>> +; CHECK: ? ?;;; Basic block executed 20 times. >>> + ?%17 = load i32* %i, align 4 ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?%18 = icmp ne i32 %17, 3 ? ? ? ? ? ? ? ? ? ? ? ?; [#uses=1] >>> + ?br i1 %18, label %bb, label %bb11 >>> +; CHECK: ? ?;;; Out-edge counts: [1.500000e+01 -> bb] [5.000000e+00 >>> -> bb11] >>> + >>> +bb11: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %bb10 >>> +; CHECK:bb11: >>> + ?store i32 0, i32* %0, align 4 >>> + ?%19 = load i32* %0, align 4 ? ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?store i32 %19, i32* %retval, align 4 >>> + ?br label %return >>> +; CHECK: ? ?;;; Out-edge counts: [5.000000e+00 -> return] >>> + >>> +return: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %bb11 >>> +; CHECK:return: >>> +; CHECK: ? ?;;; Basic block executed 5 times. >>> + ?%retval12 = load i32* %retval ? ? ? ? ? ? ? ? ? ; [#uses=1] >>> + ?ret i32 %retval12 >>> +} >>> + >>> +declare i32 @puts(i8*) >>> >>> Added: llvm/trunk/test/Analysis/Profiling/dg.exp >>> URL: >>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Profiling/dg.exp?rev=79615&view=auto >>> >>> >>> ============================================================================== >>> >>> --- llvm/trunk/test/Analysis/Profiling/dg.exp (added) >>> +++ llvm/trunk/test/Analysis/Profiling/dg.exp Fri Aug 21 04:36:28 2009 >>> @@ -0,0 +1,4 @@ >>> +load_lib llvm.exp >>> + >>> +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] >>> + >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > - -- > ========================================================================== > This email is signed, for more information see > http://web.student.tuwien.ac.at/~e0325716/gpg.html > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkqOvUMACgkQPiYq0rq7s/BZQwCeLtuLKTvasLikz4nMSPFCF4a2 > rjAAnArEGG2igvcSlsi2YiifI4ibWbVD > =Ui/1 > -----END PGP SIGNATURE----- > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From bob.wilson at apple.com Mon Aug 24 15:01:15 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 24 Aug 2009 20:01:15 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r79932 - /llvm-gcc-4.2/trunk/build_gcc Message-ID: <200908242001.n7OK1Fem002062@zion.cs.uiuc.edu> Author: bwilson Date: Mon Aug 24 15:01:15 2009 New Revision: 79932 URL: http://llvm.org/viewvc/llvm-project?rev=79932&view=rev Log: Attempt to temporarily work around a problem with Apple-style builds. This pales in comparison to the horribleness than Evan inflicted on build_gcc, but still.... Modified: llvm-gcc-4.2/trunk/build_gcc Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=79932&r1=79931&r2=79932&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Mon Aug 24 15:01:15 2009 @@ -170,7 +170,7 @@ exit 1 fi if [ "x$RC_ProjectName" = "xllvmgcc42_Embedded" ]; then - ARM_MULTILIB_ARCHS=${ARCH_OPTIONS} + ARM_MULTILIB_ARCHS="armv6 armv7" elif [ "x$ARM_MULTILIB_ARCHS" = "x" ] ; then ARM_MULTILIB_ARCHS=`/usr/bin/lipo -info $ARM_SYSROOT/usr/lib/libSystem.dylib | cut -d':' -f 3 | sed -e 's/x86_64//' -e 's/i386//' -e 's/ppc7400//' -e 's/ppc64//' -e 's/^ *//' -e 's/ $//'` fi; From daniel at zuster.org Mon Aug 24 15:08:27 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 20:08:27 -0000 Subject: [llvm-commits] [llvm] r79933 - in /llvm/trunk/test/CodeGen/PowerPC: Frames-alloca.ll Frames-large.ll Message-ID: <200908242008.n7OK8Rbj003047@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Aug 24 15:08:27 2009 New Revision: 79933 URL: http://llvm.org/viewvc/llvm-project?rev=79933&view=rev Log: Convert two gratuitous abuses of poor helpless CPU cycles to FileCheck. Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-alloca.ll llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-alloca.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/Frames-alloca.ll?rev=79933&r1=79932&r2=79933&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/Frames-alloca.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/Frames-alloca.ll Mon Aug 24 15:08:27 2009 @@ -1,35 +1,28 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {stw r31, 20(r1)} -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -enable-ppc32-regscavenger | \ -; RUN: grep {stwu r1, -80(r1)} -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {lwz r1, 0(r1)} -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {lwz r31, 20(r1)} -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {stw r31, 20(r1)} -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim -enable-ppc32-regscavenger | \ -; RUN: grep {stwu r1, -80(r1)} -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {lwz r1, 0(r1)} -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {lwz r31, 20(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {std r31, 40(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {stdu r1, -112(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {ld r1, 0(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {ld r31, 40(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {std r31, 40(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {stdu r1, -112(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {ld r1, 0(r1)} -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {ld r31, 40(r1)} +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | FileCheck %s -check-prefix=PPC32 +; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | FileCheck %s -check-prefix=PPC64 +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | FileCheck %s -check-prefix=PPC32-NOFP +; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | FileCheck %s -check-prefix=PPC64-NOFP +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -enable-ppc32-regscavenger | FileCheck %s -check-prefix=PPC32 +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -enable-ppc32-regscavenger | FileCheck %s -check-prefix=PPC32-RS +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim -enable-ppc32-regscavenger | FileCheck %s -check-prefix=PPC32-RS-NOFP + +; CHECK-PPC32: stw r31, 20(r1) +; CHECK-PPC32: lwz r1, 0(r1) +; CHECK-PPC32: lwz r31, 20(r1) +; CHECK-PPC32-NOFP: stw r31, 20(r1) +; CHECK-PPC32-NOFP: lwz r1, 0(r1) +; CHECK-PPC32-NOFP: lwz r31, 20(r1) +; CHECK-PPC32-RS: stwu r1, -80(r1) +; CHECK-PPC32-RS-NOFP: stwu r1, -80(r1) + +; CHECK-PPC64: std r31, 40(r1) +; CHECK-PPC64: stdu r1, -112(r1) +; CHECK-PPC64: ld r1, 0(r1) +; CHECK-PPC64: ld r31, 40(r1) +; CHECK-PPC64-NOFP: std r31, 40(r1) +; CHECK-PPC64-NOFP: stdu r1, -112(r1) +; CHECK-PPC64-NOFP: ld r1, 0(r1) +; CHECK-PPC64-NOFP: ld r31, 40(r1) define i32* @f1(i32 %n) { %tmp = alloca i32, i32 %n ; [#uses=1] Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll?rev=79933&r1=79932&r2=79933&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Mon Aug 24 15:08:27 2009 @@ -1,74 +1,31 @@ -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: not grep {stw r31, 20(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep {lis r0, -1} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {ori r0, r0, 32704} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {stwux r1, r1, r0} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {lwz r1, 0(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ -; RUN: not grep {lwz r31, 20(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {stw r31, 20(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {lis r0, -1} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {ori r0, r0, 32704} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {stwux r1, r1, r0} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {lwz r1, 0(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {lwz r31, 20(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: not grep {std r31, 40(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {lis r0, -1} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {ori r0, r0, 32656} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {stdux r1, r1, r0} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: grep {ld r1, 0(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \ -; RUN: not grep {ld r31, 40(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {std r31, 40(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {lis r0, -1} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {ori r0, r0, 32656} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {stdux r1, r1, r0} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {ld r1, 0(r1)} -; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \ -; RUN: grep {ld r31, 40(r1)} +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 > %t +; RUN: not grep {stw r31, 20(r1)} %t +; RUN: grep {lis r0, -1} %t +; RUN: grep {ori r0, r0, 32704} %t +; RUN: grep {stwux r1, r1, r0} %t +; RUN: grep {lwz r1, 0(r1)} %t +; RUN: not grep {lwz r31, 20(r1)} %t +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim > %t +; RUN: grep {stw r31, 20(r1)} %t +; RUN: grep {lis r0, -1} %t +; RUN: grep {ori r0, r0, 32704} %t +; RUN: grep {stwux r1, r1, r0} %t +; RUN: grep {lwz r1, 0(r1)} %t +; RUN: grep {lwz r31, 20(r1)} %t +; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 > %t +; RUN: not grep {std r31, 40(r1)} %t +; RUN: grep {lis r0, -1} %t +; RUN: grep {ori r0, r0, 32656} %t +; RUN: grep {stdux r1, r1, r0} %t +; RUN: grep {ld r1, 0(r1)} %t +; RUN: not grep {ld r31, 40(r1)} %t +; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim > %t +; RUN: grep {std r31, 40(r1)} %t +; RUN: grep {lis r0, -1} %t +; RUN: grep {ori r0, r0, 32656} %t +; RUN: grep {stdux r1, r1, r0} %t +; RUN: grep {ld r1, 0(r1)} %t +; RUN: grep {ld r31, 40(r1)} %t define i32* @f1() { %tmp = alloca i32, i32 8191 ; [#uses=1] From dalej at apple.com Mon Aug 24 15:28:12 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 24 Aug 2009 20:28:12 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r79934 - in /llvm-gcc-4.2/trunk/gcc: doc/invoke.texi llvm-backend.cpp opts.c tree.c tree.h Message-ID: <200908242028.n7OKSCJY005560@zion.cs.uiuc.edu> Author: johannes Date: Mon Aug 24 15:28:12 2009 New Revision: 79934 URL: http://llvm.org/viewvc/llvm-project?rev=79934&view=rev Log: Revert 79556; Chris wants there to be no user-level knob for inlining level. Document that the gcc options won't work. Modified: llvm-gcc-4.2/trunk/gcc/doc/invoke.texi llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp llvm-gcc-4.2/trunk/gcc/opts.c llvm-gcc-4.2/trunk/gcc/tree.c llvm-gcc-4.2/trunk/gcc/tree.h Modified: llvm-gcc-4.2/trunk/gcc/doc/invoke.texi URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/doc/invoke.texi?rev=79934&r1=79933&r2=79934&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/doc/invoke.texi (original) +++ llvm-gcc-4.2/trunk/gcc/doc/invoke.texi Mon Aug 24 15:28:12 2009 @@ -5402,6 +5402,12 @@ abstract measurement of function's size. In no way does it represent a count of assembly instructions and as such its exact meaning might change from one release to an another. + at c LLVM LOCAL begin +This option has no effect in llvm-gcc. The always_inline and noinline +parameters are honored, but none of the other inlining parameters have any +effect; there is no specific user control on the amount of inlining done. The +compiler will do less inlining at -O2 or -Os than at -O3. + at c LLVM LOCAL end @item -fkeep-inline-functions @opindex fkeep-inline-functions Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=79934&r1=79933&r2=79934&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Aug 24 15:28:12 2009 @@ -349,28 +349,13 @@ } // GuessAtInliningThreshold - Figure out a reasonable threshold to pass llvm's -// inliner. There are 12 user-settable gcc params that affect inlining. llvm -// (so far) only has one knob; the param that corresponds most closely, and -// which we use, is max-inline-insns-auto (set by -finline-limit, which is -// what most users actually use). This maps only very approximately to what -// llvm's inliner is doing, but it's the best we've got. +// inliner. gcc has many options that control inlining, but we have decided +// not to support anything like that for llvm-gcc. static unsigned GuessAtInliningThreshold() { unsigned threshold = 200; - // Get the default value for gcc's max-inline-insns-auto. This is the value - // after all language and target dependent changes to the global default are - // applied, but before parsing the command line. - unsigned default_miia = default_max_inline_insns_auto; - // See if the actual value is the same as the default. - unsigned miia = MAX_INLINE_INSNS_AUTO; - if (miia == default_miia) { - if (optimize_size || optimize < 3) - // Reduce inline limit. - threshold = 50; - } else { - // We have an overriding user-specified value. Multiply by 20/9, which is - // the Magic Number converting 90 to 200. - threshold = miia * 20 / 9; - } + if (optimize_size || optimize < 3) + // Reduce inline limit. + threshold = 50; return threshold; } Modified: llvm-gcc-4.2/trunk/gcc/opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/opts.c?rev=79934&r1=79933&r2=79934&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/opts.c (original) +++ llvm-gcc-4.2/trunk/gcc/opts.c Mon Aug 24 15:28:12 2009 @@ -682,12 +682,6 @@ OPTIMIZATION_OPTIONS (optimize, optimize_size); #endif - /* LLVM LOCAL begin hook up -finline-limit */ - /* Remember the value of MAX_INLINE_INSNS_AUTO after applying target-dependent - changes to the defaults, but before command line options are parsed. */ - default_max_inline_insns_auto = MAX_INLINE_INSNS_AUTO; - /* LLVM LOCAL end */ - /* APPLE LOCAL begin AV 3846092 */ /* We have apple local patch to disable -fstrict-aliasing when -O2 is used. However do not disable it when -ftree-vectorize is used. Clobber its value Modified: llvm-gcc-4.2/trunk/gcc/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=79934&r1=79933&r2=79934&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Aug 24 15:28:12 2009 @@ -73,13 +73,6 @@ tree generic_block_literal_struct_type; /* APPLE LOCAL end 6353006 */ -/* LLVM LOCAL begin */ -/* The value of MAX_INLINE_INSNS_AUTO after all target-dependent changes - are applied to the global default (which many targets do), but before - command line flags are handled. */ -unsigned default_max_inline_insns_auto; -/* LLVM LOCAL end */ - /* obstack.[ch] explicitly declined to prototype this. */ extern int _obstack_allocated_p (struct obstack *h, void *obj); Modified: llvm-gcc-4.2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=79934&r1=79933&r2=79934&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree.h Mon Aug 24 15:28:12 2009 @@ -4892,10 +4892,4 @@ /* APPLE LOCAL end radar 6300081 */ -/* LLVM LOCAL begin */ -/* The value of MAX_INLINE_INSNS_AUTO after all target-dependent changes - are applied to the global default (which many targets do), but before - command line flags are handled. */ -extern unsigned default_max_inline_insns_auto; -/* LLVM LOCAL end */ #endif /* GCC_TREE_H */ From bob.wilson at apple.com Mon Aug 24 15:33:47 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 24 Aug 2009 20:33:47 -0000 Subject: [llvm-commits] [llvm] r79935 - /llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll Message-ID: <200908242033.n7OKXlBE006270@zion.cs.uiuc.edu> Author: bwilson Date: Mon Aug 24 15:33:47 2009 New Revision: 79935 URL: http://llvm.org/viewvc/llvm-project?rev=79935&view=rev Log: Convert slow test to use FileCheck. Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll?rev=79935&r1=79934&r2=79935&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll Mon Aug 24 15:33:47 2009 @@ -1,127 +1,147 @@ -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #11206827 -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #2868947712 -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #2880154539 -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #251658240 -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #3948544 -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep movt -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #258 -; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep #4026531840 +; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | FileCheck %s ; Test # ; var 2.1 - 0x00ab00ab define i32 @t2_const_var2_1_ok_1(i32 %lhs) { +;CHECK: t2_const_var_1_ok_1: +;CHECK: #11206827 %ret = add i32 %lhs, 11206827 ; 0x00ab00ab ret i32 %ret } define i32 @t2_const_var2_1_fail_1(i32 %lhs) { +;CHECK: t2_const_var2_1_fail_1: +;CHECK: movt %ret = add i32 %lhs, 11206843 ; 0x00ab00bb ret i32 %ret } define i32 @t2_const_var2_1_fail_2(i32 %lhs) { +;CHECK: t2_const_var2_1_fail_2: +;CHECK: movt %ret = add i32 %lhs, 27984043 ; 0x01ab00ab ret i32 %ret } define i32 @t2_const_var2_1_fail_3(i32 %lhs) { +;CHECK: t2_const_var2_1_fail_3: +;CHECK: movt %ret = add i32 %lhs, 27984299 ; 0x01ab01ab ret i32 %ret } define i32 @t2_const_var2_1_fail_4(i32 %lhs) { +;CHECK: t2_const_var2_1_fail_4: +;CHECK: movt %ret = add i32 %lhs, 28027649 ; 0x01abab01 ret i32 %ret } ; var 2.2 - 0xab00ab00 define i32 @t2_const_var2_2_ok_1(i32 %lhs) { +;CHECK: t2_const_var2_2_ok_1: +;CHECK: #2868947712 %ret = add i32 %lhs, 2868947712 ; 0xab00ab00 ret i32 %ret } define i32 @t2_const_var2_2_fail_1(i32 %lhs) { +;CHECK: t2_const_var2_2_fail_1: +;CHECK: movt %ret = add i32 %lhs, 2868951552 ; 0xab00ba00 ret i32 %ret } define i32 @t2_const_var2_2_fail_2(i32 %lhs) { +;CHECK: t2_const_var2_2_fail_2: +;CHECK: movt %ret = add i32 %lhs, 2868947728 ; 0xab00ab10 ret i32 %ret } define i32 @t2_const_var2_2_fail_3(i32 %lhs) { +;CHECK: t2_const_var2_2_fail_3: +;CHECK: movt %ret = add i32 %lhs, 2869996304 ; 0xab10ab10 ret i32 %ret } define i32 @t2_const_var2_2_fail_4(i32 %lhs) { +;CHECK: t2_const_var2_2_fail_4: +;CHECK: movt %ret = add i32 %lhs, 279685904 ; 0x10abab10 ret i32 %ret } ; var 2.3 - 0xabababab define i32 @t2_const_var2_3_ok_1(i32 %lhs) { +;CHECK: t2_const_var2_3_ok_1: +;CHECK: #2880154539 %ret = add i32 %lhs, 2880154539 ; 0xabababab ret i32 %ret } define i32 @t2_const_var2_3_fail_1(i32 %lhs) { +;CHECK: t2_const_var2_3_fail_1: +;CHECK: movt %ret = add i32 %lhs, 2880154554 ; 0xabababba ret i32 %ret } define i32 @t2_const_var2_3_fail_2(i32 %lhs) { +;CHECK: t2_const_var2_3_fail_2: +;CHECK: movt %ret = add i32 %lhs, 2880158379 ; 0xababbaab ret i32 %ret } define i32 @t2_const_var2_3_fail_3(i32 %lhs) { +;CHECK: t2_const_var2_3_fail_3: +;CHECK: movt %ret = add i32 %lhs, 2881137579 ; 0xabbaabab ret i32 %ret } define i32 @t2_const_var2_3_fail_4(i32 %lhs) { +;CHECK: t2_const_var2_3_fail_4: +;CHECK: movt %ret = add i32 %lhs, 3131812779 ; 0xbaababab ret i32 %ret } ; var 3 - 0x0F000000 define i32 @t2_const_var3_1_ok_1(i32 %lhs) { +;CHECK: t2_const_var3_1_ok_1: +;CHECK: #251658240 %ret = add i32 %lhs, 251658240 ; 0x0F000000 ret i32 %ret } define i32 @t2_const_var3_2_ok_1(i32 %lhs) { +;CHECK: t2_const_var3_2_ok_1: +;CHECK: #3948544 %ret = add i32 %lhs, 3948544 ; 0b00000000001111000100000000000000 ret i32 %ret } define i32 @t2_const_var3_2_fail_1(i32 %lhs) { +;CHECK: t2_const_var3_2_fail_1: +;CHECK: movt %ret = add i32 %lhs, 3940352 ; 0b00000000001111000010000000000000 ret i32 %ret } define i32 @t2_const_var3_3_ok_1(i32 %lhs) { +;CHECK: t2_const_var3_3_ok_1: +;CHECK: #258 %ret = add i32 %lhs, 258 ; 0b00000000000000000000000100000010 ret i32 %ret } define i32 @t2_const_var3_4_ok_1(i32 %lhs) { +;CHECK: t2_const_var3_4_ok_1: +;CHECK: #4026531840 %ret = add i32 %lhs, 4026531840 ; 0xF0000000 ret i32 %ret } - From ofv at wanadoo.es Mon Aug 24 15:41:04 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Mon, 24 Aug 2009 22:41:04 +0200 Subject: [llvm-commits] [llvm] r79732 - /llvm/trunk/cmake/modules/TableGen.cmake In-Reply-To: <733304B8-2E7B-41DC-A9E8-B1038991A3E9@apple.com> (Douglas Gregor's message of "Mon, 24 Aug 2009 10:40:13 -0700") References: <200908220700.n7M70L8D011322@zion.cs.uiuc.edu> <87eir1qgat.fsf@telefonica.net> <733304B8-2E7B-41DC-A9E8-B1038991A3E9@apple.com> Message-ID: <878wh9q71b.fsf@telefonica.net> Douglas Gregor writes: > On Aug 24, 2009, at 10:20 AM, ?scar Fuentes wrote: > >>> CMake: Don't use copy_if_different for TableGen output, because it >>> does not work with IDE targets >> >> What means "does not work"? >> >> Which IDEs have this problem? > > > Both Xcode and Visual C++ have different problems. [snip] Thanks for the info, Doug. Yes, I've seen how VC++ rebuilds the .inc files too often (with nmake, I do not use the IDE), and IIRC MinGW is even worse: sometimes Intrinsics.td is rebuilt for no reason, which triggers the rebuild of all llvm targets and tools. Hope your change fixes this. -- ?scar From ggreif at gmail.com Mon Aug 24 16:00:10 2009 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 24 Aug 2009 21:00:10 -0000 Subject: [llvm-commits] [llvm] r79936 - in /llvm/trunk/tools/llvmc/plugins: Base/ Clang/ Message-ID: <200908242100.n7OL0Bq7009524@zion.cs.uiuc.edu> Author: ggreif Date: Mon Aug 24 16:00:10 2009 New Revision: 79936 URL: http://llvm.org/viewvc/llvm-project?rev=79936&view=rev Log: prune ignores: AutoGenerated.inc is no more Modified: llvm/trunk/tools/llvmc/plugins/Base/ (props changed) llvm/trunk/tools/llvmc/plugins/Clang/ (props changed) Propchange: llvm/trunk/tools/llvmc/plugins/Base/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Aug 24 16:00:10 2009 @@ -1,4 +1,3 @@ -AutoGenerated.inc Debug Release Release-Asserts Propchange: llvm/trunk/tools/llvmc/plugins/Clang/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Aug 24 16:00:10 2009 @@ -1,4 +1,3 @@ -AutoGenerated.inc Debug Release Release-Asserts From bob.wilson at apple.com Mon Aug 24 16:17:17 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 24 Aug 2009 21:17:17 -0000 Subject: [llvm-commits] [llvm] r79937 - /llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll Message-ID: <200908242117.n7OLHHTD011930@zion.cs.uiuc.edu> Author: bwilson Date: Mon Aug 24 16:17:17 2009 New Revision: 79937 URL: http://llvm.org/viewvc/llvm-project?rev=79937&view=rev Log: Fix a typo. Somehow I thought this had passed before, but I guess not. Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll?rev=79937&r1=79936&r2=79937&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-mov.ll Mon Aug 24 16:17:17 2009 @@ -4,7 +4,7 @@ ; var 2.1 - 0x00ab00ab define i32 @t2_const_var2_1_ok_1(i32 %lhs) { -;CHECK: t2_const_var_1_ok_1: +;CHECK: t2_const_var2_1_ok_1: ;CHECK: #11206827 %ret = add i32 %lhs, 11206827 ; 0x00ab00ab ret i32 %ret From clattner at apple.com Mon Aug 24 16:19:01 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 24 Aug 2009 14:19:01 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r79934 - in /llvm-gcc-4.2/trunk/gcc: doc/invoke.texi llvm-backend.cpp opts.c tree.c tree.h In-Reply-To: <200908242028.n7OKSCJY005560@zion.cs.uiuc.edu> References: <200908242028.n7OKSCJY005560@zion.cs.uiuc.edu> Message-ID: <2B6B4911-214B-4195-82B7-889E629B256D@apple.com> On Aug 24, 2009, at 1:28 PM, Dale Johannesen wrote: > Author: johannes > Date: Mon Aug 24 15:28:12 2009 > New Revision: 79934 > > URL: http://llvm.org/viewvc/llvm-project?rev=79934&view=rev > Log: > Revert 79556; Chris wants there to be no user-level > knob for inlining level. Document that the gcc > options won't work. Thank you Dale, I appreciate it, -Chris > > > Modified: > llvm-gcc-4.2/trunk/gcc/doc/invoke.texi > llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp > llvm-gcc-4.2/trunk/gcc/opts.c > llvm-gcc-4.2/trunk/gcc/tree.c > llvm-gcc-4.2/trunk/gcc/tree.h > > Modified: llvm-gcc-4.2/trunk/gcc/doc/invoke.texi > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/doc/invoke.texi?rev=79934&r1=79933&r2=79934&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/doc/invoke.texi (original) > +++ llvm-gcc-4.2/trunk/gcc/doc/invoke.texi Mon Aug 24 15:28:12 2009 > @@ -5402,6 +5402,12 @@ > abstract measurement of function's size. In no way does it > represent a count > of assembly instructions and as such its exact meaning might change > from one > release to an another. > + at c LLVM LOCAL begin > +This option has no effect in llvm-gcc. The always_inline and > noinline > +parameters are honored, but none of the other inlining parameters > have any > +effect; there is no specific user control on the amount of inlining > done. The > +compiler will do less inlining at -O2 or -Os than at -O3. > + at c LLVM LOCAL end > > @item -fkeep-inline-functions > @opindex fkeep-inline-functions > > Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=79934&r1=79933&r2=79934&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Aug 24 15:28:12 2009 > @@ -349,28 +349,13 @@ > } > > // GuessAtInliningThreshold - Figure out a reasonable threshold to > pass llvm's > -// inliner. There are 12 user-settable gcc params that affect > inlining. llvm > -// (so far) only has one knob; the param that corresponds most > closely, and > -// which we use, is max-inline-insns-auto (set by -finline-limit, > which is > -// what most users actually use). This maps only very > approximately to what > -// llvm's inliner is doing, but it's the best we've got. > +// inliner. gcc has many options that control inlining, but we > have decided > +// not to support anything like that for llvm-gcc. > static unsigned GuessAtInliningThreshold() { > unsigned threshold = 200; > - // Get the default value for gcc's max-inline-insns-auto. This > is the value > - // after all language and target dependent changes to the global > default are > - // applied, but before parsing the command line. > - unsigned default_miia = default_max_inline_insns_auto; > - // See if the actual value is the same as the default. > - unsigned miia = MAX_INLINE_INSNS_AUTO; > - if (miia == default_miia) { > - if (optimize_size || optimize < 3) > - // Reduce inline limit. > - threshold = 50; > - } else { > - // We have an overriding user-specified value. Multiply by > 20/9, which is > - // the Magic Number converting 90 to 200. > - threshold = miia * 20 / 9; > - } > + if (optimize_size || optimize < 3) > + // Reduce inline limit. > + threshold = 50; > return threshold; > } > > > Modified: llvm-gcc-4.2/trunk/gcc/opts.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/opts.c?rev=79934&r1=79933&r2=79934&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/opts.c (original) > +++ llvm-gcc-4.2/trunk/gcc/opts.c Mon Aug 24 15:28:12 2009 > @@ -682,12 +682,6 @@ > OPTIMIZATION_OPTIONS (optimize, optimize_size); > #endif > > - /* LLVM LOCAL begin hook up -finline-limit */ > - /* Remember the value of MAX_INLINE_INSNS_AUTO after applying > target-dependent > - changes to the defaults, but before command line options are > parsed. */ > - default_max_inline_insns_auto = MAX_INLINE_INSNS_AUTO; > - /* LLVM LOCAL end */ > - > /* APPLE LOCAL begin AV 3846092 */ > /* We have apple local patch to disable -fstrict-aliasing when -O2 > is used. > However do not disable it when -ftree-vectorize is used. > Clobber its value > > Modified: llvm-gcc-4.2/trunk/gcc/tree.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=79934&r1=79933&r2=79934&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/tree.c (original) > +++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Aug 24 15:28:12 2009 > @@ -73,13 +73,6 @@ > tree generic_block_literal_struct_type; > /* APPLE LOCAL end 6353006 */ > > -/* LLVM LOCAL begin */ > -/* The value of MAX_INLINE_INSNS_AUTO after all target-dependent > changes > - are applied to the global default (which many targets do), but > before > - command line flags are handled. */ > -unsigned default_max_inline_insns_auto; > -/* LLVM LOCAL end */ > - > /* obstack.[ch] explicitly declined to prototype this. */ > extern int _obstack_allocated_p (struct obstack *h, void *obj); > > > Modified: llvm-gcc-4.2/trunk/gcc/tree.h > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=79934&r1=79933&r2=79934&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/tree.h (original) > +++ llvm-gcc-4.2/trunk/gcc/tree.h Mon Aug 24 15:28:12 2009 > @@ -4892,10 +4892,4 @@ > > /* APPLE LOCAL end radar 6300081 */ > > -/* LLVM LOCAL begin */ > -/* The value of MAX_INLINE_INSNS_AUTO after all target-dependent > changes > - are applied to the global default (which many targets do), but > before > - command line flags are handled. */ > -extern unsigned default_max_inline_insns_auto; > -/* LLVM LOCAL end */ > #endif /* GCC_TREE_H */ > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ggreif at gmail.com Mon Aug 24 16:34:17 2009 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 24 Aug 2009 21:34:17 -0000 Subject: [llvm-commits] [llvm] r79938 - in /llvm/trunk/include/llvm: ADT/ilist.h ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h Message-ID: <200908242134.n7OLYIof014072@zion.cs.uiuc.edu> Author: ggreif Date: Mon Aug 24 16:34:17 2009 New Revision: 79938 URL: http://llvm.org/viewvc/llvm-project?rev=79938&view=rev Log: Resubmit an earlier patch of mine: reduce the size of relevant "ghostly" sentinels by a pointer. This attempt now makes the compactification dependent on the configure variable LLVM_COMPACT_SENTINELS and should not cause any bootstrap failures for llvm-gcc any more. Please note that this is not yet the final version, and (as settled with Chris) I shall take out the autofoo/cmake portions in the next days. This will also lose the assertability on sentinel dereferencing and operator++, but that seems an acceptable price to pay for the simplified build logic. Modified: llvm/trunk/include/llvm/ADT/ilist.h llvm/trunk/include/llvm/ADT/ilist_node.h llvm/trunk/include/llvm/BasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/Function.h Modified: llvm/trunk/include/llvm/ADT/ilist.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=79938&r1=79937&r2=79938&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist.h (original) +++ llvm/trunk/include/llvm/ADT/ilist.h Mon Aug 24 16:34:17 2009 @@ -39,8 +39,15 @@ #define LLVM_ADT_ILIST_H #include "llvm/ADT/iterator.h" +#include "llvm/Config/config.h" #include +#if defined(LLVM_COMPACT_SENTINELS) && LLVM_COMPACT_SENTINELS +# define sentinel_tail_assert(COND) +#else +# define sentinel_tail_assert(COND) assert(COND) +#endif + namespace llvm { template class iplist; @@ -189,12 +196,12 @@ // Accessors... operator pointer() const { - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return NodePtr; } reference operator*() const { - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return *NodePtr; } pointer operator->() const { return &operator*(); } @@ -215,7 +222,7 @@ } ilist_iterator &operator++() { // preincrement - Advance NodePtr = Traits::getNext(NodePtr); - assert(NodePtr && "++'d off the end of an ilist!"); + sentinel_tail_assert(NodePtr && "++'d off the end of an ilist!"); return *this; } ilist_iterator operator--(int) { // postdecrement operators... Modified: llvm/trunk/include/llvm/ADT/ilist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=79938&r1=79937&r2=79938&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) +++ llvm/trunk/include/llvm/ADT/ilist_node.h Mon Aug 24 16:34:17 2009 @@ -15,33 +15,56 @@ #ifndef LLVM_ADT_ILIST_NODE_H #define LLVM_ADT_ILIST_NODE_H +#include "llvm/Config/config.h" + namespace llvm { template -struct ilist_nextprev_traits; +struct ilist_traits; +/// ilist_half_node - Base class that provides prev services for sentinels. +/// template -struct ilist_traits; +class ilist_half_node { + friend struct ilist_traits; + NodeTy *Prev; +protected: + NodeTy *getPrev() { return Prev; } + const NodeTy *getPrev() const { return Prev; } + void setPrev(NodeTy *P) { Prev = P; } + ilist_half_node() : Prev(0) {} +}; + +template +struct ilist_nextprev_traits; /// ilist_node - Base class that provides next/prev services for nodes /// that use ilist_nextprev_traits or ilist_default_traits. /// template -class ilist_node { -private: +class ilist_node : ilist_half_node { friend struct ilist_nextprev_traits; friend struct ilist_traits; - NodeTy *Prev, *Next; - NodeTy *getPrev() { return Prev; } + NodeTy *Next; NodeTy *getNext() { return Next; } - const NodeTy *getPrev() const { return Prev; } const NodeTy *getNext() const { return Next; } - void setPrev(NodeTy *N) { Prev = N; } void setNext(NodeTy *N) { Next = N; } protected: - ilist_node() : Prev(0), Next(0) {} + ilist_node() : Next(0) {} }; +/// When assertions are off, the Next field of sentinels +/// will not be accessed. So it is not necessary to allocate +/// space for it. The following macro selects the most +/// efficient traits class. The LLVM_COMPACT_SENTINELS +/// configuration variable controls this. +/// +#if defined(LLVM_COMPACT_SENTINELS) && LLVM_COMPACT_SENTINELS +# define ILIST_NODE ilist_half_node +#else +# define ILIST_NODE ilist_node +#endif + } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=79938&r1=79937&r2=79938&view=diff ============================================================================== --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Mon Aug 24 16:34:17 2009 @@ -47,7 +47,7 @@ Instruction *ensureHead(Instruction*) const { return createSentinel(); } static void noteHead(Instruction*, Instruction*) {} private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; /// This represents a single basic block in LLVM. A basic block is simply a Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=79938&r1=79937&r2=79938&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Mon Aug 24 16:34:17 2009 @@ -26,7 +26,7 @@ template <> struct ilist_traits : public ilist_default_traits { private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; // this is only set by the MachineBasicBlock owning the LiveList friend class MachineBasicBlock; Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=79938&r1=79937&r2=79938&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Mon Aug 24 16:34:17 2009 @@ -38,7 +38,7 @@ template <> struct ilist_traits : public ilist_default_traits { - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; public: MachineBasicBlock *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=79938&r1=79937&r2=79938&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Aug 24 16:34:17 2009 @@ -37,7 +37,7 @@ template<> struct ilist_traits : public ilist_default_traits { private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; public: SDNode *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=79938&r1=79937&r2=79938&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Mon Aug 24 16:34:17 2009 @@ -45,7 +45,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; template<> struct ilist_traits @@ -62,7 +62,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; class Function : public GlobalValue, From astifter at gmx.at Mon Aug 24 16:37:49 2009 From: astifter at gmx.at (Andreas Neustifter) Date: Mon, 24 Aug 2009 21:37:49 -0000 Subject: [llvm-commits] [llvm] r79940 - in /llvm/trunk: include/llvm/Analysis/ProfileInfo.h lib/Analysis/ProfileInfo.cpp Message-ID: <200908242137.n7OLbndA014515@zion.cs.uiuc.edu> Author: astifter Date: Mon Aug 24 16:37:48 2009 New Revision: 79940 URL: http://llvm.org/viewvc/llvm-project?rev=79940&view=rev Log: This patch cleans up the ProfileInfo by *) introducing new data type and export function of edge info for whole function (preparation for next patch). *) renaming variables to make clear distinction between data and containers that contain this data. *) updated comments and whitespaces. *) made ProfileInfo::MissingValue a double (as it should be...). (Discussed at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084955.html.) Modified: llvm/trunk/include/llvm/Analysis/ProfileInfo.h llvm/trunk/lib/Analysis/ProfileInfo.cpp Modified: llvm/trunk/include/llvm/Analysis/ProfileInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ProfileInfo.h?rev=79940&r1=79939&r2=79940&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ProfileInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/ProfileInfo.h Mon Aug 24 16:37:48 2009 @@ -36,20 +36,21 @@ public: // Types for handling profiling information. typedef std::pair Edge; - typedef std::map EdgeCounts; + typedef std::pair EdgeWeight; + typedef std::map EdgeWeights; typedef std::map BlockCounts; protected: - // EdgeCounts - Count the number of times a transition between two blocks is - // executed. As a special case, we also hold an edge from the null - // BasicBlock to the entry block to indicate how many times the function was - // entered. - std::map EdgeInformation; + // EdgeInformation - Count the number of times a transition between two + // blocks is executed. As a special case, we also hold an edge from the + // null BasicBlock to the entry block to indicate how many times the + // function was entered. + std::map EdgeInformation; - // BlockCounts - Count the number of times a block is executed. + // BlockInformation - Count the number of times a block is executed. std::map BlockInformation; - // FunctionCounts - Count the number of times a function is executed. + // FunctionInformation - Count the number of times a function is executed. std::map FunctionInformation; public: static char ID; // Class identification, replacement for typeinfo @@ -57,7 +58,7 @@ // MissingValue - The value that is returned for execution counts in case // no value is available. - static const int MissingValue = -1; + static const double MissingValue; // getFunction() - Returns the Function for an Edge, checking for validity. static const Function* getFunction(Edge e) { @@ -66,7 +67,7 @@ } // getEdge() - Creates an Edge from two BasicBlocks. - static Edge getEdge(const BasicBlock* Src, const BasicBlock* Dest) { + static Edge getEdge(const BasicBlock *Src, const BasicBlock *Dest) { return std::make_pair(Src, Dest); } @@ -78,16 +79,20 @@ double getExecutionCount(const BasicBlock *BB); double getEdgeWeight(Edge e) const { - std::map::const_iterator J = + std::map::const_iterator J = EdgeInformation.find(getFunction(e)); if (J == EdgeInformation.end()) return MissingValue; - EdgeCounts::const_iterator I = J->second.find(e); + EdgeWeights::const_iterator I = J->second.find(e); if (I == J->second.end()) return MissingValue; return I->second; } + EdgeWeights &getEdgeWeights (const Function *F) { + return EdgeInformation[F]; + } + //===------------------------------------------------------------------===// /// Analysis Update Methods /// Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=79940&r1=79939&r2=79940&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Mon Aug 24 16:37:48 2009 @@ -26,6 +26,8 @@ ProfileInfo::~ProfileInfo() {} +const double ProfileInfo::MissingValue = -1; + double ProfileInfo::getExecutionCount(const BasicBlock *BB) { std::map::iterator J = BlockInformation.find(BB->getParent()); @@ -60,7 +62,7 @@ Count += w; } - BlockInformation[BB->getParent()][BB] = Count; + if (Count != MissingValue) BlockInformation[BB->getParent()][BB] = Count; return Count; } @@ -72,7 +74,7 @@ return J->second; double Count = getExecutionCount(&F->getEntryBlock()); - FunctionInformation[F] = Count; + if (Count != MissingValue) FunctionInformation[F] = Count; return Count; } From isanbard at gmail.com Mon Aug 24 16:40:39 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 24 Aug 2009 21:40:39 -0000 Subject: [llvm-commits] [llvm] r79942 - /llvm/tags/Apple/llvmCore-2303/ Message-ID: <200908242140.n7OLedYH014868@zion.cs.uiuc.edu> Author: void Date: Mon Aug 24 16:40:39 2009 New Revision: 79942 URL: http://llvm.org/viewvc/llvm-project?rev=79942&view=rev Log: Creating llvmCore-2303 from Leela. Added: llvm/tags/Apple/llvmCore-2303/ - copied from r79941, llvm/branches/Apple/Leela/ From isanbard at gmail.com Mon Aug 24 16:40:48 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 24 Aug 2009 21:40:48 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r79943 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2303/ Message-ID: <200908242140.n7OLemtF014896@zion.cs.uiuc.edu> Author: void Date: Mon Aug 24 16:40:47 2009 New Revision: 79943 URL: http://llvm.org/viewvc/llvm-project?rev=79943&view=rev Log: Creating llvmgcc42-2303 from Leela. Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2303/ - copied from r79942, llvm-gcc-4.2/branches/Apple/Leela/ From astifter at gmx.at Mon Aug 24 16:41:37 2009 From: astifter at gmx.at (Andreas Neustifter) Date: Mon, 24 Aug 2009 21:41:37 -0000 Subject: [llvm-commits] [llvm] r79944 - /llvm/trunk/runtime/libprofile/exported_symbols.lst Message-ID: <200908242141.n7OLfbrJ015007@zion.cs.uiuc.edu> Author: astifter Date: Mon Aug 24 16:41:37 2009 New Revision: 79944 URL: http://llvm.org/viewvc/llvm-project?rev=79944&view=rev Log: Add llvm_start_edge_profiling to exported symbols for libprofile_rt. Modified: llvm/trunk/runtime/libprofile/exported_symbols.lst Modified: llvm/trunk/runtime/libprofile/exported_symbols.lst URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/runtime/libprofile/exported_symbols.lst?rev=79944&r1=79943&r2=79944&view=diff ============================================================================== --- llvm/trunk/runtime/libprofile/exported_symbols.lst (original) +++ llvm/trunk/runtime/libprofile/exported_symbols.lst Mon Aug 24 16:41:37 2009 @@ -1,5 +1,6 @@ llvm_start_func_profiling llvm_start_block_profiling +llvm_start_edge_profiling llvm_start_basic_block_tracing llvm_trace_basic_block From e0325716 at student.tuwien.ac.at Mon Aug 24 16:48:16 2009 From: e0325716 at student.tuwien.ac.at (Andreas Neustifter) Date: Mon, 24 Aug 2009 23:48:16 +0200 Subject: [llvm-commits] [PATCH] Cleanup and Improve ProfileEstimator and MaximumSpanningTree In-Reply-To: <6a8523d60908240906q1e705593ufed5aa77b1209a9c@mail.gmail.com> References: <4A8C2A0B.4010103@student.tuwien.ac.at> <6a8523d60908240906q1e705593ufed5aa77b1209a9c@mail.gmail.com> Message-ID: <4A930AA0.9080108@student.tuwien.ac.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Daniel, Daniel Dunbar wrote: > Can you go ahead and apply the comment fixes parts of this (minus the > changes to stuff not in the tree, of course). Am I getting this right: just the comment changes but not the code changes? Andi (PS: Do you have time on commenting what you don't like about the code changes?) - -- ========================================================================== This email is signed, for more information see http://web.student.tuwien.ac.at/~e0325716/gpg.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqTCp8ACgkQPiYq0rq7s/CmrACbBNn1FDX0ytDb5D7ZSh6xjdVv /W8An1EQ7bReMjUgR+3Dt5EqEWk1CwJ+ =D0WE -----END PGP SIGNATURE----- From scottm at aero.org Mon Aug 24 16:53:27 2009 From: scottm at aero.org (Scott Michel) Date: Mon, 24 Aug 2009 21:53:27 -0000 Subject: [llvm-commits] [llvm] r79946 - /llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Message-ID: <200908242153.n7OLrR2u016507@zion.cs.uiuc.edu> Author: pingbak Date: Mon Aug 24 16:53:27 2009 New Revision: 79946 URL: http://llvm.org/viewvc/llvm-project?rev=79946&view=rev Log: Initialize ShufBytes, as gcc 4.4 can't detect that the entire array is initialized and a warning about a potentially unintialized variable is generated. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=79946&r1=79945&r2=79946&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Aug 24 16:53:27 2009 @@ -1963,7 +1963,9 @@ assert(prefslot_begin != -1 && prefslot_end != -1 && "LowerEXTRACT_VECTOR_ELT: preferred slots uninitialized"); - unsigned int ShufBytes[16]; + unsigned int ShufBytes[16] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; for (int i = 0; i < 16; ++i) { // zero fill uppper part of preferred slot, don't care about the // other slots: From e0325716 at student.tuwien.ac.at Mon Aug 24 17:12:31 2009 From: e0325716 at student.tuwien.ac.at (Andreas Neustifter) Date: Tue, 25 Aug 2009 00:12:31 +0200 Subject: [llvm-commits] [PATCH] Preparation for Optimal Edge Profiling: Add calculation of maximum spanning tree. In-Reply-To: <6a8523d60908240900n6e631092he03fc4830f66a9b8@mail.gmail.com> References: <4A8C23BA.5060800@student.tuwien.ac.at> <6a8523d60908240900n6e631092he03fc4830f66a9b8@mail.gmail.com> Message-ID: <4A93104F.7030209@student.tuwien.ac.at> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Daniel! Daniel Dunbar wrote: > > On Wed, Aug 19, 2009 at 9:09 AM, Andreas > Neustifter wrote: >> >> this is a preparation patch for Optimal Edge Profiling, it adds a module to >> calculate the maximum spanning tree of an function according to an given >> ProfileInformation. > > This class is specialized to ProfileInfo, so I don't think it should > go into the generic headers. Can it just live where the optimal edge > profiling implementation does, as private helper class? Yes, of course. As long as I'm not able to make this an generic class, but see below... > Also, MSTForest is just union find, right? Can it use > llvm/ADT/EquivalenceClasses.h instead? Yep, guess I can. Have to try it first, tough. > Similarly, MaximumSpanningTree should say 'Kruskal's algorithm' > somewhere. Also, would it make more sense to just implement MST, and > have clients use set_difference if they want the complement, instead > of the inverted flag? I would find this easier to read (I think). Will try that too. > It isn't necessary, but I think this code might be simpler and easier > to read if it was just a generic implementation of Kruskal's > algorithm, which the Optimal Edge Profiling could manage its own > instantiation of. Then it would make sense to drop it in ADT/ I am not sure if I manage to work this out but I will try. Thanks for the advice! Andi - -- ========================================================================== This email is signed, for more information see http://web.student.tuwien.ac.at/~e0325716/gpg.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqTEE4ACgkQPiYq0rq7s/Bx8wCffKGsccdcpD6ZWjYByFNJCPBn Mr8An1kQKaq0Aie9I4PQIsMz7vcXya0L =veBY -----END PGP SIGNATURE----- From scottm at aero.org Mon Aug 24 17:28:53 2009 From: scottm at aero.org (Scott Michel) Date: Mon, 24 Aug 2009 22:28:53 -0000 Subject: [llvm-commits] [llvm] r79949 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.h lib/Target/CellSPU/SPUNodes.td test/CodeGen/CellSPU/sext128.ll Message-ID: <200908242228.n7OMSrHE021064@zion.cs.uiuc.edu> Author: pingbak Date: Mon Aug 24 17:28:53 2009 New Revision: 79949 URL: http://llvm.org/viewvc/llvm-project?rev=79949&view=rev Log: 128-bit sign extension and vector shift cleanups, contributed by Ken Werner (IBM). Added: llvm/trunk/test/CodeGen/CellSPU/sext128.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h llvm/trunk/lib/Target/CellSPU/SPUNodes.td Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=79949&r1=79948&r2=79949&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Mon Aug 24 17:28:53 2009 @@ -322,6 +322,9 @@ /// target-specific node if it hasn't already been changed. SDNode *Select(SDValue Op); + //! Emit the instruction sequence for i128 sext + SDNode *SelectSEXTi128(SDValue &Op, EVT OpVT); + //! Emit the instruction sequence for i64 shl SDNode *SelectSHLi64(SDValue &Op, EVT OpVT); @@ -833,6 +836,10 @@ } } } + } else if (Opc == ISD::SIGN_EXTEND) { + if (OpVT == MVT::i128) { + return SelectSEXTi128(Op, OpVT); + } } else if (Opc == ISD::SHL) { if (OpVT == MVT::i64) { return SelectSHLi64(Op, OpVT); @@ -957,6 +964,58 @@ } /*! + * Emit the instruction sequence for i64 -> i128 sign extend. The basic + * algorithm is to duplicate the sign bit using rotmai to generate at + * least one byte full of sign bits. Then propagate the "sign-byte" into + * theleftmost words and the i64 into the rightmost words using shufb. + * + * @param Op The sext operand + * @param OpVT The type to extend to + * @return The SDNode with the entire instruction sequence + */ +SDNode * +SPUDAGToDAGISel::SelectSEXTi128(SDValue &Op, EVT OpVT) +{ + DebugLoc dl = Op.getDebugLoc(); + + // Type to extend from + SDValue Op0 = Op.getOperand(0); + EVT Op0VT = Op0.getValueType(); + + assert((OpVT == MVT::i128 && Op0VT == MVT::i64) && + "LowerSIGN_EXTEND: input and/or output operand have wrong size"); + + // Create shuffle mask + unsigned mask1 = 0x10101010; // byte 0 - 3 and 4 - 7 + unsigned mask2 = 0x01020304; // byte 8 - 11 + unsigned mask3 = 0x05060708; // byte 12 - 15 + SDValue shufMask = CurDAG->getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, + CurDAG->getConstant(mask1, MVT::i32), + CurDAG->getConstant(mask1, MVT::i32), + CurDAG->getConstant(mask2, MVT::i32), + CurDAG->getConstant(mask3, MVT::i32)); + SDNode *shufMaskLoad = emitBuildVector(shufMask); + + // Word wise arithmetic right shift to generate at least one byte + // that contains sign bits. + SDNode *PromoteScalar = SelectCode(CurDAG->getNode(SPUISD::PREFSLOT2VEC, dl, + MVT::v2i64, Op0, Op0)); + SDNode *sraVal = SelectCode(CurDAG->getNode(ISD::SRA, dl, MVT::v2i64, + SDValue(PromoteScalar, 0), + CurDAG->getConstant(31, MVT::i32))); + + // Shuffle bytes - Copy the sign bits into the upper 64 bits + // and the input value into the lower 64 bits. + SDNode *extShuffle = SelectCode(CurDAG->getNode(SPUISD::SHUFB, dl, + MVT::v2i64, Op0, + SDValue(sraVal, 0), + SDValue(shufMaskLoad, 0))); + + return SelectCode(CurDAG->getNode(ISD::BIT_CONVERT, dl, MVT::i128, + SDValue(extShuffle, 0))); +} + +/*! * Emit the instruction sequence for i64 left shifts. The basic algorithm * is to fill the bottom two word slots with zeros so that zeros are shifted * in as the entire quadword is shifted left. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=79949&r1=79948&r2=79949&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Aug 24 17:28:53 2009 @@ -350,6 +350,9 @@ // Custom lower i128 -> i64 truncates setOperationAction(ISD::TRUNCATE, MVT::i64, Custom); + // Custom lower i64 -> i128 sign extend + setOperationAction(ISD::SIGN_EXTEND, MVT::i128, Custom); + setOperationAction(ISD::FP_TO_SINT, MVT::i8, Promote); setOperationAction(ISD::FP_TO_UINT, MVT::i8, Promote); setOperationAction(ISD::FP_TO_SINT, MVT::i16, Promote); @@ -511,9 +514,6 @@ node_names[(unsigned) SPUISD::VEC2PREFSLOT] = "SPUISD::VEC2PREFSLOT"; node_names[(unsigned) SPUISD::SHLQUAD_L_BITS] = "SPUISD::SHLQUAD_L_BITS"; node_names[(unsigned) SPUISD::SHLQUAD_L_BYTES] = "SPUISD::SHLQUAD_L_BYTES"; - node_names[(unsigned) SPUISD::VEC_SHL] = "SPUISD::VEC_SHL"; - node_names[(unsigned) SPUISD::VEC_SRL] = "SPUISD::VEC_SRL"; - node_names[(unsigned) SPUISD::VEC_SRA] = "SPUISD::VEC_SRA"; node_names[(unsigned) SPUISD::VEC_ROTL] = "SPUISD::VEC_ROTL"; node_names[(unsigned) SPUISD::VEC_ROTR] = "SPUISD::VEC_ROTR"; node_names[(unsigned) SPUISD::ROTBYTES_LEFT] = "SPUISD::ROTBYTES_LEFT"; @@ -2610,6 +2610,45 @@ return SDValue(); // Leave the truncate unmolested } +//! Custom lower ISD::SIGN_EXTEND +static SDValue LowerSIGN_EXTEND(SDValue Op, SelectionDAG &DAG) +{ + // Type to extend to + EVT VT = Op.getValueType(); + DebugLoc dl = Op.getDebugLoc(); + + // Type to extend from + SDValue Op0 = Op.getOperand(0); + EVT Op0VT = Op0.getValueType(); + + assert((VT == MVT::i128 && Op0VT == MVT::i64) && + "LowerSIGN_EXTEND: input and/or output operand have wrong size"); + + // Create shuffle mask + unsigned mask1 = 0x10101010; // byte 0 - 3 and 4 - 7 + unsigned mask2 = 0x01020304; // byte 8 - 11 + unsigned mask3 = 0x05060708; // byte 12 - 15 + SDValue shufMask = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, + DAG.getConstant(mask1, MVT::i32), + DAG.getConstant(mask1, MVT::i32), + DAG.getConstant(mask2, MVT::i32), + DAG.getConstant(mask3, MVT::i32)); + + // Word wise arithmetic right shift to generate a byte that contains sign bits + SDValue sraVal = DAG.getNode(ISD::SRA, + dl, + MVT::v2i64, + DAG.getNode(SPUISD::PREFSLOT2VEC, dl, MVT::v2i64, Op0, Op0), + DAG.getConstant(31, MVT::i32)); + + // shuffle bytes - copies 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::v2i64, + Op0, sraVal, shufMask); + + return DAG.getNode(ISD::BIT_CONVERT, dl, MVT::i128, extShuffle); +} + //! Custom (target-specific) lowering entry point /*! This is where LLVM's DAG selection process calls to do target-specific @@ -2702,6 +2741,9 @@ case ISD::TRUNCATE: return LowerTRUNCATE(Op, DAG); + + case ISD::SIGN_EXTEND: + return LowerSIGN_EXTEND(Op, DAG); } return SDValue(); @@ -2864,9 +2906,6 @@ } case SPUISD::SHLQUAD_L_BITS: case SPUISD::SHLQUAD_L_BYTES: - case SPUISD::VEC_SHL: - case SPUISD::VEC_SRL: - case SPUISD::VEC_SRA: case SPUISD::ROTBYTES_LEFT: { SDValue Op1 = N->getOperand(1); @@ -2994,9 +3033,6 @@ case SPUISD::VEC2PREFSLOT: case SPUISD::SHLQUAD_L_BITS: case SPUISD::SHLQUAD_L_BYTES: - case SPUISD::VEC_SHL: - case SPUISD::VEC_SRL: - case SPUISD::VEC_SRA: case SPUISD::VEC_ROTL: case SPUISD::VEC_ROTR: case SPUISD::ROTBYTES_LEFT: Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h?rev=79949&r1=79948&r2=79949&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h Mon Aug 24 17:28:53 2009 @@ -43,9 +43,6 @@ VEC2PREFSLOT, ///< Extract element 0 SHLQUAD_L_BITS, ///< Rotate quad left, by bits SHLQUAD_L_BYTES, ///< Rotate quad left, by bytes - VEC_SHL, ///< Vector shift left - VEC_SRL, ///< Vector shift right (logical) - VEC_SRA, ///< Vector shift right (arithmetic) VEC_ROTL, ///< Vector rotate left VEC_ROTR, ///< Vector rotate right ROTBYTES_LEFT, ///< Rotate bytes (loads -> ROTQBYI) Modified: llvm/trunk/lib/Target/CellSPU/SPUNodes.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUNodes.td?rev=79949&r1=79948&r2=79949&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUNodes.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUNodes.td Mon Aug 24 17:28:53 2009 @@ -87,9 +87,9 @@ def SPUshlquad_l_bytes: SDNode<"SPUISD::SHLQUAD_L_BYTES", SPUvecshift_type, []>; // Vector shifts (ISD::SHL,SRL,SRA are for _integers_ only): -def SPUvec_shl: SDNode<"SPUISD::VEC_SHL", SPUvecshift_type, []>; -def SPUvec_srl: SDNode<"SPUISD::VEC_SRL", SPUvecshift_type, []>; -def SPUvec_sra: SDNode<"SPUISD::VEC_SRA", SPUvecshift_type, []>; +def SPUvec_shl: SDNode<"ISD::SHL", SPUvecshift_type, []>; +def SPUvec_srl: SDNode<"ISD::SRL", SPUvecshift_type, []>; +def SPUvec_sra: SDNode<"ISD::SRA", SPUvecshift_type, []>; def SPUvec_rotl: SDNode<"SPUISD::VEC_ROTL", SPUvecshift_type, []>; def SPUvec_rotr: SDNode<"SPUISD::VEC_ROTR", SPUvecshift_type, []>; Added: llvm/trunk/test/CodeGen/CellSPU/sext128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/sext128.ll?rev=79949&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/sext128.ll (added) +++ llvm/trunk/test/CodeGen/CellSPU/sext128.ll Mon Aug 24 17:28:53 2009 @@ -0,0 +1,17 @@ +; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s +; RUN: grep {long.*269488144} %t1.s | count 2 +; RUN: grep {long.*16909060} %t1.s | count 1 +; RUN: grep {long.*84281096} %t1.s | count 1 +; RUN: grep {rotmai} %t1.s | count 1 +; RUN: grep {lqa} %t1.s | count 1 +; RUN: grep {shufb} %t1.s | count 1 + +; ModuleID = 'sext128.bc' +target datalayout = "E-p:32:32:128-i1:8:128-i8:8:128-i16:16:128-i32:32:128-i64:32:128-f32:32:128-f64:64:128-v64:128:128-v128:128:128-a0:0:128-s0:128:128" +target triple = "spu" + +define i128 @sext_i64_i128(i64 %a) { +entry: + %0 = sext i64 %a to i128 + ret i128 %0 +} From clattner at apple.com Mon Aug 24 17:30:29 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 24 Aug 2009 15:30:29 -0700 Subject: [llvm-commits] [llvm] r79949 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.h lib/Target/CellSPU/SPUNodes.td test/CodeGen/CellSPU/sext128.ll In-Reply-To: <200908242228.n7OMSrHE021064@zion.cs.uiuc.edu> References: <200908242228.n7OMSrHE021064@zion.cs.uiuc.edu> Message-ID: <9F0498BB-7D58-4318-ABE4-1C656AB34604@apple.com> On Aug 24, 2009, at 3:28 PM, Scott Michel wrote: > Author: pingbak > Date: Mon Aug 24 17:28:53 2009 > New Revision: 79949 > > URL: http://llvm.org/viewvc/llvm-project?rev=79949&view=rev > Log: > 128-bit sign extension and vector shift cleanups, contributed by Ken > Werner > (IBM). Nice! > +++ llvm/trunk/test/CodeGen/CellSPU/sext128.ll Mon Aug 24 17:28:53 > 2009 > @@ -0,0 +1,17 @@ > +; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s Please use FileCheck instead of grep for tests like this, they are more specific and run faster. http://llvm.org/docs/TestingGuide.html#FileCheck -Chris > +; RUN: grep {long.*269488144} %t1.s | count 2 > +; RUN: grep {long.*16909060} %t1.s | count 1 > +; RUN: grep {long.*84281096} %t1.s | count 1 > +; RUN: grep {rotmai} %t1.s | count 1 > +; RUN: grep {lqa} %t1.s | count 1 > +; RUN: grep {shufb} %t1.s | count 1 > + > +; ModuleID = 'sext128.bc' > +target datalayout = "E-p:32:32:128-i1:8:128-i8:8:128-i16:16:128- > i32:32:128-i64:32:128-f32:32:128-f64:64:128-v64:128:128-v128:128:128- > a0:0:128-s0:128:128" > +target triple = "spu" > + > +define i128 @sext_i64_i128(i64 %a) { > +entry: > + %0 = sext i64 %a to i128 > + ret i128 %0 > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From anton at korobeynikov.info Mon Aug 24 17:41:56 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 25 Aug 2009 02:41:56 +0400 Subject: [llvm-commits] [llvm] r79949 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.h lib/Target/CellSPU/SPUNodes.td test/CodeGen/CellSPU/sext128.ll In-Reply-To: <200908242228.n7OMSrHE021064@zion.cs.uiuc.edu> References: <200908242228.n7OMSrHE021064@zion.cs.uiuc.edu> Message-ID: Hello, Scott > +SDNode * > +SPUDAGToDAGISel::SelectSEXTi128(SDValue &Op, EVT OpVT) > +{ This seems to be redundant. The sext is marked as custom lowered, how it can reappear during isel? So, either there is bug somewhere and invalid sexts are inserted or this code is never called. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From scottm at aero.org Mon Aug 24 17:49:22 2009 From: scottm at aero.org (Scott Michel) Date: Mon, 24 Aug 2009 22:49:22 -0000 Subject: [llvm-commits] [llvm] r79953 - /llvm/trunk/test/CodeGen/CellSPU/sext128.ll Message-ID: <200908242249.n7OMnMv9023699@zion.cs.uiuc.edu> Author: pingbak Date: Mon Aug 24 17:49:22 2009 New Revision: 79953 URL: http://llvm.org/viewvc/llvm-project?rev=79953&view=rev Log: Prefer 'FileCheck' over 'grep'. Modified: llvm/trunk/test/CodeGen/CellSPU/sext128.ll Modified: llvm/trunk/test/CodeGen/CellSPU/sext128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/sext128.ll?rev=79953&r1=79952&r2=79953&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/sext128.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/sext128.ll Mon Aug 24 17:49:22 2009 @@ -1,10 +1,4 @@ -; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep {long.*269488144} %t1.s | count 2 -; RUN: grep {long.*16909060} %t1.s | count 1 -; RUN: grep {long.*84281096} %t1.s | count 1 -; RUN: grep {rotmai} %t1.s | count 1 -; RUN: grep {lqa} %t1.s | count 1 -; RUN: grep {shufb} %t1.s | count 1 +; RUN: llvm-as -o - %s | llc -march=cellspu | FileCheck %s ; ModuleID = 'sext128.bc' target datalayout = "E-p:32:32:128-i1:8:128-i8:8:128-i16:16:128-i32:32:128-i64:32:128-f32:32:128-f64:64:128-v64:128:128-v128:128:128-a0:0:128-s0:128:128" @@ -12,6 +6,13 @@ define i128 @sext_i64_i128(i64 %a) { entry: +; CHECK: long 269488144 +; CHECK: long 269488144 +; CHECK: long 16909060 +; CHECK: long 84281096 +; CHECK: rotmai +; CHECK: lqa +; CHECK: shufb %0 = sext i64 %a to i128 ret i128 %0 } From tonic at nondot.org Mon Aug 24 18:11:38 2009 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 24 Aug 2009 18:11:38 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/talk.php Message-ID: <200908242311.n7ONBcbD026524@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: talk.php updated: 1.5 -> 1.6 --- Log message: Talk deadline has passed. --- Diffs of the changes: (+2 -2) talk.php | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/devmtg/talk.php diff -u llvm-www/devmtg/talk.php:1.5 llvm-www/devmtg/talk.php:1.6 --- llvm-www/devmtg/talk.php:1.5 Thu Jul 9 13:19:38 2009 +++ llvm-www/devmtg/talk.php Mon Aug 24 18:10:42 2009 @@ -203,8 +203,8 @@
LLVM Developers' Meeting - Talk Proposal
- - +Talk proposals are closed for this year. + Author: resistor Date: Mon Aug 24 18:32:14 2009 New Revision: 79957 URL: http://llvm.org/viewvc/llvm-project?rev=79957&view=rev Log: When extracting SEME regions of code, the extractor needs to update the dominator tree for split return blocks. Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=79957&r1=79956&r2=79957&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Mon Aug 24 18:32:14 2009 @@ -183,8 +183,24 @@ void CodeExtractor::splitReturnBlocks() { for (std::set::iterator I = BlocksToExtract.begin(), E = BlocksToExtract.end(); I != E; ++I) - if (ReturnInst *RI = dyn_cast((*I)->getTerminator())) - (*I)->splitBasicBlock(RI, (*I)->getName()+".ret"); + if (ReturnInst *RI = dyn_cast((*I)->getTerminator())) { + BasicBlock *New = (*I)->splitBasicBlock(RI, (*I)->getName()+".ret"); + if (DT) { + // Old dominates New. New node domiantes all other nodes dominated + //by Old. + DomTreeNode *OldNode = DT->getNode(*I); + std::vector Children; + for (DomTreeNode::iterator DI = OldNode->begin(), DE = OldNode->end(); + DI != DE; ++DI) + Children.push_back(*DI); + + DomTreeNode *NewNode = DT->addNewBlock(New, *I); + + for (std::vector::iterator I = Children.begin(), + E = Children.end(); I != E; ++I) + DT->changeImmediateDominator(*I, NewNode); + } + } } // findInputsOutputs - Find inputs to, outputs from the code region. From devang.patel at gmail.com Mon Aug 24 18:38:22 2009 From: devang.patel at gmail.com (Devang Patel) Date: Mon, 24 Aug 2009 16:38:22 -0700 Subject: [llvm-commits] [llvm] r79957 - /llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp In-Reply-To: <200908242332.n7ONWEfN029081@zion.cs.uiuc.edu> References: <200908242332.n7ONWEfN029081@zion.cs.uiuc.edu> Message-ID: <352a1fb20908241638t7123b40dn662dd6a3e7e89888@mail.gmail.com> On Mon, Aug 24, 2009 at 4:32 PM, Owen Anderson wrote: > Author: resistor > Date: Mon Aug 24 18:32:14 2009 > New Revision: 79957 > > URL: http://llvm.org/viewvc/llvm-project?rev=79957&view=rev > Log: > When extracting SEME regions of code, the extractor needs to update the dominator tree for split return blocks. > > Modified: > ? ?llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp > > Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=79957&r1=79956&r2=79957&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Mon Aug 24 18:32:14 2009 > @@ -183,8 +183,24 @@ > ?void CodeExtractor::splitReturnBlocks() { > ? for (std::set::iterator I = BlocksToExtract.begin(), > ? ? ? ? ?E = BlocksToExtract.end(); I != E; ++I) > - ? ?if (ReturnInst *RI = dyn_cast((*I)->getTerminator())) > - ? ? ?(*I)->splitBasicBlock(RI, (*I)->getName()+".ret"); > + ? ?if (ReturnInst *RI = dyn_cast((*I)->getTerminator())) { > + ? ? ?BasicBlock *New = (*I)->splitBasicBlock(RI, (*I)->getName()+".ret"); > + ? ? ?if (DT) { > + ? ? ? ?// Old dominates New. New node domiantes all other nodes dominated > + ? ? ? ?//by Old. > + ? ? ? ?DomTreeNode *OldNode = DT->getNode(*I); > + ? ? ? ?std::vector Children; > SmallVector ? - Devang From clattner at apple.com Mon Aug 24 18:43:09 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 24 Aug 2009 16:43:09 -0700 Subject: [llvm-commits] [llvm] r79953 - /llvm/trunk/test/CodeGen/CellSPU/sext128.ll In-Reply-To: <200908242249.n7OMnMv9023699@zion.cs.uiuc.edu> References: <200908242249.n7OMnMv9023699@zion.cs.uiuc.edu> Message-ID: On Aug 24, 2009, at 3:49 PM, Scott Michel wrote: > Author: pingbak > Date: Mon Aug 24 17:49:22 2009 > New Revision: 79953 > > URL: http://llvm.org/viewvc/llvm-project?rev=79953&view=rev > Log: > Prefer 'FileCheck' over 'grep'. Thanks Scott! -Chris > > Modified: > llvm/trunk/test/CodeGen/CellSPU/sext128.ll > > Modified: llvm/trunk/test/CodeGen/CellSPU/sext128.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/sext128.ll?rev=79953&r1=79952&r2=79953&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/sext128.ll (original) > +++ llvm/trunk/test/CodeGen/CellSPU/sext128.ll Mon Aug 24 17:49:22 > 2009 > @@ -1,10 +1,4 @@ > -; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s > -; RUN: grep {long.*269488144} %t1.s | count 2 > -; RUN: grep {long.*16909060} %t1.s | count 1 > -; RUN: grep {long.*84281096} %t1.s | count 1 > -; RUN: grep {rotmai} %t1.s | count 1 > -; RUN: grep {lqa} %t1.s | count 1 > -; RUN: grep {shufb} %t1.s | count 1 > +; RUN: llvm-as -o - %s | llc -march=cellspu | FileCheck %s > > ; ModuleID = 'sext128.bc' > target datalayout = "E-p:32:32:128-i1:8:128-i8:8:128-i16:16:128- > i32:32:128-i64:32:128-f32:32:128-f64:64:128-v64:128:128-v128:128:128- > a0:0:128-s0:128:128" > @@ -12,6 +6,13 @@ > > define i128 @sext_i64_i128(i64 %a) { > entry: > +; CHECK: long 269488144 > +; CHECK: long 269488144 > +; CHECK: long 16909060 > +; CHECK: long 84281096 > +; CHECK: rotmai > +; CHECK: lqa > +; CHECK: shufb > %0 = sext i64 %a to i128 > ret i128 %0 > } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From scottm at aero.org Mon Aug 24 18:57:35 2009 From: scottm at aero.org (Scott Michel) Date: Mon, 24 Aug 2009 23:57:35 -0000 Subject: [llvm-commits] [llvm] r79958 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp test/CodeGen/CellSPU/loads.ll Message-ID: <200908242357.n7ONvZ4d032311@zion.cs.uiuc.edu> Author: pingbak Date: Mon Aug 24 18:57:35 2009 New Revision: 79958 URL: http://llvm.org/viewvc/llvm-project?rev=79958&view=rev Log: - Remove SelectSEXTi128 from SPUISelDAGToDAG.cpp, evidently, this is redundant code, according to Anton (I'm not totally convinced, but we can always resurrect patches if we need to do so.) - Start moving CellSPU's tests to prefer FileCheck. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/test/CodeGen/CellSPU/loads.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=79958&r1=79957&r2=79958&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Mon Aug 24 18:57:35 2009 @@ -322,9 +322,6 @@ /// target-specific node if it hasn't already been changed. SDNode *Select(SDValue Op); - //! Emit the instruction sequence for i128 sext - SDNode *SelectSEXTi128(SDValue &Op, EVT OpVT); - //! Emit the instruction sequence for i64 shl SDNode *SelectSHLi64(SDValue &Op, EVT OpVT); @@ -836,10 +833,6 @@ } } } - } else if (Opc == ISD::SIGN_EXTEND) { - if (OpVT == MVT::i128) { - return SelectSEXTi128(Op, OpVT); - } } else if (Opc == ISD::SHL) { if (OpVT == MVT::i64) { return SelectSHLi64(Op, OpVT); @@ -964,58 +957,6 @@ } /*! - * Emit the instruction sequence for i64 -> i128 sign extend. The basic - * algorithm is to duplicate the sign bit using rotmai to generate at - * least one byte full of sign bits. Then propagate the "sign-byte" into - * theleftmost words and the i64 into the rightmost words using shufb. - * - * @param Op The sext operand - * @param OpVT The type to extend to - * @return The SDNode with the entire instruction sequence - */ -SDNode * -SPUDAGToDAGISel::SelectSEXTi128(SDValue &Op, EVT OpVT) -{ - DebugLoc dl = Op.getDebugLoc(); - - // Type to extend from - SDValue Op0 = Op.getOperand(0); - EVT Op0VT = Op0.getValueType(); - - assert((OpVT == MVT::i128 && Op0VT == MVT::i64) && - "LowerSIGN_EXTEND: input and/or output operand have wrong size"); - - // Create shuffle mask - unsigned mask1 = 0x10101010; // byte 0 - 3 and 4 - 7 - unsigned mask2 = 0x01020304; // byte 8 - 11 - unsigned mask3 = 0x05060708; // byte 12 - 15 - SDValue shufMask = CurDAG->getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, - CurDAG->getConstant(mask1, MVT::i32), - CurDAG->getConstant(mask1, MVT::i32), - CurDAG->getConstant(mask2, MVT::i32), - CurDAG->getConstant(mask3, MVT::i32)); - SDNode *shufMaskLoad = emitBuildVector(shufMask); - - // Word wise arithmetic right shift to generate at least one byte - // that contains sign bits. - SDNode *PromoteScalar = SelectCode(CurDAG->getNode(SPUISD::PREFSLOT2VEC, dl, - MVT::v2i64, Op0, Op0)); - SDNode *sraVal = SelectCode(CurDAG->getNode(ISD::SRA, dl, MVT::v2i64, - SDValue(PromoteScalar, 0), - CurDAG->getConstant(31, MVT::i32))); - - // Shuffle bytes - Copy the sign bits into the upper 64 bits - // and the input value into the lower 64 bits. - SDNode *extShuffle = SelectCode(CurDAG->getNode(SPUISD::SHUFB, dl, - MVT::v2i64, Op0, - SDValue(sraVal, 0), - SDValue(shufMaskLoad, 0))); - - return SelectCode(CurDAG->getNode(ISD::BIT_CONVERT, dl, MVT::i128, - SDValue(extShuffle, 0))); -} - -/*! * Emit the instruction sequence for i64 left shifts. The basic algorithm * is to fill the bottom two word slots with zeros so that zeros are shifted * in as the entire quadword is shifted left. Modified: llvm/trunk/test/CodeGen/CellSPU/loads.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/loads.ll?rev=79958&r1=79957&r2=79958&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/loads.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/loads.ll Mon Aug 24 18:57:35 2009 @@ -1,6 +1,4 @@ -; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep {lqd.*0(\$3)} %t1.s | count 1 -; RUN: grep {lqd.*16(\$3)} %t1.s | count 1 +; RUN: llvm-as -o - %s | llc -march=cellspu | FileCheck %s ; ModuleID = 'loads.bc' target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" @@ -10,11 +8,13 @@ entry: %tmp1 = load <4 x float>* %a ret <4 x float> %tmp1 +; CHECK: lqd $3, 0($3) } define <4 x float> @load_v4f32_2(<4 x float>* %a) nounwind readonly { entry: - %arrayidx = getelementptr <4 x float>* %a, i32 1 ; <<4 x float>*> [#uses=1] - %tmp1 = load <4 x float>* %arrayidx ; <<4 x float>> [#uses=1] + %arrayidx = getelementptr <4 x float>* %a, i32 1 + %tmp1 = load <4 x float>* %arrayidx ret <4 x float> %tmp1 +; CHECK: lqd $3, 16($3) } From ofv at wanadoo.es Mon Aug 24 19:02:30 2009 From: ofv at wanadoo.es (Oscar Fuentes) Date: Tue, 25 Aug 2009 00:02:30 -0000 Subject: [llvm-commits] [llvm] r79959 - /llvm/trunk/lib/Support/CMakeLists.txt Message-ID: <200908250002.n7P02UuF000455@zion.cs.uiuc.edu> Author: ofv Date: Mon Aug 24 19:02:29 2009 New Revision: 79959 URL: http://llvm.org/viewvc/llvm-project?rev=79959&view=rev Log: CMake: updated list of source files. Modified: llvm/trunk/lib/Support/CMakeLists.txt Modified: llvm/trunk/lib/Support/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CMakeLists.txt?rev=79959&r1=79958&r2=79959&view=diff ============================================================================== --- llvm/trunk/lib/Support/CMakeLists.txt (original) +++ llvm/trunk/lib/Support/CMakeLists.txt Mon Aug 24 19:02:29 2009 @@ -30,6 +30,7 @@ Timer.cpp Triple.cpp Twine.cpp + raw_os_ostream.cpp raw_ostream.cpp ) From isanbard at gmail.com Mon Aug 24 19:05:04 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 00:05:04 -0000 Subject: [llvm-commits] [llvm] r79960 - in /llvm/trunk/include/llvm: ADT/ilist.h ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h Message-ID: <200908250005.n7P0551g000785@zion.cs.uiuc.edu> Author: void Date: Mon Aug 24 19:05:04 2009 New Revision: 79960 URL: http://llvm.org/viewvc/llvm-project?rev=79960&view=rev Log: --- Reverse-merging r79938 into '.': U include/llvm/BasicBlock.h U include/llvm/ADT/ilist_node.h U include/llvm/ADT/ilist.h U include/llvm/CodeGen/SelectionDAG.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/MachineBasicBlock.h U include/llvm/Function.h Revert r79938. It was causing self-hosting build failures. Modified: llvm/trunk/include/llvm/ADT/ilist.h llvm/trunk/include/llvm/ADT/ilist_node.h llvm/trunk/include/llvm/BasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/Function.h Modified: llvm/trunk/include/llvm/ADT/ilist.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=79960&r1=79959&r2=79960&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist.h (original) +++ llvm/trunk/include/llvm/ADT/ilist.h Mon Aug 24 19:05:04 2009 @@ -39,15 +39,8 @@ #define LLVM_ADT_ILIST_H #include "llvm/ADT/iterator.h" -#include "llvm/Config/config.h" #include -#if defined(LLVM_COMPACT_SENTINELS) && LLVM_COMPACT_SENTINELS -# define sentinel_tail_assert(COND) -#else -# define sentinel_tail_assert(COND) assert(COND) -#endif - namespace llvm { template class iplist; @@ -196,12 +189,12 @@ // Accessors... operator pointer() const { - sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return NodePtr; } reference operator*() const { - sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return *NodePtr; } pointer operator->() const { return &operator*(); } @@ -222,7 +215,7 @@ } ilist_iterator &operator++() { // preincrement - Advance NodePtr = Traits::getNext(NodePtr); - sentinel_tail_assert(NodePtr && "++'d off the end of an ilist!"); + assert(NodePtr && "++'d off the end of an ilist!"); return *this; } ilist_iterator operator--(int) { // postdecrement operators... Modified: llvm/trunk/include/llvm/ADT/ilist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=79960&r1=79959&r2=79960&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) +++ llvm/trunk/include/llvm/ADT/ilist_node.h Mon Aug 24 19:05:04 2009 @@ -15,56 +15,33 @@ #ifndef LLVM_ADT_ILIST_NODE_H #define LLVM_ADT_ILIST_NODE_H -#include "llvm/Config/config.h" - namespace llvm { template -struct ilist_traits; - -/// ilist_half_node - Base class that provides prev services for sentinels. -/// -template -class ilist_half_node { - friend struct ilist_traits; - NodeTy *Prev; -protected: - NodeTy *getPrev() { return Prev; } - const NodeTy *getPrev() const { return Prev; } - void setPrev(NodeTy *P) { Prev = P; } - ilist_half_node() : Prev(0) {} -}; +struct ilist_nextprev_traits; template -struct ilist_nextprev_traits; +struct ilist_traits; /// ilist_node - Base class that provides next/prev services for nodes /// that use ilist_nextprev_traits or ilist_default_traits. /// template -class ilist_node : ilist_half_node { +class ilist_node { +private: friend struct ilist_nextprev_traits; friend struct ilist_traits; - NodeTy *Next; + NodeTy *Prev, *Next; + NodeTy *getPrev() { return Prev; } NodeTy *getNext() { return Next; } + const NodeTy *getPrev() const { return Prev; } const NodeTy *getNext() const { return Next; } + void setPrev(NodeTy *N) { Prev = N; } void setNext(NodeTy *N) { Next = N; } protected: - ilist_node() : Next(0) {} + ilist_node() : Prev(0), Next(0) {} }; -/// When assertions are off, the Next field of sentinels -/// will not be accessed. So it is not necessary to allocate -/// space for it. The following macro selects the most -/// efficient traits class. The LLVM_COMPACT_SENTINELS -/// configuration variable controls this. -/// -#if defined(LLVM_COMPACT_SENTINELS) && LLVM_COMPACT_SENTINELS -# define ILIST_NODE ilist_half_node -#else -# define ILIST_NODE ilist_node -#endif - } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=79960&r1=79959&r2=79960&view=diff ============================================================================== --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Mon Aug 24 19:05:04 2009 @@ -47,7 +47,7 @@ Instruction *ensureHead(Instruction*) const { return createSentinel(); } static void noteHead(Instruction*, Instruction*) {} private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; }; /// This represents a single basic block in LLVM. A basic block is simply a Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=79960&r1=79959&r2=79960&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Mon Aug 24 19:05:04 2009 @@ -26,7 +26,7 @@ template <> struct ilist_traits : public ilist_default_traits { private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; // this is only set by the MachineBasicBlock owning the LiveList friend class MachineBasicBlock; Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=79960&r1=79959&r2=79960&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Mon Aug 24 19:05:04 2009 @@ -38,7 +38,7 @@ template <> struct ilist_traits : public ilist_default_traits { - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; public: MachineBasicBlock *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=79960&r1=79959&r2=79960&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Aug 24 19:05:04 2009 @@ -37,7 +37,7 @@ template<> struct ilist_traits : public ilist_default_traits { private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; public: SDNode *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=79960&r1=79959&r2=79960&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Mon Aug 24 19:05:04 2009 @@ -45,7 +45,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; }; template<> struct ilist_traits @@ -62,7 +62,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; }; class Function : public GlobalValue, From wendling at apple.com Mon Aug 24 19:06:58 2009 From: wendling at apple.com (Bill Wendling) Date: Mon, 24 Aug 2009 17:06:58 -0700 Subject: [llvm-commits] [llvm] r79938 - in /llvm/trunk/include/llvm: ADT/ilist.h ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: <200908242134.n7OLYIof014072@zion.cs.uiuc.edu> References: <200908242134.n7OLYIof014072@zion.cs.uiuc.edu> Message-ID: <3C395149-433E-4A91-B187-C1FC4190856F@apple.com> Hi Gabor, I had to revert this patch. It was causing build failures during an "Apple-style build". (It does a full build and also cross-compiling.) Here are the errors I'm seeing. Could you take a look please? g++ -m32 -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite-strings - pedantic -Wno-long-long -Wno-variadic-macros -Wmissing-format- attribute -Werror -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused - DTARGET_NAME=\"i686-apple-darwin10\" -frandom-seed=0 -DNDEBUG -I. -I. - I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/ Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ llvmgcc42~obj/src/gcc/. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm- gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../ include -I./../intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../ libcpp/include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../ libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/ build.llvm-gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/ Developer/usr/local/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/ llvm/build.llvm-gcc-x86_64-darwin10-selfhost/llvmCore.roots/ llvmCore~dst/Developer/usr/local/include -D_DEBUG -D_GNU_SOURCE - D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS - DLLVM_VERSION_INFO='"9999"' -DBUILD_LLVM_APPLE_STYLE -I. -I. -I/ Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/llvm/ build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/ src/gcc/. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../include - I./../intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libcpp/ include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../ libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/ build.llvm-gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/ Developer/usr/local/include /Volumes/Sandbox/Buildbot/llvm/build.llvm- gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/ llvm-backend.cpp -o llvm-backend.o In file included from ./config.h:9, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/llvm- backend.cpp:58: ./auto-host.h:1004:1: error: "HAVE_MMAP_FILE" redefined In file included from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/Developer/usr/ local/include/llvm/ADT/ilist.h:42, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/Developer/usr/ local/include/llvm/SymbolTableListTraits.h:28, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/Developer/usr/ local/include/llvm/BasicBlock.h:18, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/Developer/usr/ local/include/llvm/Instructions.h:22, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/Developer/usr/ local/include/llvm/Support/IRBuilder.h:19, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/llvm- internal.h:41, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/llvm- backend.cpp:23: /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmCore.roots/llvmCore~dst/Developer/usr/local/include/llvm/Config/ config.h:248:1: error: this is the location of the previous definition In file included from ./config.h:9, from /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc- x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/llvm- backend.cpp:58: ./auto-host.h:1245:1: error: "PACKAGE_BUGREPORT" redefined ... -bw On Aug 24, 2009, at 2:34 PM, Gabor Greif wrote: > Author: ggreif > Date: Mon Aug 24 16:34:17 2009 > New Revision: 79938 > > URL: http://llvm.org/viewvc/llvm-project?rev=79938&view=rev > Log: > Resubmit an earlier patch of mine: > reduce the size of relevant "ghostly" sentinels > by a pointer. > > This attempt now makes the compactification dependent > on the configure variable LLVM_COMPACT_SENTINELS > and should not cause any bootstrap failures for > llvm-gcc any more. > > Please note that this is not yet the final version, > and (as settled with Chris) I shall take out the > autofoo/cmake portions in the next days. > > This will also lose the assertability on sentinel > dereferencing and operator++, but that seems > an acceptable price to pay for the simplified > build logic. > > Modified: > llvm/trunk/include/llvm/ADT/ilist.h > llvm/trunk/include/llvm/ADT/ilist_node.h > llvm/trunk/include/llvm/BasicBlock.h > llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h > llvm/trunk/include/llvm/CodeGen/MachineFunction.h > llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > llvm/trunk/include/llvm/Function.h > > Modified: llvm/trunk/include/llvm/ADT/ilist.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=79938&r1=79937&r2=79938&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/ADT/ilist.h (original) > +++ llvm/trunk/include/llvm/ADT/ilist.h Mon Aug 24 16:34:17 2009 > @@ -39,8 +39,15 @@ > #define LLVM_ADT_ILIST_H > > #include "llvm/ADT/iterator.h" > +#include "llvm/Config/config.h" > #include > > +#if defined(LLVM_COMPACT_SENTINELS) && LLVM_COMPACT_SENTINELS > +# define sentinel_tail_assert(COND) > +#else > +# define sentinel_tail_assert(COND) assert(COND) > +#endif > + > namespace llvm { > > template class iplist; > @@ -189,12 +196,12 @@ > > // Accessors... > operator pointer() const { > - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); > + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && > "Dereferencing end()!"); > return NodePtr; > } > > reference operator*() const { > - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); > + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && > "Dereferencing end()!"); > return *NodePtr; > } > pointer operator->() const { return &operator*(); } > @@ -215,7 +222,7 @@ > } > ilist_iterator &operator++() { // preincrement - Advance > NodePtr = Traits::getNext(NodePtr); > - assert(NodePtr && "++'d off the end of an ilist!"); > + sentinel_tail_assert(NodePtr && "++'d off the end of an ilist!"); > return *this; > } > ilist_iterator operator--(int) { // postdecrement operators... > > Modified: llvm/trunk/include/llvm/ADT/ilist_node.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=79938&r1=79937&r2=79938&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) > +++ llvm/trunk/include/llvm/ADT/ilist_node.h Mon Aug 24 16:34:17 2009 > @@ -15,33 +15,56 @@ > #ifndef LLVM_ADT_ILIST_NODE_H > #define LLVM_ADT_ILIST_NODE_H > > +#include "llvm/Config/config.h" > + > namespace llvm { > > template > -struct ilist_nextprev_traits; > +struct ilist_traits; > > +/// ilist_half_node - Base class that provides prev services for > sentinels. > +/// > template > -struct ilist_traits; > +class ilist_half_node { > + friend struct ilist_traits; > + NodeTy *Prev; > +protected: > + NodeTy *getPrev() { return Prev; } > + const NodeTy *getPrev() const { return Prev; } > + void setPrev(NodeTy *P) { Prev = P; } > + ilist_half_node() : Prev(0) {} > +}; > + > +template > +struct ilist_nextprev_traits; > > /// ilist_node - Base class that provides next/prev services for nodes > /// that use ilist_nextprev_traits or ilist_default_traits. > /// > template > -class ilist_node { > -private: > +class ilist_node : ilist_half_node { > friend struct ilist_nextprev_traits; > friend struct ilist_traits; > - NodeTy *Prev, *Next; > - NodeTy *getPrev() { return Prev; } > + NodeTy *Next; > NodeTy *getNext() { return Next; } > - const NodeTy *getPrev() const { return Prev; } > const NodeTy *getNext() const { return Next; } > - void setPrev(NodeTy *N) { Prev = N; } > void setNext(NodeTy *N) { Next = N; } > protected: > - ilist_node() : Prev(0), Next(0) {} > + ilist_node() : Next(0) {} > }; > > +/// When assertions are off, the Next field of sentinels > +/// will not be accessed. So it is not necessary to allocate > +/// space for it. The following macro selects the most > +/// efficient traits class. The LLVM_COMPACT_SENTINELS > +/// configuration variable controls this. > +/// > +#if defined(LLVM_COMPACT_SENTINELS) && LLVM_COMPACT_SENTINELS > +# define ILIST_NODE ilist_half_node > +#else > +# define ILIST_NODE ilist_node > +#endif > + > } // End llvm namespace > > #endif > > Modified: llvm/trunk/include/llvm/BasicBlock.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=79938&r1=79937&r2=79938&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/BasicBlock.h (original) > +++ llvm/trunk/include/llvm/BasicBlock.h Mon Aug 24 16:34:17 2009 > @@ -47,7 +47,7 @@ > Instruction *ensureHead(Instruction*) const { return createSentinel > (); } > static void noteHead(Instruction*, Instruction*) {} > private: > - mutable ilist_node Sentinel; > + mutable ILIST_NODE Sentinel; > }; > > /// This represents a single basic block in LLVM. A basic block is > simply a > > Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=79938&r1=79937&r2=79938&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Mon Aug 24 > 16:34:17 2009 > @@ -26,7 +26,7 @@ > template <> > struct ilist_traits : public > ilist_default_traits { > private: > - mutable ilist_node Sentinel; > + mutable ILIST_NODE Sentinel; > > // this is only set by the MachineBasicBlock owning the LiveList > friend class MachineBasicBlock; > > Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=79938&r1=79937&r2=79938&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Mon Aug 24 > 16:34:17 2009 > @@ -38,7 +38,7 @@ > template <> > struct ilist_traits > : public ilist_default_traits { > - mutable ilist_node Sentinel; > + mutable ILIST_NODE Sentinel; > public: > MachineBasicBlock *createSentinel() const { > return static_cast(&Sentinel); > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=79938&r1=79937&r2=79938&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Aug 24 > 16:34:17 2009 > @@ -37,7 +37,7 @@ > > template<> struct ilist_traits : public > ilist_default_traits { > private: > - mutable ilist_node Sentinel; > + mutable ILIST_NODE Sentinel; > public: > SDNode *createSentinel() const { > return static_cast(&Sentinel); > > Modified: llvm/trunk/include/llvm/Function.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=79938&r1=79937&r2=79938&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Function.h (original) > +++ llvm/trunk/include/llvm/Function.h Mon Aug 24 16:34:17 2009 > @@ -45,7 +45,7 @@ > > static ValueSymbolTable *getSymTab(Function *ItemParent); > private: > - mutable ilist_node Sentinel; > + mutable ILIST_NODE Sentinel; > }; > > template<> struct ilist_traits > @@ -62,7 +62,7 @@ > > static ValueSymbolTable *getSymTab(Function *ItemParent); > private: > - mutable ilist_node Sentinel; > + mutable ILIST_NODE Sentinel; > }; > > class Function : public GlobalValue, > > > _______________________________________________ > 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/20090824/60aad74d/attachment.html From dalej at apple.com Mon Aug 24 19:16:14 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 25 Aug 2009 00:16:14 -0000 Subject: [llvm-commits] [llvm] r79961 - in /llvm/trunk: lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp test/CodeGen/X86/asm-modifier.ll Message-ID: <200908250016.n7P0GF0A002172@zion.cs.uiuc.edu> Author: johannes Date: Mon Aug 24 19:16:14 2009 New Revision: 79961 URL: http://llvm.org/viewvc/llvm-project?rev=79961&view=rev Log: Fix PR 4751, another difficulty with %a modifier on x86. Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/trunk/test/CodeGen/X86/asm-modifier.ll Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=79961&r1=79960&r2=79961&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Aug 24 19:16:14 2009 @@ -625,6 +625,10 @@ O << MO.getImm(); return false; } + if (MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isSymbol()) { + printSymbolOperand(MO); + return false; + } if (MO.isReg()) { O << '('; printOperand(MI, OpNo); Modified: llvm/trunk/test/CodeGen/X86/asm-modifier.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/asm-modifier.ll?rev=79961&r1=79960&r2=79961&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/asm-modifier.ll (original) +++ llvm/trunk/test/CodeGen/X86/asm-modifier.ll Mon Aug 24 19:16:14 2009 @@ -19,3 +19,23 @@ %asmtmp = tail call i16 asm "movw\09%gs:${1:a}, ${0:w}", "=r,ir,~{dirflag},~{fpsr},~{flags}"(i32 %address) nounwind ; [#uses=1] ret i16 %asmtmp } + + at n = global i32 42 ; [#uses=3] + at y = common global i32 0 ; [#uses=3] + +define void @test3() nounwind { +entry: +; CHECK: test3: +; CHECK: movl _n, %eax + call void asm sideeffect "movl ${0:a}, %eax", "ir,~{dirflag},~{fpsr},~{flags},~{eax}"(i32* @n) nounwind + ret void +} + +define void @test4() nounwind { +entry: +; CHECK: test4: +; CHECK: movl L_y$non_lazy_ptr, %ecx +; CHECK: movl (%ecx), %eax + call void asm sideeffect "movl ${0:a}, %eax", "ir,~{dirflag},~{fpsr},~{flags},~{eax}"(i32* @y) nounwind + ret void +} From resistor at mac.com Mon Aug 24 19:54:39 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 25 Aug 2009 00:54:39 -0000 Subject: [llvm-commits] [llvm] r79963 - /llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Message-ID: <200908250054.n7P0sdKg006929@zion.cs.uiuc.edu> Author: resistor Date: Mon Aug 24 19:54:39 2009 New Revision: 79963 URL: http://llvm.org/viewvc/llvm-project?rev=79963&view=rev Log: Handle a corner case when extracing code regions where one of the immediate successor of an extracted block contains a PHI using a value defined in the extracted region. With this patch, the partial inliner now passes MultiSource/Applications. Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=79963&r1=79962&r2=79963&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Mon Aug 24 19:54:39 2009 @@ -369,7 +369,7 @@ Values &inputs, Values &outputs) { // Emit a call to the new function, passing in: *pointer to struct (if // aggregating parameters), or plan inputs and allocated memory for outputs - std::vector params, StructValues, ReloadOutputs; + std::vector params, StructValues, ReloadOutputs, Reloads; LLVMContext &Context = newFunction->getContext(); @@ -446,6 +446,7 @@ Output = ReloadOutputs[i]; } LoadInst *load = new LoadInst(Output, outputs[i]->getName()+".reload"); + Reloads.push_back(load); codeReplacer->getInstList().push_back(load); std::vector Users(outputs[i]->use_begin(), outputs[i]->use_end()); for (unsigned u = 0, e = Users.size(); u != e; ++u) { @@ -532,8 +533,25 @@ DominatesDef = false; } - if (DT) + if (DT) { DominatesDef = DT->dominates(DefBlock, OldTarget); + + // If the output value is used by a phi in the target block, + // then we need to test for dominance of the phi's predecessor + // instead. Unfortunately, this a little complicated since we + // have already rewritten uses of the value to uses of the reload. + for (Value::use_iterator UI = Reloads[out]->use_begin(), + UE = Reloads[out]->use_end(); UI != UE; ++UI) { + PHINode *P = dyn_cast(*UI); + if (!P || P->getParent() != OldTarget) continue; + + BasicBlock* pred = P->getIncomingBlock(UI); + if (DT->dominates(DefBlock, pred)) { + DominatesDef = true; + break; + } + } + } if (DominatesDef) { if (AggregateArgs) { From daniel at zuster.org Mon Aug 24 20:04:17 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 18:04:17 -0700 Subject: [llvm-commits] [PATCH] Cleanup and Improve ProfileEstimator and MaximumSpanningTree In-Reply-To: <4A930AA0.9080108@student.tuwien.ac.at> References: <4A8C2A0B.4010103@student.tuwien.ac.at> <6a8523d60908240906q1e705593ufed5aa77b1209a9c@mail.gmail.com> <4A930AA0.9080108@student.tuwien.ac.at> Message-ID: <6a8523d60908241804k147a34bcm38470d38af8b72af@mail.gmail.com> On Mon, Aug 24, 2009 at 2:48 PM, Andreas Neustifter wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Daniel, > > Daniel Dunbar wrote: >> Can you go ahead and apply the comment fixes parts of this (minus the >> changes to stuff not in the tree, of course). > > Am I getting this right: just the comment changes but not the code changes? Err, I meant the changes that aren't covered by previous patches (e.g. the spanning tree stuff), but wasn't very clear. :) - Daniel From daniel at zuster.org Mon Aug 24 20:12:36 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 18:12:36 -0700 Subject: [llvm-commits] [PATCH] Preparation for Optimal Edge Profiling: Build libprofile as bytecode. In-Reply-To: <4A92E4CE.7000404@student.tuwien.ac.at> References: <4A8C2948.9050504@student.tuwien.ac.at> <6a8523d60908240905q668b231eg349bb59c3c5b705e@mail.gmail.com> <4A92E4CE.7000404@student.tuwien.ac.at> Message-ID: <6a8523d60908241812w598881e1ideba24e6f33528db@mail.gmail.com> On Mon, Aug 24, 2009 at 12:06 PM, Andreas Neustifter wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Daniel, > > Daniel Dunbar wrote: >> Hi Andreas, >> >> The exported change is fine, but I don't think MODULE_NAME is >> necessary. libprofile_rt.bca (a bitcode archive) is already getting >> built, isn't that good enough? > > I used that for bytecode linking of the whole module, there its not > possible to use the libprofile_rt.bca. But its also possible to link the > libprofile_rt.so instead later on. I will commit only the symbol export. I still don't understand, it should always be possible to link using a .bca in any place that linking a .bc would work. What is the situation where this fails? - Daniel From dalej at apple.com Mon Aug 24 20:13:58 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 25 Aug 2009 01:13:58 -0000 Subject: [llvm-commits] [llvm] r79966 - /llvm/trunk/lib/Transforms/IPO/Inliner.cpp Message-ID: <200908250113.n7P1DxFU009311@zion.cs.uiuc.edu> Author: johannes Date: Mon Aug 24 20:13:58 2009 New Revision: 79966 URL: http://llvm.org/viewvc/llvm-project?rev=79966&view=rev Log: Allow multiple occurrences of -inline-threshold on the command line. This gives llvm-gcc developers a way to control inlining (documented as "not intended for end users"). Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=79966&r1=79965&r2=79966&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon Aug 24 20:13:58 2009 @@ -33,7 +33,7 @@ STATISTIC(NumDeleted, "Number of functions deleted because all callers found"); static cl::opt -InlineLimit("inline-threshold", cl::Hidden, cl::init(200), +InlineLimit("inline-threshold", cl::Hidden, cl::init(200), cl::ZeroOrMore, cl::desc("Control the amount of inlining to perform (default = 200)")); Inliner::Inliner(void *ID) From daniel at zuster.org Mon Aug 24 20:15:33 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 24 Aug 2009 18:15:33 -0700 Subject: [llvm-commits] [llvm] r79732 - /llvm/trunk/cmake/modules/TableGen.cmake In-Reply-To: <878wh9q71b.fsf@telefonica.net> References: <200908220700.n7M70L8D011322@zion.cs.uiuc.edu> <87eir1qgat.fsf@telefonica.net> <733304B8-2E7B-41DC-A9E8-B1038991A3E9@apple.com> <878wh9q71b.fsf@telefonica.net> Message-ID: <6a8523d60908241815ne3a7efdwdeda1b96e9fb9664@mail.gmail.com> See PR4676 for more info on the problem. - Daniel On Mon, Aug 24, 2009 at 1:41 PM, ?scar Fuentes wrote: > Douglas Gregor writes: > >> On Aug 24, 2009, at 10:20 AM, ?scar Fuentes wrote: >> >>>> CMake: Don't use copy_if_different for TableGen output, because it >>>> does not work with IDE targets >>> >>> What means "does not work"? >>> >>> Which IDEs have this problem? >> >> >> Both Xcode and Visual C++ have different problems. > > [snip] > > Thanks for the info, Doug. Yes, I've seen how VC++ rebuilds the > .inc files too often (with nmake, I do not use the IDE), and IIRC MinGW > is even worse: sometimes Intrinsics.td is rebuilt for no reason, which > triggers the rebuild of all llvm targets and tools. > > Hope your change fixes this. > > -- > ?scar > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From isanbard at gmail.com Mon Aug 24 21:27:42 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 02:27:42 -0000 Subject: [llvm-commits] [llvm] r79969 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfException.cpp DwarfException.h Message-ID: <200908250227.n7P2RgBh018449@zion.cs.uiuc.edu> Author: void Date: Mon Aug 24 21:27:42 2009 New Revision: 79969 URL: http://llvm.org/viewvc/llvm-project?rev=79969&view=rev Log: Rename functions to something more descriptive. At the very least mention the CIE and FDE in their names. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=79969&r1=79968&r2=79969&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Mon Aug 24 21:27:42 2009 @@ -49,8 +49,11 @@ delete ExceptionTimer; } -void DwarfException::EmitCommonEHFrame(const Function *Personality, - unsigned Index) { +/// EmitCommonInformationEntry - Emit a Common Information Entry (CIE). This +/// holds information that is shared among many Frame Description Entries. +/// There is at least one CIE in every non-empty .debug_frame section. +void DwarfException::EmitCommonInformationEntry(const Function *Personality, + unsigned Index) { // Size and sign of stack growth. int stackGrowth = Asm->TM.getFrameInfo()->getStackGrowthDirection() == @@ -144,9 +147,10 @@ Asm->EOL(); } -/// EmitEHFrame - Emit function exception frame information. -/// -void DwarfException::EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) { +/// EmitFrameDescriptionEntry - Emit the Frame Description Entry (FDE) for the +/// function. +void DwarfException:: +EmitFrameDescriptionEntry(const FunctionEHFrameInfo &EHFrameInfo) { assert(!EHFrameInfo.function->hasAvailableExternallyLinkage() && "Should not emit 'available externally' functions at all"); @@ -844,11 +848,11 @@ if (shouldEmitMovesModule || shouldEmitTableModule) { const std::vector Personalities = MMI->getPersonalities(); for (unsigned i = 0; i < Personalities.size(); ++i) - EmitCommonEHFrame(Personalities[i], i); + EmitCommonInformationEntry(Personalities[i], i); for (std::vector::iterator I = EHFrames.begin(), E = EHFrames.end(); I != E; ++I) - EmitEHFrame(*I); + EmitFrameDescriptionEntry(*I); } if (TimePassesIsEnabled) Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h?rev=79969&r1=79968&r2=79969&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h Mon Aug 24 21:27:42 2009 @@ -70,13 +70,14 @@ /// ExceptionTimer - Timer for the Dwarf exception writer. Timer *ExceptionTimer; - /// EmitCommonEHFrame - Emit the common eh unwind frame. - /// - void EmitCommonEHFrame(const Function *Personality, unsigned Index); - - /// EmitEHFrame - Emit function exception frame information. - /// - void EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo); + /// EmitCommonInformationEntry - Emit a Common Information Entry (CIE). This + /// holds information that is shared among many Frame Description Entries. + /// There is at least one CIE in every non-empty .debug_frame section. + void EmitCommonInformationEntry(const Function *Personality, unsigned Index); + + /// EmitFrameDescriptionEntry - Emit the Frame Description Entry (FDE) for the + /// function. + void EmitFrameDescriptionEntry(const FunctionEHFrameInfo &EHFrameInfo); /// EmitExceptionTable - Emit landing pads and actions. /// From isanbard at gmail.com Mon Aug 24 21:32:05 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 02:32:05 -0000 Subject: [llvm-commits] [llvm] r79971 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Message-ID: <200908250232.n7P2W5FY019005@zion.cs.uiuc.edu> Author: void Date: Mon Aug 24 21:32:05 2009 New Revision: 79971 URL: http://llvm.org/viewvc/llvm-project?rev=79971&view=rev Log: - Emit new line after each FDE. - Fix comment. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=79971&r1=79970&r2=79971&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Mon Aug 24 21:32:05 2009 @@ -97,7 +97,7 @@ Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), true)); Asm->EOL("CIE Return Address Column"); - // If there is a personality, we need to indicate the functions location. + // If there is a personality, we need to indicate the function's location. if (Personality) { Asm->EmitULEB128Bytes(7); Asm->EOL("Augmentation Size"); @@ -240,6 +240,8 @@ if (const char *UsedDirective = MAI->getUsedDirective()) O << UsedDirective << EHFrameInfo.FnName << "\n\n"; } + + Asm->EOL(); } /// SharedTypeIds - How many leading type ids two landing pads have in common. From dpatel at apple.com Tue Aug 25 00:24:08 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 25 Aug 2009 05:24:08 -0000 Subject: [llvm-commits] [llvm] r79977 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Support/ lib/Analysis/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/PIC16/ lib/Transforms/IPO/ lib/Transforms/Utils/ lib/VMCore/ test/DebugInfo/ test/FrontendC++/ test/FrontendObjC/ test/Transforms/SimplifyCFG/ Message-ID: <200908250524.n7P5O9P5007625@zion.cs.uiuc.edu> Author: dpatel Date: Tue Aug 25 00:24:07 2009 New Revision: 79977 URL: http://llvm.org/viewvc/llvm-project?rev=79977&view=rev Log: Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well. This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!) Removed: llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll llvm/trunk/test/DebugInfo/2009-01-30-Method.ll llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll llvm/trunk/test/DebugInfo/2009-03-02-sink.ll llvm/trunk/test/DebugInfo/dataOnly.ll llvm/trunk/test/DebugInfo/forwardDecl.ll llvm/trunk/test/DebugInfo/printdbginfo.ll llvm/trunk/test/DebugInfo/printdbginfo2.ll llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m Modified: llvm/trunk/docs/SourceLevelDebugging.html llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/include/llvm/AutoUpgrade.h llvm/trunk/include/llvm/CodeGen/DwarfWriter.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/include/llvm/IntrinsicInst.h llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/include/llvm/Metadata.h llvm/trunk/include/llvm/Support/DebugLoc.h llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp llvm/trunk/lib/Analysis/DebugInfo.cpp llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp llvm/trunk/lib/VMCore/AutoUpgrade.cpp llvm/trunk/lib/VMCore/Metadata.cpp llvm/trunk/lib/VMCore/ValueTypes.cpp llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll Modified: llvm/trunk/docs/SourceLevelDebugging.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.html?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/docs/SourceLevelDebugging.html (original) +++ llvm/trunk/docs/SourceLevelDebugging.html Tue Aug 25 00:24:07 2009 @@ -122,8 +122,8 @@

The approach used by the LLVM implementation is to use a small set of intrinsic functions to define a mapping between LLVM program objects and the source-level objects. The - description of the source-level program is maintained in LLVM global - variables in an implementation-defined format + description of the source-level program is maintained in LLVM metadata + in an implementation-defined format (the C/C++ front-end currently uses working draft 7 of the DWARF 3 standard).

@@ -240,31 +240,21 @@

LLVM debugging information has been carefully designed to make it possible for the optimizer to optimize the program and debugging information without necessarily having to know anything about debugging information. In - particular, the global constant merging pass automatically eliminates - duplicated debugging information (often caused by header files), the global - dead code elimination pass automatically deletes debugging information for a - function if it decides to delete the function, and the linker eliminates - debug information when it merges linkonce functions.

+ particular, te use of metadadta avoids duplicated dubgging information from + the beginning, and the global dead code elimination pass automatically + deletes debugging information for a function if it decides to delete the + function.

To do this, most of the debugging information (descriptors for types, variables, functions, source files, etc) is inserted by the language - front-end in the form of LLVM global variables. These LLVM global variables - are no different from any other global variables, except that they have a web - of LLVM intrinsic functions that point to them. If the last references to a - particular piece of debugging information are deleted (for example, by the - -globaldce pass), the extraneous debug information will - automatically become dead and be removed by the optimizer.

+ front-end in the form of LLVM metadata.

Debug information is designed to be agnostic about the target debugger and debugging information representation (e.g. DWARF/Stabs/etc). It uses a - generic machine debug information pass to decode the information that - represents variables, types, functions, namespaces, etc: this allows for - arbitrary source-language semantics and type-systems to be used, as long as - there is a module written for the target debugger to interpret the - information. In addition, debug global variables are declared in - the "llvm.metadata" section. All values declared in this section - are stripped away after target debug information is constructed and before - the program object is emitted.

+ generic pass to decode the information that represents variables, types, + functions, namespaces, etc: this allows for arbitrary source-language + semantics and type-systems to be used, as long as there is a module + written for the target debugger to interpret the information.

To provide basic functionality, the LLVM debugger does have to make some assumptions about the source-level language being debugged, though it keeps @@ -288,9 +278,7 @@

In consideration of the complexity and volume of debug information, LLVM - provides a specification for well formed debug global variables. The - constant value of each of these globals is one of a limited set of - structures, known as debug descriptors.

+ provides a specification for well formed debug descriptors.

Consumers of LLVM debug information expect the descriptors for program objects to start in a canonical format, but the descriptors can include @@ -303,17 +291,14 @@ the range 0x1000 thru 0x2000 (there is a defined enum DW_TAG_user_base = 0x1000.)

-

The fields of debug descriptors used internally by LLVM (MachineModuleInfo) +

The fields of debug descriptors used internally by LLVM are restricted to only the simple data types int, uint, - bool, float, double, i8* and - { }*. References to arbitrary values are handled using a - { }* and a cast to { }* expression; typically - references to other field descriptors, arrays of descriptors or global - variables.

+ bool, float, double, mdstring and + mdnode.

-%llvm.dbg.object.type = type {
+!1 = metadata !{
   uint,   ;; A tag
   ...
 }
@@ -326,8 +311,8 @@
    of tags are loosely bound to the tag values of DWARF information entries.
    However, that does not restrict the use of the information supplied to DWARF
    targets.  To facilitate versioning of debug information, the tag is augmented
-   with the current debug version (LLVMDebugVersion = 4 << 16 or 0x40000 or
-   262144.)

+ with the current debug version (LLVMDebugVersion = 7 << 16 or 0x70000 or + 458752.)

The details of the various descriptors follow.

@@ -342,17 +327,18 @@
-%llvm.dbg.compile_unit.type = type {
-  i32,    ;; Tag = 17 + LLVMDebugVersion (DW_TAG_compile_unit)
-  {  }*,  ;; Compile unit anchor = cast = (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to {  }*)
-  i32,    ;; DWARF language identifier (ex. DW_LANG_C89) 
-  i8*,    ;; Source file name
-  i8*,    ;; Source file directory (includes trailing slash)
-  i8*     ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
-  i1,     ;; True if this is a main compile unit. 
-  i1,     ;; True if this is optimized.
-  i8*,    ;; Flags
-  i32     ;; Runtime version
+!0 = metadata !{
+  i32,       ;; Tag = 17 + LLVMDebugVersion 
+             ;; (DW_TAG_compile_unit)
+  i32,       ;; Unused field. 
+  i32,       ;; DWARF language identifier (ex. DW_LANG_C89) 
+  metadata,  ;; Source file name
+  metadata,  ;; Source file directory (includes trailing slash)
+  metadata   ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
+  i1,        ;; True if this is a main compile unit. 
+  i1,        ;; True if this is optimized.
+  metadata,  ;; Flags
+  i32        ;; Runtime version
 }
 
@@ -388,19 +374,20 @@
-%llvm.dbg.global_variable.type = type {
-  i32,    ;; Tag = 52 + LLVMDebugVersion (DW_TAG_variable)
-  {  }*,  ;; Global variable anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to {  }*),  
-  {  }*,  ;; Reference to context descriptor
-  i8*,    ;; Name
-  i8*,    ;; Display name (fully qualified C++ name)
-  i8*,    ;; MIPS linkage name (for C++)
-  {  }*,  ;; Reference to compile unit where defined
-  i32,    ;; Line number where defined
-  {  }*,  ;; Reference to type descriptor
-  i1,     ;; True if the global is local to compile unit (static)
-  i1,     ;; True if the global is defined in the compile unit (not extern)
-  {  }*   ;; Reference to the global variable
+!1 = metadata !{
+  i32,      ;; Tag = 52 + LLVMDebugVersion 
+            ;; (DW_TAG_variable)
+  i32,      ;; Unused field.
+  metadata, ;; Reference to context descriptor
+  metadata, ;; Name
+  metadata, ;; Display name (fully qualified C++ name)
+  metadata, ;; MIPS linkage name (for C++)
+  metadata, ;; Reference to compile unit where defined
+  i32,      ;; Line number where defined
+  metadata, ;; Reference to type descriptor
+  i1,       ;; True if the global is local to compile unit (static)
+  i1,       ;; True if the global is defined in the compile unit (not extern)
+  {  }*     ;; Reference to the global variable
 }
 
@@ -419,18 +406,19 @@
-%llvm.dbg.subprogram.type = type {
-  i32,    ;; Tag = 46 + LLVMDebugVersion (DW_TAG_subprogram)
-  {  }*,  ;; Subprogram anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to {  }*),  
-  {  }*,  ;; Reference to context descriptor
-  i8*,    ;; Name
-  i8*,    ;; Display name (fully qualified C++ name)
-  i8*,    ;; MIPS linkage name (for C++)
-  {  }*,  ;; Reference to compile unit where defined
-  i32,    ;; Line number where defined
-  {  }*,  ;; Reference to type descriptor
-  i1,     ;; True if the global is local to compile unit (static)
-  i1      ;; True if the global is defined in the compile unit (not extern)
+!2 = metadata !{
+  i32,      ;; Tag = 46 + LLVMDebugVersion
+            ;; (DW_TAG_subprogram)
+  i32,      ;; Unused field.
+  metadata, ;; Reference to context descriptor
+  metadata, ;; Name
+  metadata, ;; Display name (fully qualified C++ name)
+  metadata, ;; MIPS linkage name (for C++)
+  metadata, ;; Reference to compile unit where defined
+  i32,      ;; Line number where defined
+  metadata, ;; Reference to type descriptor
+  i1,       ;; True if the global is local to compile unit (static)
+  i1        ;; True if the global is defined in the compile unit (not extern)
 }
 
@@ -450,9 +438,9 @@
-%llvm.dbg.block = type {
-  i32,    ;; Tag = 13 + LLVMDebugVersion (DW_TAG_lexical_block)
-  {  }*   ;; Reference to context descriptor
+!3 = metadata !{
+  i32,     ;; Tag = 13 + LLVMDebugVersion (DW_TAG_lexical_block)
+  metadata ;; Reference to context descriptor
 }
 
@@ -472,17 +460,18 @@
-%llvm.dbg.basictype.type = type {
-  i32,    ;; Tag = 36 + LLVMDebugVersion (DW_TAG_base_type)
-  {  }*,  ;; Reference to context (typically a compile unit)
-  i8*,    ;; Name (may be "" for anonymous types)
-  {  }*,  ;; Reference to compile unit where defined (may be NULL)
-  i32,    ;; Line number where defined (may be 0)
-  i64,    ;; Size in bits
-  i64,    ;; Alignment in bits
-  i64,    ;; Offset in bits
-  i32,    ;; Flags
-  i32     ;; DWARF type encoding
+!4 = metadata !{
+  i32,      ;; Tag = 36 + LLVMDebugVersion 
+            ;; (DW_TAG_base_type)
+  metadata, ;; Reference to context (typically a compile unit)
+  metadata, ;; Name (may be "" for anonymous types)
+  metadata, ;; Reference to compile unit where defined (may be NULL)
+  i32,      ;; Line number where defined (may be 0)
+  i64,      ;; Size in bits
+  i64,      ;; Alignment in bits
+  i64,      ;; Offset in bits
+  i32,      ;; Flags
+  i32       ;; DWARF type encoding
 }
 
@@ -523,16 +512,16 @@
-%llvm.dbg.derivedtype.type = type {
-  i32,    ;; Tag (see below)
-  {  }*,  ;; Reference to context
-  i8*,    ;; Name (may be "" for anonymous types)
-  {  }*,  ;; Reference to compile unit where defined (may be NULL)
-  i32,    ;; Line number where defined (may be 0)
-  i32,    ;; Size in bits
-  i32,    ;; Alignment in bits
-  i32,    ;; Offset in bits
-  {  }*   ;; Reference to type derived from
+!5 = metadata !{
+  i32,      ;; Tag (see below)
+  metadata, ;; Reference to context
+  metadata, ;; Name (may be "" for anonymous types)
+  metadata, ;; Reference to compile unit where defined (may be NULL)
+  i32,      ;; Line number where defined (may be 0)
+  i32,      ;; Size in bits
+  i32,      ;; Alignment in bits
+  i32,      ;; Offset in bits
+  metadata  ;; Reference to type derived from
 }
 
@@ -591,19 +580,19 @@
-%llvm.dbg.compositetype.type = type {
-  i32,    ;; Tag (see below)
-  {  }*,  ;; Reference to context
-  i8*,    ;; Name (may be "" for anonymous types)
-  {  }*,  ;; Reference to compile unit where defined (may be NULL)
-  i32,    ;; Line number where defined (may be 0)
-  i64,    ;; Size in bits
-  i64,    ;; Alignment in bits
-  i64,    ;; Offset in bits
-  i32,    ;; Flags
-  {  }*,  ;; Reference to type derived from
-  {  }*,  ;; Reference to array of member descriptors
-  i32     ;; Runtime languages
+!6 = metadata !{
+  i32,      ;; Tag (see below)
+  metadata, ;; Reference to context
+  metadata, ;; Name (may be "" for anonymous types)
+  metadata, ;; Reference to compile unit where defined (may be NULL)
+  i32,      ;; Line number where defined (may be 0)
+  i64,      ;; Size in bits
+  i64,      ;; Alignment in bits
+  i64,      ;; Offset in bits
+  i32,      ;; Flags
+  metadata, ;; Reference to type derived from
+  metadata, ;; Reference to array of member descriptors
+  i32       ;; Runtime languages
 }
 
@@ -702,10 +691,11 @@
-%llvm.dbg.enumerator.type = type {
-  i32,    ;; Tag = 40 + LLVMDebugVersion (DW_TAG_enumerator)
-  i8*,    ;; Name
-  i64     ;; Value
+!6 = metadata !{
+  i32,      ;; Tag = 40 + LLVMDebugVersion 
+            ;; (DW_TAG_enumerator)
+  metadata, ;; Name
+  i64       ;; Value
 }
 
@@ -725,13 +715,13 @@
-%llvm.dbg.variable.type = type {
-  i32,     ;; Tag (see below)
-  {  }*,   ;; Context
-  i8*,     ;; Name
-  {  }*,   ;; Reference to compile unit where defined
-  i32,     ;; Line number where defined
-  {  }*    ;; Type descriptor
+!7 = metadata !{
+  i32,      ;; Tag (see below)
+  metadata, ;; Context
+  metadata, ;; Name
+  metadata, ;; Reference to compile unit where defined
+  i32,      ;; Line number where defined
+  metadata  ;; Type descriptor
 }
 
@@ -778,14 +768,14 @@
-  void %llvm.dbg.stoppoint( uint, uint, { }* )
+  void %llvm.dbg.stoppoint( uint, uint, metadata)
 

This intrinsic is used to provide correspondence between the source file and the generated code. The first argument is the line number (base 1), second argument is the column number (0 if unknown) and the third argument the - source %llvm.dbg.compile_unit* - cast to a { }*. Code following a call to this intrinsic will + source %llvm.dbg.compile_unit. + Code following a call to this intrinsic will have been defined in close proximity of the line, column and file. This information holds until the next call to %lvm.dbg.stoppoint.

@@ -799,7 +789,7 @@
-  void %llvm.dbg.func.start( { }* )
+  void %llvm.dbg.func.start( metadata )
 

This intrinsic is used to link the debug information @@ -823,7 +813,7 @@

-  void %llvm.dbg.region.start( { }* )
+  void %llvm.dbg.region.start( metadata )
 

This intrinsic is used to define the beginning of a declarative scope (ex. @@ -843,7 +833,7 @@

-  void %llvm.dbg.region.end( { }* )
+  void %llvm.dbg.region.end( metadata )
 

This intrinsic is used to define the end of a declarative scope (ex. block) @@ -864,14 +854,14 @@

-  void %llvm.dbg.declare( { } *, { }* )
+  void %llvm.dbg.declare( { } *, metadata )
 

This intrinsic provides information about a local element (ex. variable.) The first argument is the alloca for the variable, cast to a { }*. The second argument is the %llvm.dbg.variable containing - the description of the variable, also cast to a { }*.

+ the description of the variable.

@@ -955,29 +945,29 @@ ... - call void @llvm.dbg.func.start( %llvm.dbg.subprogram.type* @llvm.dbg.subprogram ) + call void @llvm.dbg.func.start( metadata !0) - call void @llvm.dbg.stoppoint( uint 2, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) + call void @llvm.dbg.stoppoint( uint 2, uint 2, metadata !1) call void @llvm.dbg.declare({}* %X, ...) call void @llvm.dbg.declare({}* %Y, ...) ;; Evaluate expression on line 2, assigning to X. - call void @llvm.dbg.stoppoint( uint 3, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) + call void @llvm.dbg.stoppoint( uint 3, uint 2, metadata !1) ;; Evaluate expression on line 3, assigning to Y. call void @llvm.region.start() - call void @llvm.dbg.stoppoint( uint 5, uint 4, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) + call void @llvm.dbg.stoppoint( uint 5, uint 4, metadata !1) call void @llvm.dbg.declare({}* %X, ...) ;; Evaluate expression on line 5, assigning to Z. - call void @llvm.dbg.stoppoint( uint 7, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) + call void @llvm.dbg.stoppoint( uint 7, uint 2, metadata !1) call void @llvm.region.end() - call void @llvm.dbg.stoppoint( uint 9, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) + call void @llvm.dbg.stoppoint( uint 9, uint 2, metadata !1) call void @llvm.region.end() @@ -1097,50 +1087,35 @@
 ...
 ;;
-;; Define types used.  In this case we need one for compile unit anchors and one
-;; for compile units.
-;;
-%llvm.dbg.anchor.type = type { uint, uint }
-%llvm.dbg.compile_unit.type = type { uint, {  }*, uint, uint, i8*, i8*, i8* }
-...
-;;
-;; Define the anchor for compile units.  Note that the second field of the
-;; anchor is 17, which is the same as the tag for compile units
-;; (17 = DW_TAG_compile_unit.)
-;;
-%llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { uint 0, uint 17 }, section "llvm.metadata"
-
-;;
 ;; Define the compile unit for the source file "/Users/mine/sources/MySource.cpp".
 ;;
-%llvm.dbg.compile_unit1 = internal constant %llvm.dbg.compile_unit.type {
-    uint add(uint 17, uint 262144), 
-    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to {  }*), 
-    uint 1, 
-    uint 1, 
-    i8* getelementptr ([13 x i8]* %str1, i32 0, i32 0), 
-    i8* getelementptr ([21 x i8]* %str2, i32 0, i32 0), 
-    i8* getelementptr ([33 x i8]* %str3, i32 0, i32 0) }, section "llvm.metadata"
-    
+!3 = metadata !{
+  i32 458769,    ;; Tag
+  i32 0,         ;; Unused
+  i32 4,         ;; Language Id
+  metadata !"MySource.cpp", 
+  metadata !"/Users/mine/sources", 
+  metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)", 
+  i1 true,       ;; Main Compile Unit
+  i1 false,      ;; Optimized compile unit
+  metadata !"",  ;; Compiler flags
+  i32 0}         ;; Runtime version
+
 ;;
 ;; Define the compile unit for the header file "/Users/mine/sources/MyHeader.h".
 ;;
-%llvm.dbg.compile_unit2 = internal constant %llvm.dbg.compile_unit.type {
-    uint add(uint 17, uint 262144), 
-    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to {  }*), 
-    uint 1, 
-    uint 1, 
-    i8* getelementptr ([11 x i8]* %str4, int 0, int 0), 
-    i8* getelementptr ([21 x i8]* %str2, int 0, int 0), 
-    i8* getelementptr ([33 x i8]* %str3, int 0, int 0) }, section "llvm.metadata"
-
-;;
-;; Define each of the strings used in the compile units.
-;;
-%str1 = internal constant [13 x i8] c"MySource.cpp\00", section "llvm.metadata";
-%str2 = internal constant [21 x i8] c"/Users/mine/sources/\00", section "llvm.metadata";
-%str3 = internal constant [33 x i8] c"4.0.1 LLVM (LLVM research group)\00", section "llvm.metadata";
-%str4 = internal constant [11 x i8] c"MyHeader.h\00", section "llvm.metadata";
+!1 = metadata !{
+  i32 458769,    ;; Tag
+  i32 0,         ;; Unused
+  i32 4,         ;; Language Id
+  metadata !"MyHeader.h", 
+  metadata !"/Users/mine/sources", 
+  metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)", 
+  i1 false,      ;; Main Compile Unit
+  i1 false,      ;; Optimized compile unit
+  metadata !"",  ;; Compiler flags
+  i32 0}         ;; Runtime version
+
 ...
 
@@ -1167,65 +1142,51 @@
 ;;
-;; Define types used. One for global variable anchors, one for the global
-;; variable descriptor, one for the global's basic type and one for the global's
-;; compile unit.
-;;
-%llvm.dbg.anchor.type = type { uint, uint }
-%llvm.dbg.global_variable.type = type { uint, {  }*, {  }*, i8*, {  }*, uint, {  }*, bool, bool, {  }*, uint }
-%llvm.dbg.basictype.type = type { uint, {  }*, i8*, {  }*, int, uint, uint, uint, uint }
-%llvm.dbg.compile_unit.type = ...
-...
-;;
 ;; Define the global itself.
 ;;
 %MyGlobal = global int 100
 ...
 ;;
-;; Define the anchor for global variables.  Note that the second field of the
-;; anchor is 52, which is the same as the tag for global variables
-;; (52 = DW_TAG_variable.)
+;; List of debug info of globals
 ;;
-%llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { uint 0, uint 52 }, section "llvm.metadata"
+!llvm.dbg.gv = !{!0}
 
 ;;
 ;; Define the global variable descriptor.  Note the reference to the global
 ;; variable anchor and the global variable itself.
 ;;
-%llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
-    uint add(uint 52, uint 262144), 
-    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to {  }*), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([9 x i8]* %str1, int 0, int 0), 
-    i8* getelementptr ([1 x i8]* %str2, int 0, int 0), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    uint 1,
-    {  }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to {  }*), 
-    bool false, 
-    bool true, 
-    {  }* cast (int* %MyGlobal to {  }*) }, section "llvm.metadata"
-    
+!0 = metadata !{
+  i32 458804,              ;; Tag
+  i32 0,                   ;; Unused
+  metadata !1,             ;; Context
+  metadata !"MyGlobal",    ;; Name
+  metadata !"MyGlobal",    ;; Display Name
+  metadata !"MyGlobal",    ;; Linkage Name
+  metadata !1,             ;; Compile Unit
+  i32 1,                   ;; Line Number
+  metadata !2,             ;; Type
+  i1 false,                ;; Is a local variable
+  i1 true,                 ;; Is this a definition
+  i32* @MyGlobal           ;; The global variable
+}
+
 ;;
 ;; Define the basic type of 32 bit signed integer.  Note that since int is an
 ;; intrinsic type the source file is NULL and line 0.
 ;;    
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([4 x i8]* %str3, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 32, 
-    uint 32, 
-    uint 0, 
-    uint 5 }, section "llvm.metadata"
-
-;;
-;; Define the names of the global variable and basic type.
-;;
-%str1 = internal constant [9 x i8] c"MyGlobal\00", section "llvm.metadata"
-%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
-%str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,              ;; Tag
+  metadata !1,             ;; Context
+  metadata !"int",         ;; Name
+  metadata !1,             ;; Compile Unit
+  i32 0,                   ;; Line number
+  i64 32,                  ;; Size in Bits
+  i64 32,                  ;; Align in Bits
+  i64 0,                   ;; Offset in Bits
+  i32 0,                   ;; Flags
+  i32 5                    ;; Encoding
+}
+
 
@@ -1253,46 +1214,27 @@
 ;;
-;; Define types used. One for subprogram anchors, one for the subprogram
-;; descriptor, one for the global's basic type and one for the subprogram's
-;; compile unit.
-;;
-%llvm.dbg.subprogram.type = type { uint, {  }*, {  }*, i8*, {  }*, bool, bool }
-%llvm.dbg.anchor.type = type { uint, uint }
-%llvm.dbg.compile_unit.type = ...
-	
-;;
 ;; Define the anchor for subprograms.  Note that the second field of the
 ;; anchor is 46, which is the same as the tag for subprograms
 ;; (46 = DW_TAG_subprogram.)
 ;;
-%llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { uint 0, uint 46 }, section "llvm.metadata"
-
-;;
-;; Define the descriptor for the subprogram.  TODO - more details.
-;;
-%llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type {
-    uint add(uint 46, uint 262144), 
-    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to {  }*), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([5 x i8]* %str1, int 0, int 0), 
-    i8* getelementptr ([1 x i8]* %str2, int 0, int 0), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*),
-    uint 1,
-    {  }* null, 
-    bool false, 
-    bool true }, section "llvm.metadata"
-
-;;
-;; Define the name of the subprogram.
-;;
-%str1 = internal constant [5 x i8] c"main\00", section "llvm.metadata"
-%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
-
+!0 = metadata !{
+  i32 458798,        ;; Tag
+  i32 0,             ;; Unused
+  metadata !1,       ;; Context
+  metadata !"main",  ;; Name
+  metadata !"main",  ;; Display name
+  metadata !"main",  ;; Linkage name
+  metadata !1,       ;; Compile unit
+  i32 1,             ;; Line number
+  metadata !2,       ;; Type
+  i1 false,          ;; Is local 
+  i1 true            ;; Is definition
+}
 ;;
 ;; Define the subprogram itself.
 ;;
-int %main(int %argc, i8** %argv) {
+define i32 @main(i32 %argc, i8** %argv) {
 ...
 }
 
@@ -1320,17 +1262,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([5 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 32, 
-    uint 32, 
-    uint 0, 
-    uint 2 }, section "llvm.metadata"
-%str1 = internal constant [5 x i8] c"bool\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"bool",  ;; Name
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 8,             ;; Size in Bits
+  i64 8,             ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 2              ;; Encoding
+}
 
@@ -1345,17 +1288,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([5 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 8, 
-    uint 8, 
-    uint 0, 
-    uint 6 }, section "llvm.metadata"
-%str1 = internal constant [5 x i8] c"char\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"char",  ;; Name
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 8,             ;; Size in Bits
+  i64 8,             ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 6              ;; Encoding
+}
 
@@ -1370,17 +1314,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([14 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 8, 
-    uint 8, 
-    uint 0, 
-    uint 8 }, section "llvm.metadata"
-%str1 = internal constant [14 x i8] c"unsigned char\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"unsigned char", 
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 8,             ;; Size in Bits
+  i64 8,             ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 8              ;; Encoding
+}
 
@@ -1395,17 +1340,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([10 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 16, 
-    uint 16, 
-    uint 0, 
-    uint 5 }, section "llvm.metadata"
-%str1 = internal constant [10 x i8] c"short int\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"short int",
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 16,            ;; Size in Bits
+  i64 16,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 5              ;; Encoding
+}
 
@@ -1420,17 +1366,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([19 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 16, 
-    uint 16, 
-    uint 0, 
-    uint 7 }, section "llvm.metadata"
-%str1 = internal constant [19 x i8] c"short unsigned int\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"short unsigned int",
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 16,            ;; Size in Bits
+  i64 16,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 7              ;; Encoding
+}
 
@@ -1445,17 +1392,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([4 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 32, 
-    uint 32, 
-    uint 0, 
-    uint 5 }, section "llvm.metadata"
-%str1 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"int",   ;; Name
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 32,            ;; Size in Bits
+  i64 32,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 5              ;; Encoding
+}
 
@@ -1469,17 +1417,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([13 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 32, 
-    uint 32, 
-    uint 0, 
-    uint 7 }, section "llvm.metadata"
-%str1 = internal constant [13 x i8] c"unsigned int\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"unsigned int",
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 32,            ;; Size in Bits
+  i64 32,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 7              ;; Encoding
+}
 
@@ -1494,17 +1443,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([14 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 64, 
-    uint 64, 
-    uint 0, 
-    uint 5 }, section "llvm.metadata"
-%str1 = internal constant [14 x i8] c"long long int\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"long long int",
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 64,            ;; Size in Bits
+  i64 64,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 5              ;; Encoding
+}
 
@@ -1519,17 +1469,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([23 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 64, 
-    uint 64, 
-    uint 0, 
-    uint 7 }, section "llvm.metadata"
-%str1 = internal constant [23 x 8] c"long long unsigned int\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"long long unsigned int",
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 64,            ;; Size in Bits
+  i64 64,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 7              ;; Encoding
+}
 
@@ -1544,17 +1495,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    i8* getelementptr ([6 x i8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 32, 
-    uint 32, 
-    uint 0, 
-    uint 4 }, section "llvm.metadata"
-%str1 = internal constant [6 x i8] c"float\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"float",
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 32,            ;; Size in Bits
+  i64 32,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 4              ;; Encoding
+}
 
@@ -1569,17 +1521,18 @@
-%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
-    uint add(uint 36, uint 262144), 
-    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
-    8* getelementptr ([7 x 8]* %str1, int 0, int 0), 
-    {  }* null, 
-    int 0, 
-    uint 64, 
-    uint 64, 
-    uint 0, 
-    uint 4 }, section "llvm.metadata"
-%str1 = internal constant [7 x 8] c"double\00", section "llvm.metadata"
+!2 = metadata !{
+  i32 458788,        ;; Tag
+  metadata !1,       ;; Context
+  metadata !"double",;; Name
+  metadata !1,       ;; Compile Unit
+  i32 0,             ;; Line number
+  i64 64,            ;; Size in Bits
+  i64 64,            ;; Align in Bits
+  i64 0,             ;; Offset in Bits
+  i32 0,             ;; Flags
+  i32 4              ;; Encoding
+}
 
@@ -1607,60 +1560,64 @@ ;; ;; Define the typedef "IntPtr". ;; -%llvm.dbg.derivedtype1 = internal constant %llvm.dbg.derivedtype.type { - uint add(uint 22, uint 262144), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - i8* getelementptr ([7 x 8]* %str1, int 0, int 0), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - int 1, - uint 0, - uint 0, - uint 0, - { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype2 to { }*) }, section "llvm.metadata" -%str1 = internal constant [7 x 8] c"IntPtr\00", section "llvm.metadata" +!2 = metadata !{ + i32 458774, ;; Tag + metadata !1, ;; Context + metadata !"IntPtr", ;; Name + metadata !3, ;; Compile unit + i32 0, ;; Line number + i64 0, ;; Size in bits + i64 0, ;; Align in bits + i64 0, ;; Offset in bits + i32 0, ;; Flags + metadata !4 ;; Derived From type +} ;; ;; Define the pointer type. ;; -%llvm.dbg.derivedtype2 = internal constant %llvm.dbg.derivedtype.type { - uint add(uint 15, uint 262144), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - i8* null, - { }* null, - int 0, - uint 32, - uint 32, - uint 0, - { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype3 to { }*) }, section "llvm.metadata" - +!4 = metadata !{ + i32 458767, ;; Tag + metadata !1, ;; Context + metadata !"", ;; Name + metadata !1, ;; Compile unit + i32 0, ;; Line number + i64 64, ;; Size in bits + i64 64, ;; Align in bits + i64 0, ;; Offset in bits + i32 0, ;; Flags + metadata !5 ;; Derived From type +} ;; ;; Define the const type. ;; -%llvm.dbg.derivedtype3 = internal constant %llvm.dbg.derivedtype.type { - uint add(uint 38, uint 262144), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - i8* null, - { }* null, - int 0, - uint 0, - uint 0, - uint 0, - { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype1 to { }*) }, section "llvm.metadata" - +!5 = metadata !{ + i32 458790, ;; Tag + metadata !1, ;; Context + metadata !"", ;; Name + metadata !1, ;; Compile unit + i32 0, ;; Line number + i64 32, ;; Size in bits + i64 32, ;; Align in bits + i64 0, ;; Offset in bits + i32 0, ;; Flags + metadata !6 ;; Derived From type +} ;; ;; Define the int type. ;; -%llvm.dbg.basictype1 = internal constant %llvm.dbg.basictype.type { - uint add(uint 36, uint 262144), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - 8* getelementptr ([4 x 8]* %str2, int 0, int 0), - { }* null, - int 0, - uint 32, - uint 32, - uint 0, - uint 5 }, section "llvm.metadata" -%str2 = internal constant [4 x 8] c"int\00", section "llvm.metadata" +!6 = metadata !{ + i32 458788, ;; Tag + metadata !1, ;; Context + metadata !"int", ;; Name + metadata !1, ;; Compile unit + i32 0, ;; Line number + i64 32, ;; Size in bits + i64 32, ;; Align in bits + i64 0, ;; Offset in bits + i32 0, ;; Flags + 5 ;; Encoding +}
@@ -1692,86 +1649,88 @@ ;; ;; Define basic type for unsigned int. ;; -%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { - uint add(uint 36, uint 262144), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - i8* getelementptr ([13 x i8]* %str1, int 0, int 0), - { }* null, - int 0, - uint 32, - uint 32, - uint 0, - uint 7 }, section "llvm.metadata" -%str1 = internal constant [13 x i8] c"unsigned int\00", section "llvm.metadata" - +!5 = metadata !{ + i32 458788, ;; Tag + metadata !1, ;; Context + metadata !"unsigned int", + metadata !1, ;; Compile Unit + i32 0, ;; Line number + i64 32, ;; Size in Bits + i64 32, ;; Align in Bits + i64 0, ;; Offset in Bits + i32 0, ;; Flags + i32 7 ;; Encoding +} ;; ;; Define composite type for struct Color. ;; -%llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type { - uint add(uint 19, uint 262144), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - i8* getelementptr ([6 x i8]* %str2, int 0, int 0), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - int 1, - uint 96, - uint 32, - uint 0, - { }* null, - { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata" -%str2 = internal constant [6 x i8] c"Color\00", section "llvm.metadata" +!2 = metadata !{ + i32 458771, ;; Tag + metadata !1, ;; Context + metadata !"Color", ;; Name + metadata !1, ;; Compile unit + i32 1, ;; Line number + i64 96, ;; Size in bits + i64 32, ;; Align in bits + i64 0, ;; Offset in bits + i32 0, ;; Flags + null, ;; Derived From + metadata !3, ;; Elements + i32 0 ;; Runtime Language +} ;; ;; Define the Red field. ;; -%llvm.dbg.derivedtype1 = internal constant %llvm.dbg.derivedtype.type { - uint add(uint 13, uint 262144), - { }* null, - i8* getelementptr ([4 x i8]* %str3, int 0, int 0), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - int 2, - uint 32, - uint 32, - uint 0, - { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*) }, section "llvm.metadata" -%str3 = internal constant [4 x i8] c"Red\00", section "llvm.metadata" +!4 = metadata !{ + i32 458765, ;; Tag + metadata !1, ;; Context + metadata !"Red", ;; Name + metadata !1, ;; Compile Unit + i32 2, ;; Line number + i64 32, ;; Size in bits + i64 32, ;; Align in bits + i64 0, ;; Offset in bits + i32 0, ;; Flags + metadata !5 ;; Derived From type +} ;; ;; Define the Green field. ;; -%llvm.dbg.derivedtype2 = internal constant %llvm.dbg.derivedtype.type { - uint add(uint 13, uint 262144), - { }* null, - i8* getelementptr ([6 x i8]* %str4, int 0, int 0), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - int 3, - uint 32, - uint 32, - uint 32, - { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*) }, section "llvm.metadata" -%str4 = internal constant [6 x i8] c"Green\00", section "llvm.metadata" +!6 = metadata !{ + i32 458765, ;; Tag + metadata !1, ;; Context + metadata !"Green", ;; Name + metadata !1, ;; Compile Unit + i32 3, ;; Line number + i64 32, ;; Size in bits + i64 32, ;; Align in bits + i64 32, ;; Offset in bits + i32 0, ;; Flags + metadata !5 ;; Derived From type +} ;; ;; Define the Blue field. ;; -%llvm.dbg.derivedtype3 = internal constant %llvm.dbg.derivedtype.type { - uint add(uint 13, uint 262144), - { }* null, - i8* getelementptr ([5 x i8]* %str5, int 0, int 0), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - int 4, - uint 32, - uint 32, - uint 64, - { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*) }, section "llvm.metadata" -%str5 = internal constant [5 x 8] c"Blue\00", section "llvm.metadata" +!7 = metadata !{ + i32 458765, ;; Tag + metadata !1, ;; Context + metadata !"Blue", ;; Name + metadata !1, ;; Compile Unit + i32 4, ;; Line number + i64 32, ;; Size in bits + i64 32, ;; Align in bits + i64 64, ;; Offset in bits + i32 0, ;; Flags + metadata !5 ;; Derived From type +} ;; ;; Define the array of fields used by the composite type Color. ;; -%llvm.dbg.array = internal constant [3 x { }*] [ - { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype1 to { }*), - { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype2 to { }*), - { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype3 to { }*) ], section "llvm.metadata" +!3 = metadata !{metadata !4, metadata !6, metadata !7}
@@ -1803,53 +1762,41 @@ ;; ;; Define composite type for enum Trees ;; -%llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type { - uint add(uint 4, uint 262144), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - i8* getelementptr ([6 x i8]* %str1, int 0, int 0), - { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - int 1, - uint 32, - uint 32, - uint 0, - { }* null, - { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata" -%str1 = internal constant [6 x i8] c"Trees\00", section "llvm.metadata" +!2 = metadata !{ + i32 458756, ;; Tag + metadata !1, ;; Context + metadata !"Trees", ;; Name + metadata !1, ;; Compile unit + i32 1, ;; Line number + i64 32, ;; Size in bits + i64 32, ;; Align in bits + i64 0, ;; Offset in bits + i32 0, ;; Flags + null, ;; Derived From type + metadata !3, ;; Elements + i32 0 ;; Runtime language +} + +;; +;; Define the array of enumerators used by composite type Trees. +;; +!3 = metadata !{metadata !4, metadata !5, metadata !6} ;; ;; Define Spruce enumerator. ;; -%llvm.dbg.enumerator1 = internal constant %llvm.dbg.enumerator.type { - uint add(uint 40, uint 262144), - i8* getelementptr ([7 x i8]* %str2, int 0, int 0), - int 100 }, section "llvm.metadata" -%str2 = internal constant [7 x i8] c"Spruce\00", section "llvm.metadata" +!4 = metadata !{i32 458792, metadata !"Spruce", i64 100} ;; ;; Define Oak enumerator. ;; -%llvm.dbg.enumerator2 = internal constant %llvm.dbg.enumerator.type { - uint add(uint 40, uint 262144), - i8* getelementptr ([4 x i8]* %str3, int 0, int 0), - int 200 }, section "llvm.metadata" -%str3 = internal constant [4 x i8] c"Oak\00", section "llvm.metadata" +!5 = metadata !{i32 458792, metadata !"Oak", i64 200} ;; ;; Define Maple enumerator. ;; -%llvm.dbg.enumerator3 = internal constant %llvm.dbg.enumerator.type { - uint add(uint 40, uint 262144), - i8* getelementptr ([6 x i8]* %str4, int 0, int 0), - int 300 }, section "llvm.metadata" -%str4 = internal constant [6 x i8] c"Maple\00", section "llvm.metadata" +!6 = metadata !{i32 458792, metadata !"Maple", i64 300} -;; -;; Define the array of enumerators used by composite type Trees. -;; -%llvm.dbg.array = internal constant [3 x { }*] [ - { }* cast (%llvm.dbg.enumerator.type* %llvm.dbg.enumerator1 to { }*), - { }* cast (%llvm.dbg.enumerator.type* %llvm.dbg.enumerator2 to { }*), - { }* cast (%llvm.dbg.enumerator.type* %llvm.dbg.enumerator3 to { }*) ], section "llvm.metadata" Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Aug 25 00:24:07 2009 @@ -17,6 +17,7 @@ #ifndef LLVM_ANALYSIS_DEBUGINFO_H #define LLVM_ANALYSIS_DEBUGINFO_H +#include "llvm/Metadata.h" #include "llvm/Target/TargetMachine.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/DenseMap.h" @@ -44,12 +45,12 @@ class DIDescriptor { protected: - GlobalVariable *DbgGV; + MDNode *DbgNode; - /// DIDescriptor constructor. If the specified GV is non-null, this checks + /// DIDescriptor constructor. If the specified node is non-null, check /// to make sure that the tag in the descriptor matches 'RequiredTag'. If /// not, the debug info is corrupt and we ignore it. - DIDescriptor(GlobalVariable *GV, unsigned RequiredTag); + DIDescriptor(MDNode *N, unsigned RequiredTag); const std::string &getStringField(unsigned Elt, std::string &Result) const; unsigned getUnsignedField(unsigned Elt) const { @@ -60,18 +61,18 @@ template DescTy getFieldAs(unsigned Elt) const { - return DescTy(getDescriptorField(Elt).getGV()); + return DescTy(getDescriptorField(Elt).getNode()); } GlobalVariable *getGlobalVariableField(unsigned Elt) const; public: - explicit DIDescriptor() : DbgGV(0) {} - explicit DIDescriptor(GlobalVariable *GV) : DbgGV(GV) {} + explicit DIDescriptor() : DbgNode(0) {} + explicit DIDescriptor(MDNode *N) : DbgNode(N) {} - bool isNull() const { return DbgGV == 0; } + bool isNull() const { return DbgNode == 0; } - GlobalVariable *getGV() const { return DbgGV; } + MDNode *getNode() const { return DbgNode; } unsigned getVersion() const { return getUnsignedField(0) & LLVMDebugVersionMask; @@ -81,8 +82,8 @@ return getUnsignedField(0) & ~LLVMDebugVersionMask; } - /// ValidDebugInfo - Return true if V represents valid debug info value. - static bool ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel); + /// ValidDebugInfo - Return true if N represents valid debug info value. + static bool ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel); /// dump - print descriptor. void dump() const; @@ -91,8 +92,8 @@ /// DISubrange - This is used to represent ranges, for array bounds. class DISubrange : public DIDescriptor { public: - explicit DISubrange(GlobalVariable *GV = 0) - : DIDescriptor(GV, dwarf::DW_TAG_subrange_type) {} + explicit DISubrange(MDNode *N = 0) + : DIDescriptor(N, dwarf::DW_TAG_subrange_type) {} int64_t getLo() const { return (int64_t)getUInt64Field(1); } int64_t getHi() const { return (int64_t)getUInt64Field(2); } @@ -101,7 +102,8 @@ /// DIArray - This descriptor holds an array of descriptors. class DIArray : public DIDescriptor { public: - explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {} + explicit DIArray(MDNode *N = 0) + : DIDescriptor(N) {} unsigned getNumElements() const; DIDescriptor getElement(unsigned Idx) const { @@ -112,8 +114,8 @@ /// DICompileUnit - A wrapper for a compile unit. class DICompileUnit : public DIDescriptor { public: - explicit DICompileUnit(GlobalVariable *GV = 0) - : DIDescriptor(GV, dwarf::DW_TAG_compile_unit) {} + explicit DICompileUnit(MDNode *N = 0) + : DIDescriptor(N, dwarf::DW_TAG_compile_unit) {} unsigned getLanguage() const { return getUnsignedField(2); } const std::string &getFilename(std::string &F) const { @@ -154,8 +156,8 @@ /// type/precision or a file/line pair for location info. class DIEnumerator : public DIDescriptor { public: - explicit DIEnumerator(GlobalVariable *GV = 0) - : DIDescriptor(GV, dwarf::DW_TAG_enumerator) {} + explicit DIEnumerator(MDNode *N = 0) + : DIDescriptor(N, dwarf::DW_TAG_enumerator) {} const std::string &getName(std::string &F) const { return getStringField(1, F); @@ -175,10 +177,11 @@ }; protected: - DIType(GlobalVariable *GV, unsigned Tag) : DIDescriptor(GV, Tag) {} + DIType(MDNode *N, unsigned Tag) + : DIDescriptor(N, Tag) {} // This ctor is used when the Tag has already been validated by a derived // ctor. - DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {} + DIType(MDNode *N, bool, bool) : DIDescriptor(N) {} public: /// isDerivedType - Return true if the specified tag is legal for @@ -198,7 +201,7 @@ /// Verify - Verify that a type descriptor is well formed. bool Verify() const; public: - explicit DIType(GlobalVariable *GV); + explicit DIType(MDNode *N); explicit DIType() {} virtual ~DIType() {} @@ -231,8 +234,8 @@ /// DIBasicType - A basic type, like 'int' or 'float'. class DIBasicType : public DIType { public: - explicit DIBasicType(GlobalVariable *GV) - : DIType(GV, dwarf::DW_TAG_base_type) {} + explicit DIBasicType(MDNode *N = 0) + : DIType(N, dwarf::DW_TAG_base_type) {} unsigned getEncoding() const { return getUnsignedField(9); } @@ -244,13 +247,13 @@ /// a typedef, a pointer or reference, etc. class DIDerivedType : public DIType { protected: - explicit DIDerivedType(GlobalVariable *GV, bool, bool) - : DIType(GV, true, true) {} + explicit DIDerivedType(MDNode *N, bool, bool) + : DIType(N, true, true) {} public: - explicit DIDerivedType(GlobalVariable *GV) - : DIType(GV, true, true) { - if (GV && !isDerivedType(getTag())) - DbgGV = 0; + explicit DIDerivedType(MDNode *N = 0) + : DIType(N, true, true) { + if (DbgNode && !isDerivedType(getTag())) + DbgNode = 0; } DIType getTypeDerivedFrom() const { return getFieldAs(9); } @@ -272,10 +275,10 @@ /// FIXME: Why is this a DIDerivedType?? class DICompositeType : public DIDerivedType { public: - explicit DICompositeType(GlobalVariable *GV) - : DIDerivedType(GV, true, true) { - if (GV && !isCompositeType(getTag())) - DbgGV = 0; + explicit DICompositeType(MDNode *N = 0) + : DIDerivedType(N, true, true) { + if (N && !isCompositeType(getTag())) + DbgNode = 0; } DIArray getTypeArray() const { return getFieldAs(10); } @@ -291,8 +294,8 @@ /// DIGlobal - This is a common class for global variables and subprograms. class DIGlobal : public DIDescriptor { protected: - explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag) - : DIDescriptor(GV, RequiredTag) {} + explicit DIGlobal(MDNode *N, unsigned RequiredTag) + : DIDescriptor(N, RequiredTag) {} /// isSubprogram - Return true if the specified tag is legal for /// DISubprogram. @@ -335,8 +338,8 @@ /// DISubprogram - This is a wrapper for a subprogram (e.g. a function). class DISubprogram : public DIGlobal { public: - explicit DISubprogram(GlobalVariable *GV = 0) - : DIGlobal(GV, dwarf::DW_TAG_subprogram) {} + explicit DISubprogram(MDNode *N = 0) + : DIGlobal(N, dwarf::DW_TAG_subprogram) {} DICompositeType getType() const { return getFieldAs(8); } @@ -346,7 +349,7 @@ DICompositeType DCT(getFieldAs(8)); if (!DCT.isNull()) { DIArray A = DCT.getTypeArray(); - DIType T(A.getElement(0).getGV()); + DIType T(A.getElement(0).getNode()); return T.getName(F); } DIType T(getFieldAs(8)); @@ -367,8 +370,8 @@ /// DIGlobalVariable - This is a wrapper for a global variable. class DIGlobalVariable : public DIGlobal { public: - explicit DIGlobalVariable(GlobalVariable *GV = 0) - : DIGlobal(GV, dwarf::DW_TAG_variable) {} + explicit DIGlobalVariable(MDNode *N = 0) + : DIGlobal(N, dwarf::DW_TAG_variable) {} GlobalVariable *getGlobal() const { return getGlobalVariableField(11); } @@ -383,10 +386,10 @@ /// global etc). class DIVariable : public DIDescriptor { public: - explicit DIVariable(GlobalVariable *GV = 0) - : DIDescriptor(GV) { - if (GV && !isVariable(getTag())) - DbgGV = 0; + explicit DIVariable(MDNode *N = 0) + : DIDescriptor(N) { + if (DbgNode && !isVariable(getTag())) + DbgNode = 0; } DIDescriptor getContext() const { return getDescriptorField(1); } @@ -410,8 +413,8 @@ /// DIBlock - This is a wrapper for a block (e.g. a function, scope, etc). class DIBlock : public DIDescriptor { public: - explicit DIBlock(GlobalVariable *GV = 0) - : DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {} + explicit DIBlock(MDNode *N = 0) + : DIDescriptor(N, dwarf::DW_TAG_lexical_block) {} DIDescriptor getContext() const { return getDescriptorField(1); } }; @@ -538,10 +541,6 @@ private: Constant *GetTagConstant(unsigned TAG); - Constant *GetStringConstant(const std::string &String); - - /// getCastToEmpty - Return the descriptor as a Constant* with type '{}*'. - Constant *getCastToEmpty(DIDescriptor D); }; /// Finds the stoppoint coressponding to this instruction, that is the @@ -603,7 +602,6 @@ /// isInlinedFnEnd - Return true if REI is ending an inlined function. bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function *CurrentFn); - /// DebugInfoFinder - This object collects DebugInfo from a module. class DebugInfoFinder { @@ -647,7 +645,7 @@ bool addType(DIType DT); public: - typedef SmallVector::iterator iterator; + typedef SmallVector::iterator iterator; iterator compile_unit_begin() { return CUs.begin(); } iterator compile_unit_end() { return CUs.end(); } iterator subprogram_begin() { return SPs.begin(); } @@ -663,12 +661,11 @@ unsigned type_count() { return TYs.size(); } private: - SmallVector CUs; // Compile Units - SmallVector SPs; // Subprograms - SmallVector GVs; // Global Variables - SmallVector TYs; // Types - SmallPtrSet NodesSeen; - + SmallVector CUs; // Compile Units + SmallVector SPs; // Subprograms + SmallVector GVs; // Global Variables; + SmallVector TYs; // Types + SmallPtrSet NodesSeen; }; } // end namespace llvm Modified: llvm/trunk/include/llvm/AutoUpgrade.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/AutoUpgrade.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/AutoUpgrade.h (original) +++ llvm/trunk/include/llvm/AutoUpgrade.h Tue Aug 25 00:24:07 2009 @@ -15,6 +15,7 @@ #define LLVM_AUTOUPGRADE_H namespace llvm { + class Module; class Function; class CallInst; @@ -34,6 +35,9 @@ /// so that it can update all calls to the old function. void UpgradeCallsToIntrinsic(Function* F); + /// This function checks debug info intrinsics. If an intrinsic is invalid + /// then this function simply removes the intrinsic. + void CheckDebugInfoIntrinsics(Module *M); } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Tue Aug 25 00:24:07 2009 @@ -33,7 +33,7 @@ class MachineInstr; class Value; class Module; -class GlobalVariable; +class MDNode; class MCAsmInfo; class raw_ostream; class Instruction; @@ -88,17 +88,17 @@ unsigned RecordSourceLine(unsigned Line, unsigned Col, DICompileUnit CU); /// RecordRegionStart - Indicate the start of a region. - unsigned RecordRegionStart(GlobalVariable *V); + unsigned RecordRegionStart(MDNode *N); /// RecordRegionEnd - Indicate the end of a region. - unsigned RecordRegionEnd(GlobalVariable *V); + unsigned RecordRegionEnd(MDNode *N); /// getRecordSourceLineCount - Count source lines. unsigned getRecordSourceLineCount(); /// RecordVariable - Indicate the declaration of a local variable. /// - void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); + void RecordVariable(MDNode *N, unsigned FrameIndex); /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should /// be emitted. Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Tue Aug 25 00:24:07 2009 @@ -327,7 +327,7 @@ /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given /// source file, line, and column. If none currently exists, create a new /// DebugLocTuple, and insert it into the DebugIdMap. - unsigned getOrCreateDebugLocID(GlobalVariable *CompileUnit, + unsigned getOrCreateDebugLocID(MDNode *CompileUnit, unsigned Line, unsigned Col); /// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Aug 25 00:24:07 2009 @@ -322,7 +322,7 @@ SDValue getValueType(EVT); SDValue getRegister(unsigned Reg, EVT VT); SDValue getDbgStopPoint(DebugLoc DL, SDValue Root, - unsigned Line, unsigned Col, Value *CU); + unsigned Line, unsigned Col, MDNode *CU); SDValue getLabel(unsigned Opcode, DebugLoc dl, SDValue Root, unsigned LabelID); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Aug 25 00:24:07 2009 @@ -2015,10 +2015,10 @@ SDUse Chain; unsigned Line; unsigned Column; - Value *CU; + MDNode *CU; friend class SelectionDAG; DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c, - Value *cu) + MDNode *cu) : SDNode(ISD::DBG_STOPPOINT, DebugLoc::getUnknownLoc(), getSDVTList(MVT::Other)), Line(l), Column(c), CU(cu) { InitOperands(&Chain, ch); @@ -2026,7 +2026,7 @@ public: unsigned getLine() const { return Line; } unsigned getColumn() const { return Column; } - Value *getCompileUnit() const { return CU; } + MDNode *getCompileUnit() const { return CU; } static bool classof(const DbgStopPointSDNode *) { return true; } static bool classof(const SDNode *N) { Modified: llvm/trunk/include/llvm/IntrinsicInst.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicInst.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicInst.h (original) +++ llvm/trunk/include/llvm/IntrinsicInst.h Tue Aug 25 00:24:07 2009 @@ -25,6 +25,7 @@ #define LLVM_INTRINSICINST_H #include "llvm/Constants.h" +#include "llvm/Metadata.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" @@ -85,8 +86,8 @@ struct DbgStopPointInst : public DbgInfoIntrinsic { Value *getLineValue() const { return const_cast(getOperand(1)); } Value *getColumnValue() const { return const_cast(getOperand(2)); } - Value *getContext() const { - return StripCast(getOperand(3)); + MDNode *getContext() const { + return cast(getOperand(3)); } unsigned getLine() const { @@ -112,7 +113,7 @@ /// DbgFuncStartInst - This represents the llvm.dbg.func.start instruction. /// struct DbgFuncStartInst : public DbgInfoIntrinsic { - Value *getSubprogram() const { return StripCast(getOperand(1)); } + MDNode *getSubprogram() const { return cast(getOperand(1)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgFuncStartInst *) { return true; } @@ -127,7 +128,7 @@ /// DbgRegionStartInst - This represents the llvm.dbg.region.start /// instruction. struct DbgRegionStartInst : public DbgInfoIntrinsic { - Value *getContext() const { return StripCast(getOperand(1)); } + MDNode *getContext() const { return cast(getOperand(1)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgRegionStartInst *) { return true; } @@ -142,7 +143,7 @@ /// DbgRegionEndInst - This represents the llvm.dbg.region.end instruction. /// struct DbgRegionEndInst : public DbgInfoIntrinsic { - Value *getContext() const { return StripCast(getOperand(1)); } + MDNode *getContext() const { return cast(getOperand(1)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgRegionEndInst *) { return true; } @@ -158,7 +159,7 @@ /// struct DbgDeclareInst : public DbgInfoIntrinsic { Value *getAddress() const { return getOperand(1); } - Value *getVariable() const { return StripCast(getOperand(2)); } + MDNode *getVariable() const { return cast(getOperand(2)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgDeclareInst *) { return true; } Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Tue Aug 25 00:24:07 2009 @@ -110,6 +110,7 @@ def llvm_anyptr_ty : LLVMAnyPointerType; // (space)i8* def llvm_empty_ty : LLVMType; // { } def llvm_descriptor_ty : LLVMPointerType; // { }* +def llvm_metadata_ty : LLVMType; // !{...} def llvm_v2i8_ty : LLVMType; // 2 x i8 def llvm_v4i8_ty : LLVMType; // 4 x i8 @@ -278,12 +279,12 @@ let Properties = [IntrNoMem] in { def int_dbg_stoppoint : Intrinsic<[llvm_void_ty], [llvm_i32_ty, llvm_i32_ty, - llvm_descriptor_ty]>; - def int_dbg_region_start : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>; - def int_dbg_region_end : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>; - def int_dbg_func_start : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>; + llvm_metadata_ty]>; + def int_dbg_region_start : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>; + def int_dbg_region_end : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>; + def int_dbg_func_start : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>; def int_dbg_declare : Intrinsic<[llvm_void_ty], - [llvm_descriptor_ty, llvm_descriptor_ty]>; + [llvm_descriptor_ty, llvm_metadata_ty]>; } //===------------------ Exception Handling Intrinsics----------------------===// Modified: llvm/trunk/include/llvm/Metadata.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/Metadata.h (original) +++ llvm/trunk/include/llvm/Metadata.h Tue Aug 25 00:24:07 2009 @@ -110,7 +110,6 @@ unsigned getNumOperands() { return User::getNumOperands(); } SmallVector Node; - friend struct ConstantCreator >; protected: explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned NumVals); Modified: llvm/trunk/include/llvm/Support/DebugLoc.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/DebugLoc.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/DebugLoc.h (original) +++ llvm/trunk/include/llvm/Support/DebugLoc.h Tue Aug 25 00:24:07 2009 @@ -19,19 +19,19 @@ #include namespace llvm { - class GlobalVariable; + class MDNode; /// DebugLocTuple - Debug location tuple of filename id, line and column. /// struct DebugLocTuple { - GlobalVariable *CompileUnit; + MDNode *CompileUnit; unsigned Line, Col; DebugLocTuple() : CompileUnit(0), Line(~0U), Col(~0U) {}; - DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c) - : CompileUnit(v), Line(l), Col(c) {}; + DebugLocTuple(MDNode *n, unsigned l, unsigned c) + : CompileUnit(n), Line(l), Col(c) {}; bool operator==(const DebugLocTuple &DLT) const { return CompileUnit == DLT.CompileUnit && @@ -69,10 +69,10 @@ return DebugLocTuple(0, ~0U, ~0U); } static inline DebugLocTuple getTombstoneKey() { - return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U); + return DebugLocTuple((MDNode*)~1U, ~1U, ~1U); } static unsigned getHashValue(const DebugLocTuple &Val) { - return DenseMapInfo::getHashValue(Val.CompileUnit) ^ + return DenseMapInfo::getHashValue(Val.CompileUnit) ^ DenseMapInfo::getHashValue(Val.Line) ^ DenseMapInfo::getHashValue(Val.Col); } Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Tue Aug 25 00:24:07 2009 @@ -90,7 +90,7 @@ } void PrintDbgInfo::printFuncStart(const DbgFuncStartInst *FS) { - DISubprogram Subprogram(cast(FS->getSubprogram())); + DISubprogram Subprogram(FS->getSubprogram()); std::string Res1, Res2; Out << "; fully qualified function name: " << Subprogram.getDisplayName(Res1) << " return type: " << Subprogram.getReturnTypeName(Res2) Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Aug 25 00:24:07 2009 @@ -21,6 +21,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/Analysis/ValueTracking.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/DebugLoc.h" #include "llvm/Support/raw_ostream.h" @@ -32,18 +33,12 @@ //===----------------------------------------------------------------------===// /// ValidDebugInfo - Return true if V represents valid debug info value. -bool DIDescriptor::ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel) { - if (!V) +/// FIXME : Add DIDescriptor.isValid() +bool DIDescriptor::ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel) { + if (!N) return false; - GlobalVariable *GV = dyn_cast(V->stripPointerCasts()); - if (!GV) - return false; - - if (!GV->hasInternalLinkage () && !GV->hasLinkOnceLinkage()) - return false; - - DIDescriptor DI(GV); + DIDescriptor DI(N); // Check current version. Allow Version6 for now. unsigned Version = DI.getVersion(); @@ -53,13 +48,13 @@ unsigned Tag = DI.getTag(); switch (Tag) { case DW_TAG_variable: - assert(DIVariable(GV).Verify() && "Invalid DebugInfo value"); + assert(DIVariable(N).Verify() && "Invalid DebugInfo value"); break; case DW_TAG_compile_unit: - assert(DICompileUnit(GV).Verify() && "Invalid DebugInfo value"); + assert(DICompileUnit(N).Verify() && "Invalid DebugInfo value"); break; case DW_TAG_subprogram: - assert(DISubprogram(GV).Verify() && "Invalid DebugInfo value"); + assert(DISubprogram(N).Verify() && "Invalid DebugInfo value"); break; case DW_TAG_lexical_block: // FIXME: This interfers with the quality of generated code during @@ -74,67 +69,58 @@ return true; } -DIDescriptor::DIDescriptor(GlobalVariable *GV, unsigned RequiredTag) { - DbgGV = GV; +DIDescriptor::DIDescriptor(MDNode *N, unsigned RequiredTag) { + DbgNode = N; // If this is non-null, check to see if the Tag matches. If not, set to null. - if (GV && getTag() != RequiredTag) - DbgGV = 0; + if (N && getTag() != RequiredTag) { + DbgNode = 0; + } } const std::string & DIDescriptor::getStringField(unsigned Elt, std::string &Result) const { - if (DbgGV == 0) { - Result.clear(); + Result.clear(); + if (DbgNode == 0) return Result; - } - - Constant *C = DbgGV->getInitializer(); - if (C == 0 || Elt >= C->getNumOperands()) { - Result.clear(); - return Result; - } - - // Fills in the string if it succeeds - if (!GetConstantStringInfo(C->getOperand(Elt), Result)) - Result.clear(); + if (Elt < DbgNode->getNumElements()) + if (MDString *MDS = dyn_cast_or_null(DbgNode->getElement(Elt))) { + Result.assign(MDS->begin(), MDS->begin() + MDS->length()); + return Result; + } + return Result; } uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const { - if (DbgGV == 0) return 0; - if (!DbgGV->hasInitializer()) return 0; - - Constant *C = DbgGV->getInitializer(); - if (C == 0 || Elt >= C->getNumOperands()) + if (DbgNode == 0) return 0; - if (ConstantInt *CI = dyn_cast(C->getOperand(Elt))) - return CI->getZExtValue(); + if (Elt < DbgNode->getNumElements()) + if (ConstantInt *CI = dyn_cast(DbgNode->getElement(Elt))) + return CI->getZExtValue(); + return 0; } DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { - if (DbgGV == 0) return DIDescriptor(); - - Constant *C = DbgGV->getInitializer(); - if (C == 0 || Elt >= C->getNumOperands()) + if (DbgNode == 0) return DIDescriptor(); - C = C->getOperand(Elt); - return DIDescriptor(dyn_cast(C->stripPointerCasts())); + if (Elt < DbgNode->getNumElements() && DbgNode->getElement(Elt)) + return DIDescriptor(dyn_cast(DbgNode->getElement(Elt))); + + return DIDescriptor(); } GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const { - if (DbgGV == 0) return 0; - - Constant *C = DbgGV->getInitializer(); - if (C == 0 || Elt >= C->getNumOperands()) + if (DbgNode == 0) return 0; - C = C->getOperand(Elt); - return dyn_cast(C->stripPointerCasts()); + if (Elt < DbgNode->getNumElements()) + return dyn_cast(DbgNode->getElement(Elt)); + return 0; } //===----------------------------------------------------------------------===// @@ -142,12 +128,13 @@ //===----------------------------------------------------------------------===// // Needed by DIVariable::getType(). -DIType::DIType(GlobalVariable *GV) : DIDescriptor(GV) { - if (!GV) return; +DIType::DIType(MDNode *N) : DIDescriptor(N) { + if (!N) return; unsigned tag = getTag(); if (tag != dwarf::DW_TAG_base_type && !DIDerivedType::isDerivedType(tag) && - !DICompositeType::isCompositeType(tag)) - DbgGV = 0; + !DICompositeType::isCompositeType(tag)) { + DbgNode = 0; + } } /// isDerivedType - Return true if the specified tag is legal for @@ -164,9 +151,8 @@ case dwarf::DW_TAG_inheritance: return true; default: - // FIXME: Even though it doesn't make sense, CompositeTypes are current - // modelled as DerivedTypes, this should return true for them as well. - return false; + // CompositeTypes are currently modelled as DerivedTypes. + return isCompositeType(Tag); } } @@ -200,10 +186,8 @@ } unsigned DIArray::getNumElements() const { - assert (DbgGV && "Invalid DIArray"); - Constant *C = DbgGV->getInitializer(); - assert (C && "Invalid DIArray initializer"); - return C->getNumOperands(); + assert (DbgNode && "Invalid DIArray"); + return DbgNode->getNumElements(); } /// replaceAllUsesWith - Replace all uses of debug info referenced by @@ -214,8 +198,8 @@ return; assert (!D.isNull() && "Can not replace with null"); - getGV()->replaceAllUsesWith(D.getGV()); - getGV()->eraseFromParent(); + DbgNode->replaceAllUsesWith(D.getNode()); + delete DbgNode; } /// Verify - Verify that a compile unit is well formed. @@ -341,8 +325,8 @@ /// dump - Print descriptor. void DIDescriptor::dump() const { - errs() << "[" << dwarf::TagString(getTag()) << "] [GV:"; - errs().write_hex((intptr_t)DbgGV) << ']'; + errs() << "[" << dwarf::TagString(getTag()) << "] "; + errs().write_hex((intptr_t)DbgNode) << ']'; } /// dump - Print compile unit. @@ -383,11 +367,11 @@ errs() << " [fwd] "; if (isBasicType(Tag)) - DIBasicType(DbgGV).dump(); + DIBasicType(DbgNode).dump(); else if (isDerivedType(Tag)) - DIDerivedType(DbgGV).dump(); + DIDerivedType(DbgNode).dump(); else if (isCompositeType(Tag)) - DICompositeType(DbgGV).dump(); + DICompositeType(DbgNode).dump(); else { errs() << "Invalid DIType\n"; return; @@ -434,7 +418,7 @@ errs() << " [def] "; if (isGlobalVariable(Tag)) - DIGlobalVariable(DbgGV).dump(); + DIGlobalVariable(DbgNode).dump(); errs() << "\n"; } @@ -474,43 +458,12 @@ EmptyStructPtr = PointerType::getUnqual(StructType::get(VMContext)); } -/// getCastToEmpty - Return this descriptor as a Constant* with type '{}*'. -/// This is only valid when the descriptor is non-null. -Constant *DIFactory::getCastToEmpty(DIDescriptor D) { - if (D.isNull()) return llvm::Constant::getNullValue(EmptyStructPtr); - return ConstantExpr::getBitCast(D.getGV(), EmptyStructPtr); -} - Constant *DIFactory::GetTagConstant(unsigned TAG) { assert((TAG & LLVMDebugVersionMask) == 0 && "Tag too large for debug encoding!"); return ConstantInt::get(Type::getInt32Ty(VMContext), TAG | LLVMDebugVersion); } -Constant *DIFactory::GetStringConstant(const std::string &String) { - // Check string cache for previous edition. - Constant *&Slot = StringCache[String]; - - // Return Constant if previously defined. - if (Slot) return Slot; - - const PointerType *DestTy = PointerType::getUnqual(Type::getInt8Ty(VMContext)); - - // If empty string then use a i8* null instead. - if (String.empty()) - return Slot = ConstantPointerNull::get(DestTy); - - // Construct string as an llvm constant. - Constant *ConstStr = ConstantArray::get(VMContext, String); - - // Otherwise create and return a new string global. - GlobalVariable *StrGV = new GlobalVariable(M, ConstStr->getType(), true, - GlobalVariable::InternalLinkage, - ConstStr, ".str"); - StrGV->setSection("llvm.metadata"); - return Slot = ConstantExpr::getBitCast(StrGV, DestTy); -} - //===----------------------------------------------------------------------===// // DIFactory: Primary Constructors //===----------------------------------------------------------------------===// @@ -518,50 +471,27 @@ /// GetOrCreateArray - Create an descriptor for an array of descriptors. /// This implicitly uniques the arrays created. DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys) { - SmallVector Elts; + SmallVector Elts; - for (unsigned i = 0; i != NumTys; ++i) - Elts.push_back(getCastToEmpty(Tys[i])); + if (NumTys == 0) + Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext))); + else + for (unsigned i = 0; i != NumTys; ++i) + Elts.push_back(Tys[i].getNode()); - Constant *Init = ConstantArray::get(ArrayType::get(EmptyStructPtr, - Elts.size()), - Elts.data(), Elts.size()); - // If we already have this array, just return the uniqued version. - DIDescriptor &Entry = SimpleConstantCache[Init]; - if (!Entry.isNull()) return DIArray(Entry.getGV()); - - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.array"); - GV->setSection("llvm.metadata"); - Entry = DIDescriptor(GV); - return DIArray(GV); + return DIArray(MDNode::get(VMContext,Elts.data(), Elts.size())); } /// GetOrCreateSubrange - Create a descriptor for a value range. This /// implicitly uniques the values returned. DISubrange DIFactory::GetOrCreateSubrange(int64_t Lo, int64_t Hi) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_subrange_type), ConstantInt::get(Type::getInt64Ty(VMContext), Lo), ConstantInt::get(Type::getInt64Ty(VMContext), Hi) }; - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - // If we already have this range, just return the uniqued version. - DIDescriptor &Entry = SimpleConstantCache[Init]; - if (!Entry.isNull()) return DISubrange(Entry.getGV()); - - M.addTypeName("llvm.dbg.subrange.type", Init->getType()); - - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.subrange"); - GV->setSection("llvm.metadata"); - Entry = DIDescriptor(GV); - return DISubrange(GV); + return DISubrange(MDNode::get(VMContext, &Elts[0], 3)); } @@ -576,47 +506,31 @@ bool isOptimized, const char *Flags, unsigned RunTimeVer) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_compile_unit), - llvm::Constant::getNullValue(EmptyStructPtr), + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), ConstantInt::get(Type::getInt32Ty(VMContext), LangID), - GetStringConstant(Filename), - GetStringConstant(Directory), - GetStringConstant(Producer), + MDString::get(VMContext, Filename), + MDString::get(VMContext, Directory), + MDString::get(VMContext, Producer), ConstantInt::get(Type::getInt1Ty(VMContext), isMain), ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized), - GetStringConstant(Flags), + MDString::get(VMContext, Flags), ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer) }; - - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.compile_unit.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.compile_unit"); - GV->setSection("llvm.metadata"); - return DICompileUnit(GV); + + return DICompileUnit(MDNode::get(VMContext, &Elts[0], 10)); } /// CreateEnumerator - Create a single enumerator value. DIEnumerator DIFactory::CreateEnumerator(const std::string &Name, uint64_t Val){ - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_enumerator), - GetStringConstant(Name), + MDString::get(VMContext, Name), ConstantInt::get(Type::getInt64Ty(VMContext), Val) }; - - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.enumerator.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.enumerator"); - GV->setSection("llvm.metadata"); - return DIEnumerator(GV); + + return DIEnumerator(MDNode::get(VMContext, &Elts[0], 3)); } @@ -629,11 +543,11 @@ uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, unsigned Encoding) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_base_type), - getCastToEmpty(Context), - GetStringConstant(Name), - getCastToEmpty(CompileUnit), + Context.getNode(), + MDString::get(VMContext, Name), + CompileUnit.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), @@ -642,15 +556,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), Encoding) }; - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.basictype.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.basictype"); - GV->setSection("llvm.metadata"); - return DIBasicType(GV); + return DIBasicType(MDNode::get(VMContext, &Elts[0], 10)); } /// CreateDerivedType - Create a derived type like const qualified type, @@ -665,28 +571,20 @@ uint64_t OffsetInBits, unsigned Flags, DIType DerivedFrom) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(Tag), - getCastToEmpty(Context), - GetStringConstant(Name), - getCastToEmpty(CompileUnit), + Context.getNode(), + MDString::get(VMContext, Name), + CompileUnit.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits), ConstantInt::get(Type::getInt32Ty(VMContext), Flags), - getCastToEmpty(DerivedFrom) + DerivedFrom.getNode(), }; - - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.derivedtype.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.derivedtype"); - GV->setSection("llvm.metadata"); - return DIDerivedType(GV); + + return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10)); } /// CreateCompositeType - Create a composite type like array, struct, etc. @@ -703,30 +601,22 @@ DIArray Elements, unsigned RuntimeLang) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(Tag), - getCastToEmpty(Context), - GetStringConstant(Name), - getCastToEmpty(CompileUnit), + Context.getNode(), + MDString::get(VMContext, Name), + CompileUnit.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits), ConstantInt::get(Type::getInt32Ty(VMContext), Flags), - getCastToEmpty(DerivedFrom), - getCastToEmpty(Elements), + DerivedFrom.getNode(), + Elements.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang) }; - - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.composite.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.composite"); - GV->setSection("llvm.metadata"); - return DICompositeType(GV); + + return DICompositeType(MDNode::get(VMContext, &Elts[0], 12)); } @@ -742,29 +632,21 @@ bool isLocalToUnit, bool isDefinition) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_subprogram), - llvm::Constant::getNullValue(EmptyStructPtr), - getCastToEmpty(Context), - GetStringConstant(Name), - GetStringConstant(DisplayName), - GetStringConstant(LinkageName), - getCastToEmpty(CompileUnit), + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), + Context.getNode(), + MDString::get(VMContext, Name), + MDString::get(VMContext, DisplayName), + MDString::get(VMContext, LinkageName), + CompileUnit.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), - getCastToEmpty(Type), + Type.getNode(), ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition) }; - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.subprogram.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.subprogram"); - GV->setSection("llvm.metadata"); - return DISubprogram(GV); + return DISubprogram(MDNode::get(VMContext, &Elts[0], 11)); } /// CreateGlobalVariable - Create a new descriptor for the specified global. @@ -775,30 +657,29 @@ DICompileUnit CompileUnit, unsigned LineNo, DIType Type,bool isLocalToUnit, bool isDefinition, llvm::GlobalVariable *Val) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_variable), - llvm::Constant::getNullValue(EmptyStructPtr), - getCastToEmpty(Context), - GetStringConstant(Name), - GetStringConstant(DisplayName), - GetStringConstant(LinkageName), - getCastToEmpty(CompileUnit), + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), + Context.getNode(), + MDString::get(VMContext, Name), + MDString::get(VMContext, DisplayName), + MDString::get(VMContext, LinkageName), + CompileUnit.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), - getCastToEmpty(Type), + Type.getNode(), ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition), - ConstantExpr::getBitCast(Val, EmptyStructPtr) + Val }; - - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.global_variable.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::LinkOnceAnyLinkage, - Init, "llvm.dbg.global_variable"); - GV->setSection("llvm.metadata"); - return DIGlobalVariable(GV); + + Value *const *Vs = &Elts[0]; + MDNode *Node = MDNode::get(VMContext,Vs, 12); + + // Create a named metadata so that we do not lose this mdnode. + NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv"); + NMD->addElement(Node); + + return DIGlobalVariable(Node); } @@ -807,44 +688,28 @@ const std::string &Name, DICompileUnit CompileUnit, unsigned LineNo, DIType Type) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(Tag), - getCastToEmpty(Context), - GetStringConstant(Name), - getCastToEmpty(CompileUnit), + Context.getNode(), + MDString::get(VMContext, Name), + CompileUnit.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), - getCastToEmpty(Type) + Type.getNode(), }; - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.variable.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.variable"); - GV->setSection("llvm.metadata"); - return DIVariable(GV); + return DIVariable(MDNode::get(VMContext, &Elts[0], 6)); } /// CreateBlock - This creates a descriptor for a lexical block with the /// specified parent VMContext. DIBlock DIFactory::CreateBlock(DIDescriptor Context) { - Constant *Elts[] = { + Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_lexical_block), - getCastToEmpty(Context) + Context.getNode() }; - - Constant *Init = ConstantStruct::get(VMContext, Elts, - sizeof(Elts)/sizeof(Elts[0])); - - M.addTypeName("llvm.dbg.block.type", Init->getType()); - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, - GlobalValue::InternalLinkage, - Init, "llvm.dbg.block"); - GV->setSection("llvm.metadata"); - return DIBlock(GV); + + return DIBlock(MDNode::get(VMContext, &Elts[0], 2)); } @@ -866,7 +731,7 @@ Value *Args[] = { ConstantInt::get(llvm::Type::getInt32Ty(VMContext), LineNo), ConstantInt::get(llvm::Type::getInt32Ty(VMContext), ColNo), - getCastToEmpty(CU) + CU.getNode() }; CallInst::Create(StopPointFn, Args, Args+3, "", BB); } @@ -879,7 +744,7 @@ FuncStartFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_func_start); // Call llvm.dbg.func.start which also implicitly sets a stoppoint. - CallInst::Create(FuncStartFn, getCastToEmpty(SP), "", BB); + CallInst::Create(FuncStartFn, SP.getNode(), "", BB); } /// InsertRegionStart - Insert a new llvm.dbg.region.start intrinsic call to @@ -890,7 +755,7 @@ RegionStartFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_region_start); // Call llvm.dbg.func.start. - CallInst::Create(RegionStartFn, getCastToEmpty(D), "", BB); + CallInst::Create(RegionStartFn, D.getNode(), "", BB); } /// InsertRegionEnd - Insert a new llvm.dbg.region.end intrinsic call to @@ -901,7 +766,7 @@ RegionEndFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_region_end); // Call llvm.dbg.region.end. - CallInst::Create(RegionEndFn, getCastToEmpty(D), "", BB); + CallInst::Create(RegionEndFn, D.getNode(), "", BB); } /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. @@ -912,17 +777,19 @@ if (!DeclareFn) DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); - Value *Args[] = { Storage, getCastToEmpty(D) }; + Value *Args[] = { Storage, D.getNode() }; CallInst::Create(DeclareFn, Args, Args+2, "", BB); } + //===----------------------------------------------------------------------===// // DebugInfoFinder implementations. //===----------------------------------------------------------------------===// /// processModule - Process entire module and collect debug info. void DebugInfoFinder::processModule(Module &M) { - + + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI) for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE; @@ -938,15 +805,13 @@ else if (DbgDeclareInst *DDI = dyn_cast(BI)) processDeclare(DDI); } - - for (Module::global_iterator GVI = M.global_begin(), GVE = M.global_end(); - GVI != GVE; ++GVI) { - GlobalVariable *GV = GVI; - if (!GV->hasName() || !GV->isConstant() - || strncmp(GV->getName().data(), "llvm.dbg.global_variable", 24) - || !GV->hasInitializer()) - continue; - DIGlobalVariable DIG(GV); + + NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv"); + if (!NMD) + return; + + for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { + DIGlobalVariable DIG(cast(NMD->getElement(i))); if (addGlobalVariable(DIG)) { addCompileUnit(DIG.getCompileUnit()); processType(DIG.getType()); @@ -961,20 +826,20 @@ addCompileUnit(DT.getCompileUnit()); if (DT.isCompositeType(DT.getTag())) { - DICompositeType DCT(DT.getGV()); + DICompositeType DCT(DT.getNode()); processType(DCT.getTypeDerivedFrom()); DIArray DA = DCT.getTypeArray(); if (!DA.isNull()) for (unsigned i = 0, e = DA.getNumElements(); i != e; ++i) { DIDescriptor D = DA.getElement(i); - DIType TypeE = DIType(D.getGV()); + DIType TypeE = DIType(D.getNode()); if (!TypeE.isNull()) processType(TypeE); else - processSubprogram(DISubprogram(D.getGV())); + processSubprogram(DISubprogram(D.getNode())); } } else if (DT.isDerivedType(DT.getTag())) { - DIDerivedType DDT(DT.getGV()); + DIDerivedType DDT(DT.getNode()); if (!DDT.isNull()) processType(DDT.getTypeDerivedFrom()); } @@ -992,35 +857,35 @@ /// processStopPoint - Process DbgStopPointInst. void DebugInfoFinder::processStopPoint(DbgStopPointInst *SPI) { - GlobalVariable *Context = dyn_cast(SPI->getContext()); + MDNode *Context = dyn_cast(SPI->getContext()); addCompileUnit(DICompileUnit(Context)); } /// processFuncStart - Process DbgFuncStartInst. void DebugInfoFinder::processFuncStart(DbgFuncStartInst *FSI) { - GlobalVariable *SP = dyn_cast(FSI->getSubprogram()); + MDNode *SP = dyn_cast(FSI->getSubprogram()); processSubprogram(DISubprogram(SP)); } /// processRegionStart - Process DbgRegionStart. void DebugInfoFinder::processRegionStart(DbgRegionStartInst *DRS) { - GlobalVariable *SP = dyn_cast(DRS->getContext()); + MDNode *SP = dyn_cast(DRS->getContext()); processSubprogram(DISubprogram(SP)); } /// processRegionEnd - Process DbgRegionEnd. void DebugInfoFinder::processRegionEnd(DbgRegionEndInst *DRE) { - GlobalVariable *SP = dyn_cast(DRE->getContext()); + MDNode *SP = dyn_cast(DRE->getContext()); processSubprogram(DISubprogram(SP)); } /// processDeclare - Process DbgDeclareInst. void DebugInfoFinder::processDeclare(DbgDeclareInst *DDI) { - DIVariable DV(cast(DDI->getVariable())); + DIVariable DV(cast(DDI->getVariable())); if (DV.isNull()) return; - if (!NodesSeen.insert(DV.getGV())) + if (!NodesSeen.insert(DV.getNode())) return; addCompileUnit(DV.getCompileUnit()); @@ -1032,10 +897,10 @@ if (DT.isNull()) return false; - if (!NodesSeen.insert(DT.getGV())) + if (!NodesSeen.insert(DT.getNode())) return false; - TYs.push_back(DT.getGV()); + TYs.push_back(DT.getNode()); return true; } @@ -1044,10 +909,10 @@ if (CU.isNull()) return false; - if (!NodesSeen.insert(CU.getGV())) + if (!NodesSeen.insert(CU.getNode())) return false; - CUs.push_back(CU.getGV()); + CUs.push_back(CU.getNode()); return true; } @@ -1056,10 +921,10 @@ if (DIG.isNull()) return false; - if (!NodesSeen.insert(DIG.getGV())) + if (!NodesSeen.insert(DIG.getNode())) return false; - GVs.push_back(DIG.getGV()); + GVs.push_back(DIG.getNode()); return true; } @@ -1068,10 +933,10 @@ if (SP.isNull()) return false; - if (!NodesSeen.insert(SP.getGV())) + if (!NodesSeen.insert(SP.getNode())) return false; - SPs.push_back(SP.getGV()); + SPs.push_back(SP.getNode()); return true; } @@ -1124,31 +989,17 @@ Value *findDbgGlobalDeclare(GlobalVariable *V) { const Module *M = V->getParent(); + NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.gv"); + if (!NMD) + return 0; - const Type *Ty = M->getTypeByName("llvm.dbg.global_variable.type"); - if (!Ty) return 0; - - Ty = PointerType::get(Ty, 0); - - Value *Val = V->stripPointerCasts(); - for (Value::use_iterator I = Val->use_begin(), E = Val->use_end(); - I != E; ++I) { - if (ConstantExpr *CE = dyn_cast(I)) { - if (CE->getOpcode() == Instruction::BitCast) { - Value *VV = CE; - - while (VV->hasOneUse()) - VV = *VV->use_begin(); - - if (VV->getType() == Ty) - return VV; - } - } + for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { + DIGlobalVariable DIG(cast_or_null(NMD->getElement(i))); + if (DIG.isNull()) + continue; + if (DIG.getGlobal() == V) + return DIG.getNode(); } - - if (Val->getType() == Ty) - return Val; - return 0; } @@ -1185,7 +1036,7 @@ if (GlobalVariable *GV = dyn_cast(const_cast(V))) { Value *DIGV = findDbgGlobalDeclare(GV); if (!DIGV) return false; - DIGlobalVariable Var(cast(DIGV)); + DIGlobalVariable Var(cast(DIGV)); Var.getDisplayName(DisplayName); LineNo = Var.getLineNumber(); @@ -1194,7 +1045,7 @@ } else { const DbgDeclareInst *DDI = findDbgDeclare(V); if (!DDI) return false; - DIVariable Var(cast(DDI->getVariable())); + DIVariable Var(cast(DDI->getVariable())); Var.getName(DisplayName); LineNo = Var.getLineNumber(); @@ -1252,7 +1103,7 @@ Value *Context = SPI.getContext(); // If this location is already tracked then use it. - DebugLocTuple Tuple(cast(Context), SPI.getLine(), + DebugLocTuple Tuple(cast(Context), SPI.getLine(), SPI.getColumn()); DenseMap::iterator II = DebugLocInfo.DebugIdMap.find(Tuple); @@ -1274,12 +1125,12 @@ DebugLoc DL; Value *SP = FSI.getSubprogram(); - DISubprogram Subprogram(cast(SP)); + DISubprogram Subprogram(cast(SP)); unsigned Line = Subprogram.getLineNumber(); DICompileUnit CU(Subprogram.getCompileUnit()); // If this location is already tracked then use it. - DebugLocTuple Tuple(CU.getGV(), Line, /* Column */ 0); + DebugLocTuple Tuple(CU.getNode(), Line, /* Column */ 0); DenseMap::iterator II = DebugLocInfo.DebugIdMap.find(Tuple); if (II != DebugLocInfo.DebugIdMap.end()) @@ -1295,7 +1146,7 @@ /// isInlinedFnStart - Return true if FSI is starting an inlined function. bool isInlinedFnStart(DbgFuncStartInst &FSI, const Function *CurrentFn) { - DISubprogram Subprogram(cast(FSI.getSubprogram())); + DISubprogram Subprogram(cast(FSI.getSubprogram())); if (Subprogram.describes(CurrentFn)) return false; @@ -1304,11 +1155,10 @@ /// isInlinedFnEnd - Return true if REI is ending an inlined function. bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function *CurrentFn) { - DISubprogram Subprogram(cast(REI.getContext())); + DISubprogram Subprogram(cast(REI.getContext())); if (Subprogram.isNull() || Subprogram.describes(CurrentFn)) return false; return true; } - } Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Aug 25 00:24:07 2009 @@ -98,6 +98,8 @@ for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ) UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove + // Check debug info intrinsics. + CheckDebugInfoIntrinsics(M); return false; } Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Aug 25 00:24:07 2009 @@ -16,7 +16,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/InlineAsm.h" -#include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/LLVMContext.h" #include "llvm/Metadata.h" #include "llvm/Module.h" @@ -2192,7 +2192,10 @@ } } std::vector >().swap(UpgradedIntrinsics); - + + // Check debug info intrinsics. + CheckDebugInfoIntrinsics(TheModule); + return TheModule; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Aug 25 00:24:07 2009 @@ -1739,11 +1739,10 @@ // Print source line info. O.PadToColumn(MAI->getCommentColumn()); O << MAI->getCommentString() << " SrcLine "; - if (DLT.CompileUnit->hasInitializer()) { - Constant *Name = DLT.CompileUnit->getInitializer(); - if (ConstantArray *NameString = dyn_cast(Name)) - if (NameString->isString()) - O << NameString->getAsString() << " "; + if (DLT.CompileUnit) { + std::string Str; + DICompileUnit CU(DLT.CompileUnit); + O << CU.getFilename(Str) << " "; } O << DLT.Line; if (DLT.Col != 0) @@ -1761,11 +1760,10 @@ // Print source line info O.PadToColumn(MAI->getCommentColumn()); O << MAI->getCommentString() << " SrcLine "; - if (DLT.CompileUnit->hasInitializer()) { - Constant *Name = DLT.CompileUnit->getInitializer(); - if (ConstantArray *NameString = dyn_cast(Name)) - if (NameString->isString()) - O << NameString->getAsString() << " "; + if (DLT.CompileUnit) { + std::string Str; + DICompileUnit CU(DLT.CompileUnit); + O << CU.getFilename(Str) << " "; } O << DLT.Line; if (DLT.Col != 0) Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Aug 25 00:24:07 2009 @@ -10,7 +10,7 @@ // This file contains support for writing dwarf debug info into asm files. // //===----------------------------------------------------------------------===// - +#define DEBUG_TYPE "dwarfdebug" #include "DwarfDebug.h" #include "llvm/Module.h" #include "llvm/CodeGen/MachineFunction.h" @@ -24,6 +24,7 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Timer.h" +#include "llvm/Support/Debug.h" #include "llvm/System/Path.h" using namespace llvm; @@ -56,11 +57,13 @@ /// GVToDieMap - Tracks the mapping of unit level debug informaton /// variables to debug information entries. - std::map GVToDieMap; + /// FIXME : Rename GVToDieMap -> NodeToDieMap + std::map GVToDieMap; /// GVToDIEEntryMap - Tracks the mapping of unit level debug informaton /// descriptors to debug information entries using a DIEEntry proxy. - std::map GVToDIEEntryMap; + /// FIXME : Rename + std::map GVToDIEEntryMap; /// Globals - A map of globally visible named entities for this unit. /// @@ -89,12 +92,12 @@ /// getDieMapSlotFor - Returns the debug information entry map slot for the /// specified debug variable. - DIE *&getDieMapSlotFor(GlobalVariable *GV) { return GVToDieMap[GV]; } + DIE *&getDieMapSlotFor(MDNode *N) { return GVToDieMap[N]; } /// getDIEEntrySlotFor - Returns the debug information entry proxy slot for /// the specified debug variable. - DIEEntry *&getDIEEntrySlotFor(GlobalVariable *GV) { - return GVToDIEEntryMap[GV]; + DIEEntry *&getDIEEntrySlotFor(MDNode *N) { + return GVToDIEEntryMap[N]; } /// AddDie - Adds or interns the DIE to the compile unit. @@ -239,7 +242,7 @@ for (unsigned j = 0, M = Values.size(); j < M; ++j) delete Values[j]; - for (DenseMap::iterator + for (DenseMap::iterator I = AbstractInstanceRootMap.begin(), E = AbstractInstanceRootMap.end(); I != E;++I) delete I->second; @@ -531,7 +534,7 @@ return; // Check for pre-existence. - DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getGV()); + DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getNode()); // If it exists then use the existing value. if (Slot) { @@ -545,19 +548,20 @@ // Construct type. DIE Buffer(dwarf::DW_TAG_base_type); if (Ty.isBasicType(Ty.getTag())) - ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getGV())); - else if (Ty.isDerivedType(Ty.getTag())) - ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getGV())); + ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getNode())); + else if (Ty.isCompositeType(Ty.getTag())) + ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getNode())); else { - assert(Ty.isCompositeType(Ty.getTag()) && "Unknown kind of DIType"); - ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV())); + assert(Ty.isDerivedType(Ty.getTag()) && "Unknown kind of DIType"); + ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getNode())); + } // Add debug information entry to entity and appropriate context. DIE *Die = NULL; DIDescriptor Context = Ty.getContext(); if (!Context.isNull()) - Die = DW_Unit->getDieMapSlotFor(Context.getGV()); + Die = DW_Unit->getDieMapSlotFor(Context.getNode()); if (Die) { DIE *Child = new DIE(Buffer); @@ -642,7 +646,7 @@ // Add enumerators to enumeration type. for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIE *ElemDie = NULL; - DIEnumerator Enum(Elements.getElement(i).getGV()); + DIEnumerator Enum(Elements.getElement(i).getNode()); ElemDie = ConstructEnumTypeDIE(DW_Unit, &Enum); Buffer.AddChild(ElemDie); } @@ -652,7 +656,7 @@ // Add return type. DIArray Elements = CTy.getTypeArray(); DIDescriptor RTy = Elements.getElement(0); - AddType(DW_Unit, &Buffer, DIType(RTy.getGV())); + AddType(DW_Unit, &Buffer, DIType(RTy.getNode())); // Add prototype flag. AddUInt(&Buffer, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag, 1); @@ -661,7 +665,7 @@ for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter); DIDescriptor Ty = Elements.getElement(i); - AddType(DW_Unit, Arg, DIType(Ty.getGV())); + AddType(DW_Unit, Arg, DIType(Ty.getNode())); Buffer.AddChild(Arg); } } @@ -679,13 +683,15 @@ // Add elements to structure type. for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); + if (Element.isNull()) + continue; DIE *ElemDie = NULL; if (Element.getTag() == dwarf::DW_TAG_subprogram) ElemDie = CreateSubprogramDIE(DW_Unit, - DISubprogram(Element.getGV())); + DISubprogram(Element.getNode())); else ElemDie = CreateMemberDIE(DW_Unit, - DIDerivedType(Element.getGV())); + DIDerivedType(Element.getNode())); Buffer.AddChild(ElemDie); } @@ -765,7 +771,7 @@ for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); if (Element.getTag() == dwarf::DW_TAG_subrange_type) - ConstructSubrangeDIE(Buffer, DISubrange(Element.getGV()), IndexTy); + ConstructSubrangeDIE(Buffer, DISubrange(Element.getNode()), IndexTy); } } @@ -892,7 +898,7 @@ if (Args.isNull() || SPTag != dwarf::DW_TAG_subroutine_type) AddType(DW_Unit, SPDie, SPTy); else - AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV())); + AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getNode())); } if (!SP.isDefinition()) { @@ -903,7 +909,7 @@ if (SPTag == dwarf::DW_TAG_subroutine_type) for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter); - AddType(DW_Unit, Arg, DIType(Args.getElement(i).getGV())); + AddType(DW_Unit, Arg, DIType(Args.getElement(i).getNode())); AddUInt(Arg, dwarf::DW_AT_artificial, dwarf::DW_FORM_flag, 1); // ?? SPDie->AddChild(Arg); } @@ -913,7 +919,7 @@ AddUInt(SPDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1); // DW_TAG_inlined_subroutine may refer to this DIE. - DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getGV()); + DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getNode()); Slot = SPDie; return SPDie; } @@ -922,7 +928,7 @@ /// CompileUnit &DwarfDebug::FindCompileUnit(DICompileUnit Unit) const { DenseMap::const_iterator I = - CompileUnitMap.find(Unit.getGV()); + CompileUnitMap.find(Unit.getNode()); assert(I != CompileUnitMap.end() && "Missing compile unit."); return *I->second; } @@ -975,26 +981,26 @@ /// getOrCreateScope - Returns the scope associated with the given descriptor. /// -DbgScope *DwarfDebug::getOrCreateScope(GlobalVariable *V) { - DbgScope *&Slot = DbgScopeMap[V]; +DbgScope *DwarfDebug::getOrCreateScope(MDNode *N) { + DbgScope *&Slot = DbgScopeMap[N]; if (Slot) return Slot; DbgScope *Parent = NULL; - DIBlock Block(V); + DIBlock Block(N); // Don't create a new scope if we already created one for an inlined function. - DenseMap::iterator - II = AbstractInstanceRootMap.find(V); + DenseMap::iterator + II = AbstractInstanceRootMap.find(N); if (II != AbstractInstanceRootMap.end()) return LexicalScopeStack.back(); if (!Block.isNull()) { DIDescriptor ParentDesc = Block.getContext(); Parent = - ParentDesc.isNull() ? NULL : getOrCreateScope(ParentDesc.getGV()); + ParentDesc.isNull() ? NULL : getOrCreateScope(ParentDesc.getNode()); } - Slot = new DbgScope(Parent, DIDescriptor(V)); + Slot = new DbgScope(Parent, DIDescriptor(N)); if (Parent) Parent->AddScope(Slot); @@ -1103,10 +1109,10 @@ return; // Get the subprogram debug information entry. - DISubprogram SPD(Desc.getGV()); + DISubprogram SPD(Desc.getNode()); // Get the subprogram die. - DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getGV()); + DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getNode()); assert(SPDie && "Missing subprogram descriptor"); if (!AbstractScope) { @@ -1179,8 +1185,8 @@ return SrcId; } -void DwarfDebug::ConstructCompileUnit(GlobalVariable *GV) { - DICompileUnit DIUnit(GV); +void DwarfDebug::ConstructCompileUnit(MDNode *N) { + DICompileUnit DIUnit(N); std::string Dir, FN, Prod; unsigned ID = GetOrCreateSourceID(DIUnit.getDirectory(Dir), DIUnit.getFilename(FN)); @@ -1217,15 +1223,15 @@ ModuleCU = Unit; } - CompileUnitMap[DIUnit.getGV()] = Unit; + CompileUnitMap[DIUnit.getNode()] = Unit; CompileUnits.push_back(Unit); } -void DwarfDebug::ConstructGlobalVariableDIE(GlobalVariable *GV) { - DIGlobalVariable DI_GV(GV); +void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) { + DIGlobalVariable DI_GV(N); // Check for pre-existence. - DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getGV()); + DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getNode()); if (Slot) return; @@ -1251,11 +1257,11 @@ return; } -void DwarfDebug::ConstructSubprogram(GlobalVariable *GV) { - DISubprogram SP(GV); +void DwarfDebug::ConstructSubprogram(MDNode *N) { + DISubprogram SP(N); // Check for pre-existence. - DIE *&Slot = ModuleCU->getDieMapSlotFor(GV); + DIE *&Slot = ModuleCU->getDieMapSlotFor(N); if (Slot) return; @@ -1538,6 +1544,9 @@ /// correspondence to the source line list. unsigned DwarfDebug::RecordSourceLine(unsigned Line, unsigned Col, DICompileUnit CU) { + if (!MMI) + return 0; + if (TimePassesIsEnabled) DebugTimer->startTimer(); @@ -1572,11 +1581,11 @@ } /// RecordRegionStart - Indicate the start of a region. -unsigned DwarfDebug::RecordRegionStart(GlobalVariable *V) { +unsigned DwarfDebug::RecordRegionStart(MDNode *N) { if (TimePassesIsEnabled) DebugTimer->startTimer(); - DbgScope *Scope = getOrCreateScope(V); + DbgScope *Scope = getOrCreateScope(N); unsigned ID = MMI->NextLabelID(); if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); LexicalScopeStack.push_back(Scope); @@ -1588,11 +1597,11 @@ } /// RecordRegionEnd - Indicate the end of a region. -unsigned DwarfDebug::RecordRegionEnd(GlobalVariable *V) { +unsigned DwarfDebug::RecordRegionEnd(MDNode *N) { if (TimePassesIsEnabled) DebugTimer->startTimer(); - DbgScope *Scope = getOrCreateScope(V); + DbgScope *Scope = getOrCreateScope(N); unsigned ID = MMI->NextLabelID(); Scope->setEndLabelID(ID); // FIXME : region.end() may not be in the last basic block. @@ -1609,41 +1618,36 @@ } /// RecordVariable - Indicate the declaration of a local variable. -void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { +void DwarfDebug::RecordVariable(MDNode *N, unsigned FrameIndex) { if (TimePassesIsEnabled) DebugTimer->startTimer(); - DIDescriptor Desc(GV); + DIDescriptor Desc(N); DbgScope *Scope = NULL; bool InlinedFnVar = false; - if (Desc.getTag() == dwarf::DW_TAG_variable) { - // GV is a global variable. - DIGlobalVariable DG(GV); - Scope = getOrCreateScope(DG.getContext().getGV()); - } else { + if (Desc.getTag() == dwarf::DW_TAG_variable) + Scope = getOrCreateScope(DIGlobalVariable(N).getContext().getNode()); + else { bool InlinedVar = false; - DIVariable DV(GV); - GlobalVariable *V = DV.getContext().getGV(); - DISubprogram SP(V); + MDNode *Context = DIVariable(N).getContext().getNode(); + DISubprogram SP(Context); if (!SP.isNull()) { // SP is inserted into DbgAbstractScopeMap when inlined function // start was recorded by RecordInlineFnStart. - DenseMap::iterator - I = DbgAbstractScopeMap.find(SP.getGV()); + DenseMap::iterator + I = DbgAbstractScopeMap.find(SP.getNode()); if (I != DbgAbstractScopeMap.end()) { InlinedVar = true; Scope = I->second; } } - if (!InlinedVar) { - // GV is a local variable. - Scope = getOrCreateScope(V); - } + if (!InlinedVar) + Scope = getOrCreateScope(Context); } assert(Scope && "Unable to find the variable's scope"); - DbgVariable *DV = new DbgVariable(DIVariable(GV), FrameIndex, InlinedFnVar); + DbgVariable *DV = new DbgVariable(DIVariable(N), FrameIndex, InlinedFnVar); Scope->AddVariable(DV); if (TimePassesIsEnabled) @@ -1661,17 +1665,17 @@ if (TimePassesIsEnabled) DebugTimer->startTimer(); - GlobalVariable *GV = SP.getGV(); - DenseMap::iterator - II = AbstractInstanceRootMap.find(GV); + MDNode *Node = SP.getNode(); + DenseMap::iterator + II = AbstractInstanceRootMap.find(Node); if (II == AbstractInstanceRootMap.end()) { // Create an abstract instance entry for this inlined function if it doesn't // already exist. - DbgScope *Scope = new DbgScope(NULL, DIDescriptor(GV)); + DbgScope *Scope = new DbgScope(NULL, DIDescriptor(Node)); // Get the compile unit context. - DIE *SPDie = ModuleCU->getDieMapSlotFor(GV); + DIE *SPDie = ModuleCU->getDieMapSlotFor(Node); if (!SPDie) SPDie = CreateSubprogramDIE(ModuleCU, SP, false, true); @@ -1683,18 +1687,18 @@ AddUInt(SPDie, dwarf::DW_AT_inline, 0, dwarf::DW_INL_declared_not_inlined); // Keep track of the abstract scope for this function. - DbgAbstractScopeMap[GV] = Scope; + DbgAbstractScopeMap[Node] = Scope; - AbstractInstanceRootMap[GV] = Scope; + AbstractInstanceRootMap[Node] = Scope; AbstractInstanceRootList.push_back(Scope); } // Create a concrete inlined instance for this inlined function. - DbgConcreteScope *ConcreteScope = new DbgConcreteScope(DIDescriptor(GV)); + DbgConcreteScope *ConcreteScope = new DbgConcreteScope(DIDescriptor(Node)); DIE *ScopeDie = new DIE(dwarf::DW_TAG_inlined_subroutine); ScopeDie->setAbstractCompileUnit(ModuleCU); - DIE *Origin = ModuleCU->getDieMapSlotFor(GV); + DIE *Origin = ModuleCU->getDieMapSlotFor(Node); AddDIEEntry(ScopeDie, dwarf::DW_AT_abstract_origin, dwarf::DW_FORM_ref4, Origin); AddUInt(ScopeDie, dwarf::DW_AT_call_file, 0, ModuleCU->getID()); @@ -1708,20 +1712,20 @@ LexicalScopeStack.back()->AddConcreteInst(ConcreteScope); // Keep track of the concrete scope that's inlined into this function. - DenseMap >::iterator - SI = DbgConcreteScopeMap.find(GV); + DenseMap >::iterator + SI = DbgConcreteScopeMap.find(Node); if (SI == DbgConcreteScopeMap.end()) - DbgConcreteScopeMap[GV].push_back(ConcreteScope); + DbgConcreteScopeMap[Node].push_back(ConcreteScope); else SI->second.push_back(ConcreteScope); // Track the start label for this inlined function. - DenseMap >::iterator - I = InlineInfo.find(GV); + DenseMap >::iterator + I = InlineInfo.find(Node); if (I == InlineInfo.end()) - InlineInfo[GV].push_back(LabelID); + InlineInfo[Node].push_back(LabelID); else I->second.push_back(LabelID); @@ -1739,9 +1743,9 @@ if (TimePassesIsEnabled) DebugTimer->startTimer(); - GlobalVariable *GV = SP.getGV(); - DenseMap >::iterator - I = DbgConcreteScopeMap.find(GV); + MDNode *Node = SP.getNode(); + DenseMap >::iterator + I = DbgConcreteScopeMap.find(Node); if (I == DbgConcreteScopeMap.end()) { // FIXME: Can this situation actually happen? And if so, should it? @@ -2446,11 +2450,11 @@ Asm->EmitInt16(dwarf::DWARF_VERSION); Asm->EOL("Dwarf Version"); Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Address Size (in bytes)"); - for (DenseMap >::iterator + for (DenseMap >::iterator I = InlineInfo.begin(), E = InlineInfo.end(); I != E; ++I) { - GlobalVariable *GV = I->first; + MDNode *Node = I->first; SmallVector &Labels = I->second; - DISubprogram SP(GV); + DISubprogram SP(Node); std::string Name; std::string LName; @@ -2476,7 +2480,7 @@ for (SmallVector::iterator LI = Labels.begin(), LE = Labels.end(); LI != LE; ++LI) { - DIE *SP = ModuleCU->getDieMapSlotFor(GV); + DIE *SP = ModuleCU->getDieMapSlotFor(Node); Asm->EmitInt32(SP->getOffset()); Asm->EOL("DIE offset"); if (TD->getPointerSize() == sizeof(int32_t)) Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Aug 25 00:24:07 2009 @@ -139,25 +139,25 @@ DbgScope *FunctionDbgScope; /// DbgScopeMap - Tracks the scopes in the current function. - DenseMap DbgScopeMap; + DenseMap DbgScopeMap; /// DbgAbstractScopeMap - Tracks abstract instance scopes in the current /// function. - DenseMap DbgAbstractScopeMap; + DenseMap DbgAbstractScopeMap; /// DbgConcreteScopeMap - Tracks concrete instance scopes in the current /// function. - DenseMap > DbgConcreteScopeMap; /// InlineInfo - Keep track of inlined functions and their location. This /// information is used to populate debug_inlined section. - DenseMap > InlineInfo; + DenseMap > InlineInfo; /// AbstractInstanceRootMap - Map of abstract instance roots of inlined /// functions. These are subroutine entries that contain a DW_AT_inline /// attribute. - DenseMap AbstractInstanceRootMap; + DenseMap AbstractInstanceRootMap; /// AbstractInstanceRootList - List of abstract instance roots of inlined /// functions. These are subroutine entries that contain a DW_AT_inline @@ -335,7 +335,7 @@ /// getOrCreateScope - Returns the scope associated with the given descriptor. /// - DbgScope *getOrCreateScope(GlobalVariable *V); + DbgScope *getOrCreateScope(MDNode *N); /// ConstructDbgScope - Construct the components of a scope. /// @@ -448,11 +448,11 @@ unsigned GetOrCreateSourceID(const std::string &DirName, const std::string &FileName); - void ConstructCompileUnit(GlobalVariable *GV); + void ConstructCompileUnit(MDNode *N); - void ConstructGlobalVariableDIE(GlobalVariable *GV); + void ConstructGlobalVariableDIE(MDNode *N); - void ConstructSubprogram(GlobalVariable *GV); + void ConstructSubprogram(MDNode *N); public: //===--------------------------------------------------------------------===// @@ -506,13 +506,13 @@ const std::string &FileName); /// RecordRegionStart - Indicate the start of a region. - unsigned RecordRegionStart(GlobalVariable *V); + unsigned RecordRegionStart(MDNode *N); /// RecordRegionEnd - Indicate the end of a region. - unsigned RecordRegionEnd(GlobalVariable *V); + unsigned RecordRegionEnd(MDNode *N); /// RecordVariable - Indicate the declaration of a local variable. - void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); + void RecordVariable(MDNode *N, unsigned FrameIndex); //// RecordInlinedFnStart - Indicate the start of inlined subroutine. unsigned RecordInlinedFnStart(DISubprogram &SP, DICompileUnit CU, Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Aug 25 00:24:07 2009 @@ -80,13 +80,13 @@ } /// RecordRegionStart - Indicate the start of a region. -unsigned DwarfWriter::RecordRegionStart(GlobalVariable *V) { - return DD->RecordRegionStart(V); +unsigned DwarfWriter::RecordRegionStart(MDNode *N) { + return DD->RecordRegionStart(N); } /// RecordRegionEnd - Indicate the end of a region. -unsigned DwarfWriter::RecordRegionEnd(GlobalVariable *V) { - return DD->RecordRegionEnd(V); +unsigned DwarfWriter::RecordRegionEnd(MDNode *N) { + return DD->RecordRegionEnd(N); } /// getRecordSourceLineCount - Count source lines. @@ -96,8 +96,8 @@ /// RecordVariable - Indicate the declaration of a local variable. /// -void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { - DD->RecordVariable(GV, FrameIndex); +void DwarfWriter::RecordVariable(MDNode *N, unsigned FrameIndex) { + DD->RecordVariable(N, FrameIndex); } /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should @@ -106,8 +106,7 @@ return DD && DD->ShouldEmitDwarfDebug(); } -//// RecordInlinedFnStart - Global variable GV is inlined at the location marked -//// by LabelID label. +//// RecordInlinedFnStart unsigned DwarfWriter::RecordInlinedFnStart(DISubprogram SP, DICompileUnit CU, unsigned Line, unsigned Col) { return DD->RecordInlinedFnStart(SP, CU, Line, Col); Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Aug 25 00:24:07 2009 @@ -333,7 +333,7 @@ /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given /// source file, line, and column. If none currently exists, create a new /// DebugLocTuple, and insert it into the DebugIdMap. -unsigned MachineFunction::getOrCreateDebugLocID(GlobalVariable *CompileUnit, +unsigned MachineFunction::getOrCreateDebugLocID(MDNode *CompileUnit, unsigned Line, unsigned Col) { DebugLocTuple Tuple(CompileUnit, Line, Col); DenseMap::iterator II Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Aug 25 00:24:07 2009 @@ -335,7 +335,7 @@ if (isValidDebugInfoIntrinsic(*RSI, CodeGenOpt::None) && DW && DW->ShouldEmitDwarfDebug()) { unsigned ID = - DW->RecordRegionStart(cast(RSI->getContext())); + DW->RecordRegionStart(RSI->getContext()); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, DL, II).addImm(ID); } @@ -346,7 +346,7 @@ if (isValidDebugInfoIntrinsic(*REI, CodeGenOpt::None) && DW && DW->ShouldEmitDwarfDebug()) { unsigned ID = 0; - DISubprogram Subprogram(cast(REI->getContext())); + DISubprogram Subprogram(REI->getContext()); if (isInlinedFnEnd(*REI, MF.getFunction())) { // This is end of an inlined function. const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); @@ -359,7 +359,7 @@ BuildMI(MBB, DL, II).addImm(ID); } else { const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); - ID = DW->RecordRegionEnd(cast(REI->getContext())); + ID = DW->RecordRegionEnd(REI->getContext()); BuildMI(MBB, DL, II).addImm(ID); } } @@ -384,7 +384,7 @@ setCurDebugLoc(ExtractDebugLocation(*FSI, MF.getDebugLocInfo())); DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); - DISubprogram SP(cast(FSI->getSubprogram())); + DISubprogram SP(FSI->getSubprogram()); unsigned LabelID = DW->RecordInlinedFnStart(SP, DICompileUnit(PrevLocTpl.CompileUnit), PrevLocTpl.Line, @@ -398,7 +398,7 @@ MF.setDefaultDebugLoc(ExtractDebugLocation(*FSI, MF.getDebugLocInfo())); // llvm.dbg.func_start also defines beginning of function scope. - DW->RecordRegionStart(cast(FSI->getSubprogram())); + DW->RecordRegionStart(FSI->getSubprogram()); return true; } case Intrinsic::dbg_declare: { @@ -419,10 +419,7 @@ if (SI == StaticAllocaMap.end()) break; // VLAs. int FI = SI->second; - // Determine the debug globalvariable. - GlobalValue *GV = cast(Variable); - - DW->RecordVariable(cast(GV), FI); + DW->RecordVariable(cast(Variable), FI); return true; } case Intrinsic::eh_exception: { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Aug 25 00:24:07 2009 @@ -1593,9 +1593,9 @@ bool useLABEL = TLI.isOperationLegalOrCustom(ISD::DBG_LABEL, MVT::Other); const DbgStopPointSDNode *DSP = cast(Node); - GlobalVariable *CU_GV = cast(DSP->getCompileUnit()); - if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) { - DICompileUnit CU(cast(DSP->getCompileUnit())); + MDNode *CU_Node = DSP->getCompileUnit(); + if (DW && (useDEBUG_LOC || useLABEL)) { + DICompileUnit CU(CU_Node); unsigned Line = DSP->getLine(); unsigned Col = DSP->getColumn(); @@ -1607,7 +1607,7 @@ return DAG.getNode(ISD::DEBUG_LOC, dl, MVT::Other, Node->getOperand(0), DAG.getConstant(Line, MVT::i32), DAG.getConstant(Col, MVT::i32), - DAG.getSrcValue(CU.getGV())); + DAG.getSrcValue(CU.getNode())); } else { unsigned ID = DW->RecordSourceLine(Line, Col, CU); return DAG.getLabel(ISD::DBG_LABEL, dl, Node->getOperand(0), ID); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 25 00:24:07 2009 @@ -1286,7 +1286,7 @@ SDValue SelectionDAG::getDbgStopPoint(DebugLoc DL, SDValue Root, unsigned Line, unsigned Col, - Value *CU) { + MDNode *CU) { SDNode *N = NodeAllocator.Allocate(); new (N) DbgStopPointSDNode(Root, Line, Col, CU); N->setDebugLoc(DL); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Aug 25 00:24:07 2009 @@ -3876,7 +3876,7 @@ if (isValidDebugInfoIntrinsic(RSI, OptLevel) && DW && DW->ShouldEmitDwarfDebug()) { unsigned LabelID = - DW->RecordRegionStart(cast(RSI.getContext())); + DW->RecordRegionStart(RSI.getContext()); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), getRoot(), LabelID)); } @@ -3891,7 +3891,7 @@ return 0; MachineFunction &MF = DAG.getMachineFunction(); - DISubprogram Subprogram(cast(REI.getContext())); + DISubprogram Subprogram(REI.getContext()); if (isInlinedFnEnd(REI, MF.getFunction())) { // This is end of inlined function. Debugging information for inlined @@ -3910,7 +3910,7 @@ } unsigned LabelID = - DW->RecordRegionEnd(cast(REI.getContext())); + DW->RecordRegionEnd(REI.getContext()); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), getRoot(), LabelID)); return 0; @@ -3942,7 +3942,7 @@ if (!DW || !DW->ShouldEmitDwarfDebug()) return 0; DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); - DISubprogram SP(cast(FSI.getSubprogram())); + DISubprogram SP(FSI.getSubprogram()); DICompileUnit CU(PrevLocTpl.CompileUnit); unsigned LabelID = DW->RecordInlinedFnStart(SP, CU, PrevLocTpl.Line, @@ -3958,7 +3958,7 @@ if (!DW || !DW->ShouldEmitDwarfDebug()) return 0; // llvm.dbg.func_start also defines beginning of function scope. - DW->RecordRegionStart(cast(FSI.getSubprogram())); + DW->RecordRegionStart(FSI.getSubprogram()); return 0; } case Intrinsic::dbg_declare: { @@ -3981,7 +3981,7 @@ if (!AI) return 0; int FI = FuncInfo.StaticAllocaMap[AI]; - DW->RecordVariable(cast(Variable), FI); + DW->RecordVariable(cast(Variable), FI); return 0; } case Intrinsic::eh_exception: { Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp Tue Aug 25 00:24:07 2009 @@ -1,3 +1,4 @@ + //===-- PIC16DebugInfo.cpp - Implementation for PIC16 Debug Information ======// // // The LLVM Compiler Infrastructure @@ -69,7 +70,7 @@ // We also need to encode the the information about the base type of // pointer in TypeNo. - DIType BaseType = DIDerivedType(Ty.getGV()).getTypeDerivedFrom(); + DIType BaseType = DIDerivedType(Ty.getNode()).getTypeDerivedFrom(); PopulateDebugInfo(BaseType, TypeNo, HasAux, Aux, TagName); } @@ -78,7 +79,7 @@ bool &HasAux, int Aux[], std::string &TagName) { - DICompositeType CTy = DICompositeType(Ty.getGV()); + DICompositeType CTy = DICompositeType(Ty.getNode()); DIArray Elements = CTy.getTypeArray(); unsigned short size = 1; unsigned short Dimension[4]={0,0,0,0}; @@ -87,7 +88,7 @@ if (Element.getTag() == dwarf::DW_TAG_subrange_type) { TypeNo = TypeNo << PIC16Dbg::S_DERIVED; TypeNo = TypeNo | PIC16Dbg::DT_ARY; - DISubrange SubRange = DISubrange(Element.getGV()); + DISubrange SubRange = DISubrange(Element.getNode()); Dimension[i] = SubRange.getHi() - SubRange.getLo() + 1; // Each dimension is represented by 2 bytes starting at byte 9. Aux[8+i*2+0] = Dimension[i]; @@ -110,7 +111,7 @@ unsigned short &TypeNo, bool &HasAux, int Aux[], std::string &TagName) { - DICompositeType CTy = DICompositeType(Ty.getGV()); + DICompositeType CTy = DICompositeType(Ty.getNode()); TypeNo = TypeNo << PIC16Dbg::S_BASIC; if (Ty.getTag() == dwarf::DW_TAG_structure_type) TypeNo = TypeNo | PIC16Dbg::T_STRUCT; @@ -123,7 +124,7 @@ // llvm.dbg.composite* global variable. Since we need to revisit // PIC16DebugInfo implementation anyways after the MDNodes based // framework is done, let us continue with the way it is. - std::string UniqueSuffix = "." + Ty.getGV()->getNameStr().substr(18); + std::string UniqueSuffix = "." + Ty.getNode()->getNameStr().substr(18); TagName += UniqueSuffix; unsigned short size = CTy.getSizeInBits()/8; // 7th and 8th byte represent size. @@ -210,11 +211,10 @@ DbgFinder.processModule(M); if (DbgFinder.compile_unit_count() != 0) { // FIXME : What if more then one CUs are present in a module ? - GlobalVariable *CU = *DbgFinder.compile_unit_begin(); + MDNode *CU = *DbgFinder.compile_unit_begin(); EmitDebugDirectives = true; SwitchToCU(CU); } - // Emit debug info for decls of composite types. EmitCompositeTypeDecls(M); } @@ -259,7 +259,7 @@ if (! EmitDebugDirectives) return; assert (! DL.isUnknown() && "can't change to invalid debug loc"); - GlobalVariable *CU = MF.getDebugLocTuple(DL).CompileUnit; + MDNode *CU = MF.getDebugLocTuple(DL).CompileUnit; unsigned line = MF.getDebugLocTuple(DL).Line; SwitchToCU(CU); @@ -306,8 +306,7 @@ int ElementAux[PIC16Dbg::AuxSize] = { 0 }; std::string TagName = ""; std::string ElementName; - GlobalVariable *GV = Element.getGV(); - DIDerivedType DITy(GV); + DIDerivedType DITy(Element.getNode()); DITy.getName(ElementName); unsigned short ElementSize = DITy.getSizeInBits()/8; // Get mangleddd name for this structure/union element. @@ -343,7 +342,7 @@ CTy.getName(Name); // Get the number after llvm.dbg.composite and make UniqueSuffix from // it. - std::string DIVar = CTy.getGV()->getNameStr(); + std::string DIVar = CTy.getNode()->getNameStr(); std::string UniqueSuffix = "." + DIVar.substr(18); std::string MangledCTyName = Name + UniqueSuffix; unsigned short size = CTy.getSizeInBits()/8; @@ -441,7 +440,7 @@ void PIC16DbgInfo::EmitVarDebugInfo(Module &M) { DebugInfoFinder DbgFinder; DbgFinder.processModule(M); - + for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(), E = DbgFinder.global_variable_end(); I != E; ++I) { DIGlobalVariable DIGV(*I); @@ -466,7 +465,7 @@ /// SwitchToCU - Switch to a new compilation unit. /// -void PIC16DbgInfo::SwitchToCU(GlobalVariable *CU) { +void PIC16DbgInfo::SwitchToCU(MDNode *CU) { // Get the file path from CU. DICompileUnit cu(CU); std::string DirName, FileName; Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h Tue Aug 25 00:24:07 2009 @@ -117,7 +117,7 @@ private: - void SwitchToCU (GlobalVariable *CU); + void SwitchToCU (MDNode *CU); void SwitchToLine (unsigned Line, bool IsInBeginFunction = false); void PopulateDebugInfo (DIType Ty, unsigned short &TypeNo, bool &HasAux, Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Tue Aug 25 00:24:07 2009 @@ -203,167 +203,56 @@ // llvm.dbg.region.end calls, and any globals they point to if now dead. static bool StripDebugInfo(Module &M) { - SmallPtrSet llvmUsedValues; - findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues); - findUsedValues(M.getGlobalVariable("llvm.compiler.used"), llvmUsedValues); - - DebugInfoFinder DbgFinder; - DbgFinder.processModule(M); - - // These anchors use LinkOnce linkage so that the optimizer does not - // remove them accidently. Set InternalLinkage for all these debug - // info anchors. - for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(), - E = DbgFinder.compile_unit_end(); I != E; ++I) - (*I)->setLinkage(GlobalValue::InternalLinkage); - for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(), - E = DbgFinder.global_variable_end(); I != E; ++I) - (*I)->setLinkage(GlobalValue::InternalLinkage); - for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(), - E = DbgFinder.subprogram_end(); I != E; ++I) - (*I)->setLinkage(GlobalValue::InternalLinkage); - - - // Delete all dbg variables. - for (Module::global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) { - GlobalVariable *GV = dyn_cast(I); - if (!GV) continue; - if (!GV->use_empty() && llvmUsedValues.count(I) == 0) { - if (GV->getName().startswith("llvm.dbg")) { - GV->replaceAllUsesWith(UndefValue::get(GV->getType())); - } - } - } - + // Remove all of the calls to the debugger intrinsics, and remove them from + // the module. Function *FuncStart = M.getFunction("llvm.dbg.func.start"); Function *StopPoint = M.getFunction("llvm.dbg.stoppoint"); Function *RegionStart = M.getFunction("llvm.dbg.region.start"); Function *RegionEnd = M.getFunction("llvm.dbg.region.end"); Function *Declare = M.getFunction("llvm.dbg.declare"); - std::vector DeadConstants; - - // Remove all of the calls to the debugger intrinsics, and remove them from - // the module. if (FuncStart) { while (!FuncStart->use_empty()) { CallInst *CI = cast(FuncStart->use_back()); - Value *Arg = CI->getOperand(1); - assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); - if (Arg->use_empty()) - if (Constant *C = dyn_cast(Arg)) - DeadConstants.push_back(C); } FuncStart->eraseFromParent(); } if (StopPoint) { while (!StopPoint->use_empty()) { CallInst *CI = cast(StopPoint->use_back()); - Value *Arg = CI->getOperand(3); - assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); - if (Arg->use_empty()) - if (Constant *C = dyn_cast(Arg)) - DeadConstants.push_back(C); } StopPoint->eraseFromParent(); } if (RegionStart) { while (!RegionStart->use_empty()) { CallInst *CI = cast(RegionStart->use_back()); - Value *Arg = CI->getOperand(1); - assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); - if (Arg->use_empty()) - if (Constant *C = dyn_cast(Arg)) - DeadConstants.push_back(C); } RegionStart->eraseFromParent(); } if (RegionEnd) { while (!RegionEnd->use_empty()) { CallInst *CI = cast(RegionEnd->use_back()); - Value *Arg = CI->getOperand(1); - assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); - if (Arg->use_empty()) - if (Constant *C = dyn_cast(Arg)) - DeadConstants.push_back(C); } RegionEnd->eraseFromParent(); } if (Declare) { while (!Declare->use_empty()) { CallInst *CI = cast(Declare->use_back()); - Value *Arg1 = CI->getOperand(1); - Value *Arg2 = CI->getOperand(2); - assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); - if (Arg1->use_empty()) { - if (Constant *C = dyn_cast(Arg1)) - DeadConstants.push_back(C); - else - RecursivelyDeleteTriviallyDeadInstructions(Arg1); - } - if (Arg2->use_empty()) - if (Constant *C = dyn_cast(Arg2)) - DeadConstants.push_back(C); } Declare->eraseFromParent(); } - // llvm.dbg.compile_units and llvm.dbg.subprograms are marked as linkonce - // but since we are removing all debug information, make them internal now. - // FIXME: Use private linkage maybe? - if (Constant *C = M.getNamedGlobal("llvm.dbg.compile_units")) - if (GlobalVariable *GV = dyn_cast(C)) - GV->setLinkage(GlobalValue::InternalLinkage); - - if (Constant *C = M.getNamedGlobal("llvm.dbg.subprograms")) - if (GlobalVariable *GV = dyn_cast(C)) - GV->setLinkage(GlobalValue::InternalLinkage); - - if (Constant *C = M.getNamedGlobal("llvm.dbg.global_variables")) - if (GlobalVariable *GV = dyn_cast(C)) - GV->setLinkage(GlobalValue::InternalLinkage); - - // Delete all dbg variables. - for (Module::global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) { - GlobalVariable *GV = dyn_cast(I); - if (!GV) continue; - if (GV->use_empty() && llvmUsedValues.count(I) == 0 - && (!GV->hasSection() - || strcmp(GV->getSection().c_str(), "llvm.metadata") == 0)) - DeadConstants.push_back(GV); - } - - if (DeadConstants.empty()) - return false; - - // Delete any internal globals that were only used by the debugger intrinsics. - while (!DeadConstants.empty()) { - Constant *C = DeadConstants.back(); - DeadConstants.pop_back(); - if (GlobalVariable *GV = dyn_cast(C)) { - if (GV->hasLocalLinkage()) - RemoveDeadConstant(GV); - } - else - RemoveDeadConstant(C); - } + NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv"); + if (NMD) + NMD->eraseFromParent(); - // Remove all llvm.dbg types. - TypeSymbolTable &ST = M.getTypeSymbolTable(); - for (TypeSymbolTable::iterator TI = ST.begin(), TE = ST.end(); TI != TE; ) { - if (!strncmp(TI->first.c_str(), "llvm.dbg.", 9)) - ST.remove(TI++); - else - ++TI; - } - + // Remove dead metadata. + M.getContext().RemoveDeadMetadata(); return true; } Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Tue Aug 25 00:24:07 2009 @@ -238,7 +238,7 @@ // Do not clone llvm.dbg.region.end. It will be adjusted by the inliner. if (const DbgFuncStartInst *DFSI = dyn_cast(II)) { if (DbgFnStart == NULL) { - DISubprogram SP(cast(DFSI->getSubprogram())); + DISubprogram SP(DFSI->getSubprogram()); if (SP.describes(BB->getParent())) DbgFnStart = DFSI->getSubprogram(); } Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Tue Aug 25 00:24:07 2009 @@ -207,17 +207,17 @@ /// to the llvm.dbg.func.start of the function F. Otherwise return NULL. static const DbgRegionEndInst *findFnRegionEndMarker(const Function *F) { - GlobalVariable *FnStart = NULL; + MDNode *FnStart = NULL; const DbgRegionEndInst *FnEnd = NULL; for (Function::const_iterator FI = F->begin(), FE =F->end(); FI != FE; ++FI) for (BasicBlock::const_iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) { if (FnStart == NULL) { if (const DbgFuncStartInst *FSI = dyn_cast(BI)) { - DISubprogram SP(cast(FSI->getSubprogram())); + DISubprogram SP(FSI->getSubprogram()); assert (SP.isNull() == false && "Invalid llvm.dbg.func.start"); if (SP.describes(F)) - FnStart = SP.getGV(); + FnStart = SP.getNode(); } } else { if (const DbgRegionEndInst *REI = dyn_cast(BI)) Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original) +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Tue Aug 25 00:24:07 2009 @@ -16,8 +16,7 @@ #include "llvm/Function.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/Instructions.h" -#include "llvm/Intrinsics.h" +#include "llvm/IntrinsicInst.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" #include @@ -434,3 +433,74 @@ } } } + +/// This function checks debug info intrinsics. If an intrinsic is invalid +/// then this function simply removes the intrinsic. +void llvm::CheckDebugInfoIntrinsics(Module *M) { + + + if (Function *FuncStart = M->getFunction("llvm.dbg.func.start")) { + if (!FuncStart->use_empty()) { + DbgFuncStartInst *DFSI = cast(FuncStart->use_back()); + if (!isa(DFSI->getOperand(1))) { + while (!FuncStart->use_empty()) { + CallInst *CI = cast(FuncStart->use_back()); + CI->eraseFromParent(); + } + FuncStart->eraseFromParent(); + } + } + } + + if (Function *StopPoint = M->getFunction("llvm.dbg.stoppoint")) { + if (!StopPoint->use_empty()) { + DbgStopPointInst *DSPI = cast(StopPoint->use_back()); + if (!isa(DSPI->getOperand(3))) { + while (!StopPoint->use_empty()) { + CallInst *CI = cast(StopPoint->use_back()); + CI->eraseFromParent(); + } + StopPoint->eraseFromParent(); + } + } + } + + if (Function *RegionStart = M->getFunction("llvm.dbg.region.start")) { + if (!RegionStart->use_empty()) { + DbgRegionStartInst *DRSI = cast(RegionStart->use_back()); + if (!isa(DRSI->getOperand(1))) { + while (!RegionStart->use_empty()) { + CallInst *CI = cast(RegionStart->use_back()); + CI->eraseFromParent(); + } + RegionStart->eraseFromParent(); + } + } + } + + if (Function *RegionEnd = M->getFunction("llvm.dbg.region.end")) { + if (!RegionEnd->use_empty()) { + DbgRegionEndInst *DREI = cast(RegionEnd->use_back()); + if (!isa(DREI->getOperand(1))) { + while (!RegionEnd->use_empty()) { + CallInst *CI = cast(RegionEnd->use_back()); + CI->eraseFromParent(); + } + RegionEnd->eraseFromParent(); + } + } + } + + if (Function *Declare = M->getFunction("llvm.dbg.declare")) { + if (!Declare->use_empty()) { + DbgDeclareInst *DDI = cast(Declare->use_back()); + if (!isa(DDI->getOperand(2))) { + while (!Declare->use_empty()) { + CallInst *CI = cast(Declare->use_back()); + CI->eraseFromParent(); + } + Declare->eraseFromParent(); + } + } + } +} Modified: llvm/trunk/lib/VMCore/Metadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Metadata.cpp (original) +++ llvm/trunk/lib/VMCore/Metadata.cpp Tue Aug 25 00:24:07 2009 @@ -82,7 +82,7 @@ V.reserve(NumVals); for (unsigned i = 0; i < NumVals; ++i) V.push_back(Vals[i]); - + return pImpl->MDNodes.getOrCreate(Type::getMetadataTy(Context), V); } Modified: llvm/trunk/lib/VMCore/ValueTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ValueTypes.cpp?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ValueTypes.cpp (original) +++ llvm/trunk/lib/VMCore/ValueTypes.cpp Tue Aug 25 00:24:07 2009 @@ -169,6 +169,7 @@ case MVT::v8f32: return VectorType::get(Type::getFloatTy(Context), 8); case MVT::v2f64: return VectorType::get(Type::getDoubleTy(Context), 2); case MVT::v4f64: return VectorType::get(Type::getDoubleTy(Context), 4); + case MVT::Metadata: return Type::getMetadataTy(Context); } } Removed: llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll (original) +++ llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll (removed) @@ -1,56 +0,0 @@ -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | grep alloca | 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 = "i386-apple-darwin9.5" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 393262, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 2, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [7 x i8] c"adce.c\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] - at .str1 = internal constant [6 x i8] c"/tmp/\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] - at .str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc. build 5623) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] - at .str3 = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 393252, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at .str4 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 393472, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at .str5 = internal constant [2 x i8] c"i\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - -define i32 @foo() nounwind { -entry: - %retval = alloca i32 ; [#uses=2] - %i = alloca i32 ; [#uses=4] - %0 = alloca i32 ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - %i1 = bitcast i32* %i to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %i1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - store i32 4, i32* %i, align 4 - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %1 = load i32* %i, align 4 ; [#uses=1] - %2 = mul i32 %1, 84 ; [#uses=1] - store i32 %2, i32* %i, align 4 - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - store i32 42, i32* %0, align 4 - %3 = load i32* %0, align 4 ; [#uses=1] - store i32 %3, i32* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval2 = load i32* %retval ; [#uses=1] - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - ret i32 %retval2 -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.declare({ }*, { }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind Removed: llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll (original) +++ llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll (removed) @@ -1,44 +0,0 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep stoppoint | count 3 -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.5" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 393262, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 2, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [7 x i8] c"adce.c\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] - at .str1 = internal constant [6 x i8] c"/tmp/\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] - at .str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc. build 5623) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] - at .str3 = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 393252, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at .str4 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 393472, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] - at .str5 = internal constant [2 x i8] c"i\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - -define i32 @foo() nounwind { -entry: - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %0 = mul i32 4, 84 ; [#uses=0] - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - br label %return - -return: ; preds = %entry - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - ret i32 42 -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.declare({ }*, { }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind Removed: llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll (removed) @@ -1,23 +0,0 @@ -; RUN: llvm-as < %s | llc | grep 0x49 | count 3 -; Count number of DW_AT_Type attributes. -target triple = "i386-apple-darwin*" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }* } - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* } - %llvm.dbg.subrange.type = type { i32, i64, i64 } - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [8 x i8] c"array.c\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test\00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at c = common global [3 x i32] zeroinitializer ; <[3 x i32]*> [#uses=1] - at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type { i32 458785, i64 0, i64 2 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] - at llvm.dbg.array = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] - at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 96, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str4 = internal constant [2 x i8] c"c\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 2, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true, { }* bitcast ([3 x i32]* @c to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] Removed: llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll (removed) @@ -1,46 +0,0 @@ -; RUN: llvm-as < %s | llc | grep "\\"m.h\\"" | count 1 -target triple = "i386-apple-darwin9.6" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }* } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [4 x i8] c"m.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test\00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at llvm.dbg.array = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]* @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at .str4 = internal constant [4 x i8] c"m.h\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.compile_unit5 = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 false, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str6 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str6, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str6, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*), i32 2, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - -define i32 @main() nounwind { -entry: - %retval = alloca i32 ; [#uses=2] - %0 = alloca i32 ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*)) - store i32 0, i32* %0, align 4 - %1 = load i32* %0, align 4 ; [#uses=1] - store i32 %1, i32* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval1 = load i32* %retval ; [#uses=1] - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*)) - call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - ret i32 %retval1 -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind Removed: llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll (removed) @@ -1,32 +0,0 @@ -; RUN: llvm-as < %s | llc | grep 0x3C | count 1 -; Check DW_AT_declaration attribute for class method foo. -target triple = "i386-apple-darwin*" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i8* } - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }*, i8*, i8* } - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, i8*, i8* } - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }*, i8*, i8* } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, i8*, i8* } - %struct.A = type <{ i8 }> - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [6 x i8] c"cl.cc\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test\00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at a = global %struct.A zeroinitializer ; <%struct.A*> [#uses=1] - at .str3 = internal constant [2 x i8] c"A\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at .str4 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite9 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.array = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] - at llvm.dbg.composite5 = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str6 = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at .str7 = internal constant [12 x i8] c"_ZN1A3fooEv\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str6, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str6, i32 0, i32 0), i8* getelementptr ([12 x i8]* @.str7, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 4, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite5 to { }*), i1 false, i1 false, i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.array8 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] - at llvm.dbg.composite9 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 2, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]* @llvm.dbg.array8 to { }*), i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str10 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str10, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str10, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 7, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite9 to { }*), i1 false, i1 true, { }* bitcast (%struct.A* @a to { }*), i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] Removed: llvm/trunk/test/DebugInfo/2009-01-30-Method.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-30-Method.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-30-Method.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-30-Method.ll (removed) @@ -1,103 +0,0 @@ -; RUN: llvm-as < %s | llc -O0 | grep "\\"foo" | count 3 -; 1 declaration, 1 definition and 1 pubnames entry. -target triple = "i386-apple-darwin*" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }* } - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }* } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } - %struct.Fibonancci = type { i32 } - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [10 x i8] c"method.cc\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] - at .str1 = internal constant [64 x i8] c"/Volumes/Nanpura/mainline/llvmgcc42.build/gcc/../../../dbg.test\00", section "llvm.metadata" ; <[64 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8* getelementptr ([10 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([64 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at .str3 = internal constant [11 x i8] c"Fibonancci\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] - at .str4 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at .str5 = internal constant [2 x i8] c"N\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 5, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.derivedtype6 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.array = internal constant [3 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype6 to { }*), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] - at llvm.dbg.composite7 = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str8 = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at .str9 = internal constant [22 x i8] c"_ZN10Fibonancci3fooEi\00", section "llvm.metadata" ; <[22 x i8]*> [#uses=1] - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([22 x i8]* @.str9, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite7 to { }*), i1 false, i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.array10 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] - at llvm.dbg.composite11 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, i64 32, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array10 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.derivedtype12 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.array13 = internal constant [3 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 to { }*), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* @llvm.dbg.array13 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.subprogram14 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([22 x i8]* @.str9, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.derivedtype15 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at .str16 = internal constant [5 x i8] c"this\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*), i8* getelementptr ([5 x i8]* @.str16, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype15 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at .str17 = internal constant [2 x i8] c"i\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.variable18 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*), i8* getelementptr ([2 x i8]* @.str17, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at llvm.dbg.array19 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] - at llvm.dbg.composite20 = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]* @llvm.dbg.array19 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at .str21 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] - at llvm.dbg.subprogram22 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str21, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str21, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 14, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite20 to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at .str23 = internal constant [4 x i8] c"fib\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.variable24 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram22 to { }*), i8* getelementptr ([4 x i8]* @.str23, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 15, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - -define void @_ZN10Fibonancci3fooEi(%struct.Fibonancci* %this, i32 %i) nounwind { -entry: - %this_addr = alloca %struct.Fibonancci* ; <%struct.Fibonancci**> [#uses=3] - %i_addr = alloca i32 ; [#uses=3] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*)) - %0 = bitcast %struct.Fibonancci** %this_addr to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) - store %struct.Fibonancci* %this, %struct.Fibonancci** %this_addr - %1 = bitcast i32* %i_addr to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable18 to { }*)) - store i32 %i, i32* %i_addr - call void @llvm.dbg.stoppoint(i32 11, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %2 = load %struct.Fibonancci** %this_addr, align 4 ; <%struct.Fibonancci*> [#uses=1] - %3 = getelementptr %struct.Fibonancci* %2, i32 0, i32 0 ; [#uses=1] - %4 = load i32* %i_addr, align 4 ; [#uses=1] - store i32 %4, i32* %3, align 4 - call void @llvm.dbg.stoppoint(i32 12, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - br label %return - -return: ; preds = %entry - call void @llvm.dbg.stoppoint(i32 12, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*)) - ret void -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.declare({ }*, { }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind - -define i32 @main() nounwind { -entry: - %retval = alloca i32 ; [#uses=2] - %fib = alloca %struct.Fibonancci ; <%struct.Fibonancci*> [#uses=2] - %0 = alloca i32 ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram22 to { }*)) - %1 = bitcast %struct.Fibonancci* %fib to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable24 to { }*)) - call void @llvm.dbg.stoppoint(i32 16, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @_ZN10Fibonancci3fooEi(%struct.Fibonancci* %fib, i32 42) nounwind - call void @llvm.dbg.stoppoint(i32 17, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - store i32 0, i32* %0, align 4 - %2 = load i32* %0, align 4 ; [#uses=1] - store i32 %2, i32* %retval, align 4 - br label %return - -return: ; preds = %entry - %retval1 = load i32* %retval ; [#uses=1] - call void @llvm.dbg.stoppoint(i32 17, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram22 to { }*)) - ret i32 %retval1 -} Removed: llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll (original) +++ llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll (removed) @@ -1,41 +0,0 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep stoppoint | count 3 -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" -target triple = "i386-pc-linux-gnu" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 } - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }*, i32 } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [8 x i8] c"brach.c\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] - at .str1 = internal constant [38 x i8] c"/developer/home2/zsth/test/debug/tmp/\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([38 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 -1 }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at llvm.dbg.array = internal constant [2 x { }*] [{ }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*)], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str4 = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at .str5 = internal constant [2 x i8] c"x\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] - -define i32 @foo(i32 %x) nounwind { -entry: - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %0 = icmp sgt i32 %x, 5 ; [#uses=1] - %.0 = select i1 %0, i32 %x, i32 0 ; [#uses=1] - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - ret i32 %.0 -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.declare({ }*, { }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind Removed: llvm/trunk/test/DebugInfo/2009-03-02-sink.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-02-sink.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-03-02-sink.ll (original) +++ llvm/trunk/test/DebugInfo/2009-03-02-sink.ll (removed) @@ -1,57 +0,0 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext sdiv 1 | grep {stoppoint(i32 2} -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext add 1 | grep {stoppoint(i32 3} -; ModuleID = 'sink.c' -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.6" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 } - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }*, i32 } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [7 x i8] c"sink.c\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] - at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at llvm.dbg.array = internal constant [4 x { }*] [{ }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*)], section "llvm.metadata" ; <[4 x { }*]*> [#uses=1] - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([4 x { }*]* @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str4 = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at .str5 = internal constant [2 x i8] c"c\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at .str6 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.variable7 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str6, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at .str8 = internal constant [2 x i8] c"b\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.variable9 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str8, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - -define i32 @foo(i32 %c, i32 %a, i32 %b) nounwind { -entry: - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %tmp.2 = sdiv i32 %a, %b ; [#uses=1] - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %tmp.9 = add i32 %b, %a ; [#uses=1] - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %tmp.10 = icmp ne i32 %c, 0 ; [#uses=1] - br i1 %tmp.10, label %bb, label %bb1 - -bb: ; preds = %entry - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - ret i32 %tmp.9 - -bb1: ; preds = %entry - call void @llvm.dbg.stoppoint(i32 7, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - ret i32 %tmp.2 -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.declare({ }*, { }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind Removed: llvm/trunk/test/DebugInfo/dataOnly.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dataOnly.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/dataOnly.ll (original) +++ llvm/trunk/test/DebugInfo/dataOnly.ll (removed) @@ -1,47 +0,0 @@ -; RUN: llvm-as < %s | llc | grep DWARF -; ModuleID = 'foo.c' -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-darwin8" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* } - at x = common global i32 0 ; [#uses=1] - at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { - i32 393268, - { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), - { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), - i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0), - i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0), - i8* null, - { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), - i32 1, - { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), - i1 false, - i1 true, - { }* bitcast (i32* @x to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] - at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { - i32 393233, - { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), - i32 1, - i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), - i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0), - i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [6 x i8] c"foo.c\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] - at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5555) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at .str3 = internal constant [2 x i8] c"x\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { - i32 393252, - { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), - i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), - { }* null, - i32 0, - i64 32, - i64 32, - i64 0, - i32 0, - i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at .str4 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] Removed: llvm/trunk/test/DebugInfo/forwardDecl.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/forwardDecl.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/forwardDecl.ll (original) +++ llvm/trunk/test/DebugInfo/forwardDecl.ll (removed) @@ -1,49 +0,0 @@ -; RUN: llvm-as < %s | llc -O0 | %prcontext ST 1 | grep 0x1 | count 1 - -target triple = "i386-apple-darwin9.6" - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } - %llvm.dbg.compositetype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }* } - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }* } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } - %struct.ST = type opaque - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 393262, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, { }* null, i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([36 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [4 x i8] c"t.c\00", section "llvm.metadata" ; <[20 x i8]*> [#uses=1] - at .str1 = internal constant [36 x i8] c"/Users/echeng/LLVM/radars/r6395152/\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5628) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at .str3 = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 393473, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at .str4 = internal constant [2 x i8] c"x\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 393231, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type { i32 393235, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, i64 0, i64 8, i64 0, i32 4, { }* null, { }* bitcast ([0 x { }*]* @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at .str5 = internal constant [3 x i8] c"ST\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] - at llvm.dbg.array = internal constant [0 x { }*] zeroinitializer, section "llvm.metadata" ; <[0 x { }*]*> [#uses=1] - -define void @foo(%struct.ST* %x1) nounwind { -entry: - %x_addr = alloca %struct.ST* ; <%struct.ST**> [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - %x = bitcast %struct.ST** %x_addr to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %x, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) - store %struct.ST* %x1, %struct.ST** %x_addr - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - br label %return - -return: ; preds = %entry - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - ret void -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.declare({ }*, { }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind Removed: llvm/trunk/test/DebugInfo/printdbginfo.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/printdbginfo.ll (original) +++ llvm/trunk/test/DebugInfo/printdbginfo.ll (removed) @@ -1,136 +0,0 @@ -; RUN: llvm-as < %s | opt -print-dbginfo -disable-output > %t1 -; RUN: %prcontext {function name: Bar::bar return type: int at line 12} 1 < %t1 | grep {(tst.cpp:14)} -; RUN: %prcontext {%%tmp1} 1 < %t1 | grep -E {variable tmp.+at tst.cpp:23} -; RUN: %prcontext {; tst.cpp:24} 2 < %t1 | grep {%%6} - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } - %llvm.dbg.compositetype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }* } - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }* } - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 } - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } - %struct.Bar = type { %struct.Foo, i32 } - %struct.Foo = type { i32 } - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 45872, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8* getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 45872, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [8 x i8] c"tst.cpp\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] - at .str1 = internal constant [13 x i8] c"/home/edwin/\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5623) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at .str3 = internal constant [4 x i8] c"bar\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at .str4 = internal constant [9 x i8] c"Bar::bar\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] - at .str5 = internal constant [14 x i8] c"_ZN3Bar3barEv\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str6, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at .str6 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] - at .str7 = internal constant [5 x i8] c"this\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] - at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 5, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([5 x { }*]* @llvm.dbg.array36 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at .str8 = internal constant [4 x i8] c"Bar\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.derivedtype9 = internal constant %llvm.dbg.derivedtype.type { i32 458780, { }* null, i8* null, { }* null, i32 0, i64 0, i64 0, i64 0, i32 0, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.compositetype10 = internal constant %llvm.dbg.compositetype.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str11, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, i64 32, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* @llvm.dbg.array22 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at .str11 = internal constant [4 x i8] c"Foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.derivedtype12 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* null, i8* getelementptr ([7 x i8]* @.str13, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 2, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at .str13 = internal constant [7 x i8] c"FooVar\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] - at llvm.dbg.subprogram14 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str11, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str15, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype16 to { }*), i1 false, i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at .str15 = internal constant [9 x i8] c"Foo::Foo\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] - at llvm.dbg.compositetype16 = internal constant %llvm.dbg.compositetype.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at llvm.dbg.derivedtype17 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.derivedtype18 = internal constant %llvm.dbg.derivedtype.type { i32 458768, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.array = internal constant [3 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype17 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype18 to { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] - at llvm.dbg.subprogram19 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str11, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str15, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype20 to { }*), i1 false, i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.compositetype20 = internal constant %llvm.dbg.compositetype.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array21 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at llvm.dbg.array21 = internal constant [2 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype17 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] - at llvm.dbg.array22 = internal constant [3 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 to { }*), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram19 to { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] - at llvm.dbg.derivedtype23 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* null, i8* getelementptr ([7 x i8]* @.str24, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 6, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at .str24 = internal constant [7 x i8] c"BarVar\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] - at llvm.dbg.subprogram25 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str26, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype27 to { }*), i1 false, i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at .str26 = internal constant [9 x i8] c"Bar::Bar\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] - at llvm.dbg.compositetype27 = internal constant %llvm.dbg.compositetype.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* @llvm.dbg.array29 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at llvm.dbg.derivedtype28 = internal constant %llvm.dbg.derivedtype.type { i32 458768, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.array29 = internal constant [3 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype28 to { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] - at llvm.dbg.subprogram30 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str26, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype31 to { }*), i1 false, i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.compositetype31 = internal constant %llvm.dbg.compositetype.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array32 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at llvm.dbg.array32 = internal constant [2 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] - at llvm.dbg.subprogram33 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype34 to { }*), i1 false, i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at llvm.dbg.compositetype34 = internal constant %llvm.dbg.compositetype.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array35 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] - at llvm.dbg.array35 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] - at llvm.dbg.array36 = internal constant [5 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype9 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype23 to { }*), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram25 to { }*), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram30 to { }*), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram33 to { }*) ], section "llvm.metadata" ; <[5 x { }*]*> [#uses=1] - at llvm.dbg.variable37 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([4 x i8]* @.str38, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 15, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] - at .str38 = internal constant [4 x i8] c"tmp\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.subprogram39 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([7 x i8]* @.str40, i32 0, i32 0), i8* getelementptr ([7 x i8]* @.str40, i32 0, i32 0), i8* getelementptr ([11 x i8]* @.str41, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 21, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at .str40 = internal constant [7 x i8] c"foobar\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] - at .str41 = internal constant [11 x i8] c"_Z6foobarv\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] - at llvm.dbg.variable42 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram39 to { }*), i8* getelementptr ([4 x i8]* @.str38, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 23, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] - -define i32 @_ZN3Bar3barEv(%struct.Bar* %this1) nounwind { -entry: - tail call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - tail call void @llvm.dbg.stoppoint(i32 14, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %0 = getelementptr %struct.Bar* %this1, i64 0, i32 0, i32 0 ; [#uses=1] - %1 = load i32* %0, align 4 ; [#uses=1] - %2 = icmp sgt i32 %1, 0 ; [#uses=1] - br i1 %2, label %bb, label %bb3 - -bb: ; preds = %entry - %3 = getelementptr %struct.Bar* %this1, i64 0, i32 1 ; [#uses=1] - %4 = load i32* %3, align 4 ; [#uses=1] - %5 = shl i32 %4, 1 ; [#uses=1] - tail call void @llvm.dbg.stoppoint(i32 16, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - br label %bb4 - -bb3: ; preds = %entry - tail call void @llvm.dbg.stoppoint(i32 18, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - br label %bb4 - -bb4: ; preds = %bb3, %bb - %.0 = phi i32 [ 0, %bb3 ], [ %5, %bb ] ; [#uses=1] - tail call void @llvm.dbg.stoppoint(i32 18, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - tail call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) - ret i32 %.0 -} - -declare void @llvm.dbg.func.start({ }*) nounwind - -declare void @llvm.dbg.declare({ }*, { }*) nounwind - -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind - -declare void @llvm.dbg.region.end({ }*) nounwind - -define %struct.Bar* @_Z6foobarv() { -entry: - %retval = alloca %struct.Bar* ; <%struct.Bar**> [#uses=2] - %tmp = alloca %struct.Bar* ; <%struct.Bar**> [#uses=3] - %0 = alloca %struct.Bar* ; <%struct.Bar**> [#uses=2] - %1 = alloca %struct.Bar* ; <%struct.Bar**> [#uses=3] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram39 to { }*)) - %tmp1 = bitcast %struct.Bar** %tmp to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %tmp1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable42 to { }*)) - call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %2 = call i8* @_Znwm(i64 8) ; [#uses=1] - %3 = bitcast i8* %2 to %struct.Bar* ; <%struct.Bar*> [#uses=1] - store %struct.Bar* %3, %struct.Bar** %1, align 8 - %4 = load %struct.Bar** %1, align 8 ; <%struct.Bar*> [#uses=1] - call void @_ZN3BarC1Ev(%struct.Bar* %4) nounwind - %5 = load %struct.Bar** %1, align 8 ; <%struct.Bar*> [#uses=1] - store %struct.Bar* %5, %struct.Bar** %tmp, align 8 - call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - %6 = load %struct.Bar** %tmp, align 8 ; <%struct.Bar*> [#uses=1] - store %struct.Bar* %6, %struct.Bar** %0, align 8 - %7 = load %struct.Bar** %0, align 8 ; <%struct.Bar*> [#uses=1] - store %struct.Bar* %7, %struct.Bar** %retval, align 8 - br label %return - -return: ; preds = %entry - %retval2 = load %struct.Bar** %retval ; <%struct.Bar*> [#uses=1] - call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) - call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram39 to { }*)) - ret %struct.Bar* %retval2 -} - -declare i8* @_Znwm(i64) - -declare void @_ZN3BarC1Ev(%struct.Bar*) nounwind Removed: llvm/trunk/test/DebugInfo/printdbginfo2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo2.ll?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/printdbginfo2.ll (original) +++ llvm/trunk/test/DebugInfo/printdbginfo2.ll (removed) @@ -1,74 +0,0 @@ -; RUN: llvm-as < %s | opt -print-dbginfo -disable-output > %t1 -; RUN: grep {%b is variable b of type x declared at x.c:7} %t1 -; RUN: grep {%2 is variable b of type x declared at x.c:7} %t1 -; RUN: grep {@c.1442 is variable c of type int declared at x.c:4} %t1 - type { } ; type %0 - %llvm.dbg.anchor.type = type { i32, i32 } - %llvm.dbg.basictype.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, i32 } - %llvm.dbg.compile_unit.type = type { i32, %0*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 } - %llvm.dbg.composite.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, %0*, %0*, i32 } - %llvm.dbg.derivedtype.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, %0* } - %llvm.dbg.global_variable.type = type { i32, %0*, %0*, i8*, i8*, i8*, %0*, i32, %0*, i1, i1, %0* } - %llvm.dbg.subprogram.type = type { i32, %0*, %0*, i8*, i8*, i8*, %0*, i32, %0*, i1, i1 } - %llvm.dbg.subrange.type = type { i32, i64, i64 } - %llvm.dbg.variable.type = type { i32, %0*, i8*, %0*, i32, %0* } - %struct..0x = type { i32 } - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str = internal constant [4 x i8] c"x.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at .str1 = internal constant [27 x i8] c"/home/edwin/llvm-svn/llvm/\00", section "llvm.metadata" ; <[27 x i8]*> [#uses=1] - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] - at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %0*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([27 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] - at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] - at llvm.dbg.array = internal constant [1 x %0*] [%0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*)], section "llvm.metadata" ; <[1 x %0*]*> [#uses=1] - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str4 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 2, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] - at .str5 = internal constant [2 x i8] c"x\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at .str7 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str7, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 6, i64 32, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] - at llvm.dbg.array8 = internal constant [1 x %0*] [%0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %0*)], section "llvm.metadata" ; <[1 x %0*]*> [#uses=1] - at llvm.dbg.composite9 = internal constant %llvm.dbg.composite.type { i32 458771, %0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 5, i64 32, i64 32, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array8 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at .str10 = internal constant [2 x i8] c"b\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459008, %0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str10, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 7, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite9 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type { i32 458785, i64 0, i64 3 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] - at llvm.dbg.array11 = internal constant [1 x %0*] [%0* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to %0*)], section "llvm.metadata" ; <[1 x %0*]*> [#uses=1] - at llvm.dbg.composite12 = internal constant %llvm.dbg.composite.type { i32 458753, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 128, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*), %0* bitcast ([1 x %0*]* @llvm.dbg.array11 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] - at llvm.dbg.variable13 = internal constant %llvm.dbg.variable.type { i32 459008, %0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str7, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 3, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite12 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] - at c.1442 = internal global i32 5 ; [#uses=2] - at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] - at .str14 = internal constant [7 x i8] c"c.1442\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] - at .str15 = internal constant [2 x i8] c"c\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] - at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { i32 458804, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([7 x i8]* @.str14, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 4, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*), i1 true, i1 true, %0* bitcast (i32* @c.1442 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] - -define i32 @main() nounwind { -entry: - %b = alloca %struct..0x ; <%struct..0x*> [#uses=2] - %a = alloca [4 x i32] ; <[4 x i32]*> [#uses=1] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.func.start(%0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*)) - %0 = bitcast %struct..0x* %b to %0* ; <%0*> [#uses=1] - call void @llvm.dbg.declare(%0* %0, %0* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to %0*)) - %1 = bitcast [4 x i32]* %a to %0* ; <%0*> [#uses=1] - call void @llvm.dbg.declare(%0* %1, %0* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable13 to %0*)) - call void @llvm.dbg.stoppoint(i32 8, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*)) - %2 = getelementptr %struct..0x* %b, i32 0, i32 0 ; [#uses=1] - store i32 5, i32* %2, align 4 - call void @llvm.dbg.stoppoint(i32 9, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*)) - %3 = load i32* @c.1442, align 4 ; [#uses=1] - br label %return - -return: ; preds = %entry - call void @llvm.dbg.stoppoint(i32 9, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*)) - call void @llvm.dbg.region.end(%0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*)) - ret i32 %3 -} - -declare void @llvm.dbg.func.start(%0*) nounwind readnone - -declare void @llvm.dbg.declare(%0*, %0*) nounwind readnone - -declare void @llvm.dbg.stoppoint(i32, i32, %0*) nounwind readnone - -declare void @llvm.dbg.region.end(%0*) nounwind readnone Removed: llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-02-16-AnonTypedef-Dbg.cpp?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp (original) +++ llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp (removed) @@ -1,5 +0,0 @@ -// Test on debug info to make sure that anon typedef info is emitted. -// RUN: %llvmgcc -S --emit-llvm -x c++ -g %s -o - | grep composite -typedef struct { int a; long b; } foo; -foo x; - Removed: llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m?rev=79976&view=auto ============================================================================== --- llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m (original) +++ llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m (removed) @@ -1,13 +0,0 @@ -// RUN: %llvmgcc -x objective-c -S %s -g --emit-llvm -o - | grep "dbg.compile_unit =" | grep "null, i32" -// Last parameter represent i32 runtime version id. The previous paramenter -// encodes command line flags when certain env. variables are set. In this -// example it is the only compile_unit parameter that is null. This test case -// tests existence of new additional compile_unit parameter to encode -// Objective-C runtime version number. - - at interface foo - at end - at implementation foo - at end - -void fn(foo *f) {} Modified: llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll?rev=79977&r1=79976&r2=79977&view=diff ============================================================================== --- llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll (original) +++ llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll Tue Aug 25 00:24:07 2009 @@ -1,5 +1,3 @@ -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep region | count 2 -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep func.start | count 2 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep "br label" %llvm.dbg.anchor.type = type { i32, i32 } From dpatel at apple.com Tue Aug 25 00:25:03 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 25 Aug 2009 05:25:03 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r79978 - in /llvm-gcc-4.2/trunk/gcc: llvm-debug.cpp llvm-debug.h Message-ID: <200908250525.n7P5P311007740@zion.cs.uiuc.edu> Author: dpatel Date: Tue Aug 25 00:25:02 2009 New Revision: 79978 URL: http://llvm.org/viewvc/llvm-project?rev=79978&view=rev Log: DebugInfo now uses MDNodes to encode compile units. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp llvm-gcc-4.2/trunk/gcc/llvm-debug.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=79978&r1=79977&r2=79978&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue Aug 25 00:25:02 2009 @@ -576,10 +576,18 @@ // recursive) and replace all uses of the forward declaration with the // final definition. expanded_location Loc = GetNodeLocation(TREE_CHAIN(type), false); + // FIXME: findRegion() is not able to find context all the time. This + // means when type names in different context match then FwdDecl is + // reused because MDNodes are uniqued. To avoid this, use type context + /// also while creating FwdDecl for now. + std::string FwdName; + if (TYPE_CONTEXT(type)) + FwdName = GetNodeName(TYPE_CONTEXT(type)); + FwdName = FwdName + GetNodeName(type); llvm::DICompositeType FwdDecl = DebugFactory.CreateCompositeType(Tag, findRegion(type), - GetNodeName(type), + FwdName, getOrCreateCompileUnit(Loc.file), Loc.line, 0, 0, 0, llvm::DIType::FlagFwdDecl, @@ -859,7 +867,7 @@ bool isMain) { if (!FullPath) FullPath = main_input_filename; - GlobalVariable *&CU = CUCache[FullPath]; + MDNode *&CU = CUCache[FullPath]; if (CU) return DICompileUnit(CU); @@ -907,7 +915,7 @@ version_string, isMain, optimize, Flags, ObjcRunTimeVer); - CU = NewCU.getGV(); + CU = NewCU.getNode(); return NewCU; } Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.h?rev=79978&r1=79977&r2=79978&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.h Tue Aug 25 00:25:02 2009 @@ -59,7 +59,7 @@ const char *PrevFullPath; // Previous location file encountered. int PrevLineNo; // Previous location line# encountered. BasicBlock *PrevBB; // Last basic block encountered. - std::map CUCache; + std::map CUCache; std::map TypeCache; // Cache of previously constructed // Types. From clattner at apple.com Tue Aug 25 00:33:12 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 24 Aug 2009 22:33:12 -0700 Subject: [llvm-commits] [llvm] r79963 - /llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp In-Reply-To: <200908250054.n7P0sdKg006929@zion.cs.uiuc.edu> References: <200908250054.n7P0sdKg006929@zion.cs.uiuc.edu> Message-ID: <20B506D7-C0AE-4A73-8A2A-620E43334E94@apple.com> On Aug 24, 2009, at 5:54 PM, Owen Anderson wrote: > Author: resistor > Date: Mon Aug 24 19:54:39 2009 > New Revision: 79963 > > URL: http://llvm.org/viewvc/llvm-project?rev=79963&view=rev > Log: > Handle a corner case when extracing code regions where one of the > immediate successor > of an extracted block contains a PHI using a value defined in the > extracted region. > > With this patch, the partial inliner now passes MultiSource/ > Applications. Very nice Owen. Please pull the loop out to a static helper function though, http://llvm.org/docs/CodingStandards.html#hl_predicateloops -Chris > > Modified: > llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp > > Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=79963&r1=79962&r2=79963&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Mon Aug 24 > 19:54:39 2009 > @@ -369,7 +369,7 @@ > Values &inputs, Values &outputs) { > // Emit a call to the new function, passing in: *pointer to struct > (if > // aggregating parameters), or plan inputs and allocated memory > for outputs > - std::vector params, StructValues, ReloadOutputs; > + std::vector params, StructValues, ReloadOutputs, Reloads; > > LLVMContext &Context = newFunction->getContext(); > > @@ -446,6 +446,7 @@ > Output = ReloadOutputs[i]; > } > LoadInst *load = new LoadInst(Output, outputs[i]->getName() > +".reload"); > + Reloads.push_back(load); > codeReplacer->getInstList().push_back(load); > std::vector Users(outputs[i]->use_begin(), outputs[i]- > >use_end()); > for (unsigned u = 0, e = Users.size(); u != e; ++u) { > @@ -532,8 +533,25 @@ > DominatesDef = false; > } > > - if (DT) > + if (DT) { > DominatesDef = DT->dominates(DefBlock, OldTarget); > + > + // If the output value is used by a phi in the target > block, > + // then we need to test for dominance of the phi's > predecessor > + // instead. Unfortunately, this a little complicated > since we > + // have already rewritten uses of the value to uses > of the reload. > + for (Value::use_iterator UI = Reloads[out]->use_begin > (), > + UE = Reloads[out]->use_end(); UI != UE; ++UI) { > + PHINode *P = dyn_cast(*UI); > + if (!P || P->getParent() != OldTarget) continue; > + > + BasicBlock* pred = P->getIncomingBlock(UI); > + if (DT->dominates(DefBlock, pred)) { > + DominatesDef = true; > + break; > + } > + } > + } > > if (DominatesDef) { > if (AggregateArgs) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From echristo at apple.com Tue Aug 25 02:29:15 2009 From: echristo at apple.com (Eric Christopher) Date: Tue, 25 Aug 2009 00:29:15 -0700 Subject: [llvm-commits] [llvm] r79969 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfException.cpp DwarfException.h In-Reply-To: <200908250227.n7P2RgBh018449@zion.cs.uiuc.edu> References: <200908250227.n7P2RgBh018449@zion.cs.uiuc.edu> Message-ID: <94CC76DF-69AB-442B-A649-5DFF7C88AF13@apple.com> On Aug 24, 2009, at 7:27 PM, Bill Wendling wrote: > + void EmitCommonInformationEntry(const Function *Personality, > unsigned Index); > + > + /// EmitFrameDescriptionEntry - Emit the Frame Description Entry > (FDE) for the > + /// function. > + void EmitFrameDescriptionEntry(const FunctionEHFrameInfo > &EHFrameInfo); I'd honestly prefer EmitCIE and EmitFDE since that's what we'll see in just about any text referencing them. Easier to look for FDE too :) -eric From isanbard at gmail.com Tue Aug 25 02:59:50 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 00:59:50 -0700 Subject: [llvm-commits] [llvm] r79969 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfException.cpp DwarfException.h In-Reply-To: <94CC76DF-69AB-442B-A649-5DFF7C88AF13@apple.com> References: <200908250227.n7P2RgBh018449@zion.cs.uiuc.edu> <94CC76DF-69AB-442B-A649-5DFF7C88AF13@apple.com> Message-ID: On Aug 25, 2009, at 12:29 AM, Eric Christopher wrote: > > On Aug 24, 2009, at 7:27 PM, Bill Wendling wrote: > >> + void EmitCommonInformationEntry(const Function *Personality, >> unsigned Index); >> + >> + /// EmitFrameDescriptionEntry - Emit the Frame Description Entry >> (FDE) for the >> + /// function. >> + void EmitFrameDescriptionEntry(const FunctionEHFrameInfo >> &EHFrameInfo); > > I'd honestly prefer EmitCIE and EmitFDE since that's what we'll see in > just about any text referencing them. Easier to look for FDE too :) > I was going back and forth on that too. I'll go ahead and make the change, but I'm also sending out an RFC which is in the same area... -bw From isanbard at gmail.com Tue Aug 25 03:08:35 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 08:08:35 -0000 Subject: [llvm-commits] [llvm] r79981 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfException.cpp DwarfException.h Message-ID: <200908250808.n7P88ZAq008717@zion.cs.uiuc.edu> Author: void Date: Tue Aug 25 03:08:33 2009 New Revision: 79981 URL: http://llvm.org/viewvc/llvm-project?rev=79981&view=rev Log: - Rename EmitCommonInformationEntry to EmitCIE. - Rename EmitFunctionDescriptionEntry to EmitFDE. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=79981&r1=79980&r2=79981&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Aug 25 03:08:33 2009 @@ -49,11 +49,10 @@ delete ExceptionTimer; } -/// EmitCommonInformationEntry - Emit a Common Information Entry (CIE). This -/// holds information that is shared among many Frame Description Entries. -/// There is at least one CIE in every non-empty .debug_frame section. -void DwarfException::EmitCommonInformationEntry(const Function *Personality, - unsigned Index) { +/// EmitCIE - Emit a Common Information Entry (CIE). This holds information that +/// is shared among many Frame Description Entries. There is at least one CIE +/// in every non-empty .debug_frame section. +void DwarfException::EmitCIE(const Function *Personality, unsigned Index) { // Size and sign of stack growth. int stackGrowth = Asm->TM.getFrameInfo()->getStackGrowthDirection() == @@ -147,10 +146,8 @@ Asm->EOL(); } -/// EmitFrameDescriptionEntry - Emit the Frame Description Entry (FDE) for the -/// function. -void DwarfException:: -EmitFrameDescriptionEntry(const FunctionEHFrameInfo &EHFrameInfo) { +/// EmitFDE - Emit the Frame Description Entry (FDE) for the function. +void DwarfException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) { assert(!EHFrameInfo.function->hasAvailableExternallyLinkage() && "Should not emit 'available externally' functions at all"); @@ -850,11 +847,11 @@ if (shouldEmitMovesModule || shouldEmitTableModule) { const std::vector Personalities = MMI->getPersonalities(); for (unsigned i = 0; i < Personalities.size(); ++i) - EmitCommonInformationEntry(Personalities[i], i); + EmitCIE(Personalities[i], i); for (std::vector::iterator I = EHFrames.begin(), E = EHFrames.end(); I != E; ++I) - EmitFrameDescriptionEntry(*I); + EmitFDE(*I); } if (TimePassesIsEnabled) Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h?rev=79981&r1=79980&r2=79981&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.h Tue Aug 25 03:08:33 2009 @@ -70,14 +70,13 @@ /// ExceptionTimer - Timer for the Dwarf exception writer. Timer *ExceptionTimer; - /// EmitCommonInformationEntry - Emit a Common Information Entry (CIE). This - /// holds information that is shared among many Frame Description Entries. - /// There is at least one CIE in every non-empty .debug_frame section. - void EmitCommonInformationEntry(const Function *Personality, unsigned Index); - - /// EmitFrameDescriptionEntry - Emit the Frame Description Entry (FDE) for the - /// function. - void EmitFrameDescriptionEntry(const FunctionEHFrameInfo &EHFrameInfo); + /// EmitCIE - Emit a Common Information Entry (CIE). This holds information + /// that is shared among many Frame Description Entries. There is at least + /// one CIE in every non-empty .debug_frame section. + void EmitCIE(const Function *Personality, unsigned Index); + + /// EmitFDE - Emit the Frame Description Entry (FDE) for the function. + void EmitFDE(const FunctionEHFrameInfo &EHFrameInfo); /// EmitExceptionTable - Emit landing pads and actions. /// From e0325716 at student.tuwien.ac.at Tue Aug 25 04:27:48 2009 From: e0325716 at student.tuwien.ac.at (Andreas Neustifter) Date: Tue, 25 Aug 2009 11:27:48 +0200 Subject: [llvm-commits] [PATCH] Preparation for Optimal Edge Profiling: Build libprofile as bytecode. In-Reply-To: <6a8523d60908241812w598881e1ideba24e6f33528db@mail.gmail.com> References: <4A8C2948.9050504@student.tuwien.ac.at> <6a8523d60908240905q668b231eg349bb59c3c5b705e@mail.gmail.com> <4A92E4CE.7000404@student.tuwien.ac.at> <6a8523d60908241812w598881e1ideba24e6f33528db@mail.gmail.com> Message-ID: <4A93AE94.3030300@student.tuwien.ac.at> Hi Daniel! Daniel Dunbar wrote: > > On Mon, Aug 24, 2009 at 12:06 PM, Andreas > Neustifter wrote: >> >> Daniel Dunbar wrote: >>> >>> The exported change is fine, but I don't think MODULE_NAME is >>> necessary. libprofile_rt.bca (a bitcode archive) is already getting >>> built, isn't that good enough? >> >> I used that for bytecode linking of the whole module, there its not >> possible to use the libprofile_rt.bca. But its also possible to link the >> libprofile_rt.so instead later on. I will commit only the symbol export. > > I still don't understand, it should always be possible to link using a > .bca in any place that linking a .bc would work. What is the situation > where this fails? I have the SPEC benchmark modified to use custom scripts instead of compiler and linker thus being able to use all the SPEC features but using LLVM instead of GCC in a very flexible way. That said the scripts do the following to translate a series of C files into an executable: ---- llvm-gcc -g -emit-llvm -c bits.c -o bits.o ---- llvm-gcc -g -emit-llvm -c deflate.c -o deflate.o ---- llvm-gcc -g -emit-llvm -c gzip.c -o gzip.o ---- llvm-gcc -g -emit-llvm -c getopt.c -o getopt.o ---- llvm-gcc -g -emit-llvm -c inflate.c -o inflate.o ---- llvm-gcc -g -emit-llvm -c lzw.c -o lzw.o ---- llvm-gcc -g -emit-llvm -c spec.c -o spec.o ---- llvm-gcc -g -emit-llvm -c trees.c -o trees.o ---- llvm-gcc -g -emit-llvm -c unlzh.c -o unlzh.o ---- llvm-gcc -g -emit-llvm -c unlzw.c -o unlzw.o ---- llvm-gcc -g -emit-llvm -c unpack.c -o unpack.o ---- llvm-gcc -g -emit-llvm -c unzip.c -o unzip.o ---- llvm-gcc -g -emit-llvm -c util.c -o util.o ---- llvm-gcc -g -emit-llvm -c zip.c -o zip.o ---- llvm-ld -stats -time-passes -link-as-library -disable-opt zip.o util.o unzip.o unpack.o unlzw.o unlzh.o trees.o spec.o lzw.o inflate.o getopt.o gzip.o deflate.o bits.o -o gzip.0.o ---- opt -std-compile-opts -stats -time-passes gzip.0.o -f -o gzip.1.o ---- opt -stats -time-passes -insert-edge-profiling gzip.1.o -f -o gzip.2.o ---- llvm-ld -stats -time-passes -link-as-library -disable-opt /localtmp/astifter/llvm/llvm-van-install/lib/libprofile_rt.bca gzip.2.o -o gzip.3.o Here I used the BCA you said should work fine, but later on it gives troubles... ---- llc gzip.3.o -f -o gzip.4.s ---- gcc -g gzip.4.s -o gzip ---- /tmp/cc2XnTEf.o: In function `main': ---- /nfs/a5/astifter/astifter/spec_cpu_2000_img/benchspec/CINT2000/164.gzip/run/00000001//spec.c:253: undefined reference to `llvm_start_edge_profiling' ---- collect2: ld returned 1 exit status So the symbol llvm_start_edge_profiling that should be present in libprofile_rt.bca does not get linked by the llvm-ld. Am I doing something wrong here? When using a regular bitcode file this works fine. What I am doing now is linking the native library later on: ---- llvm-ld -stats -time-passes -link-as-library -disable-opt zip.o util.o unzip.o unpack.o unlzw.o unlzh.o trees.o spec.o lzw.o inflate.o getopt.o gzip.o deflate.o bits.o -o gzip.0.o ---- opt -std-compile-opts -stats -time-passes gzip.0.o -f -o gzip.1.o ---- opt -stats -time-passes -insert-edge-profiling gzip.1.o -f -o gzip.2.o ---- llc gzip.2.o -f -o gzip.3.s ---- gcc -g /localtmp/astifter/llvm/llvm-van-install/lib/libprofile_rt.so gzip.3.s -o gzip Andi From xerxes at zafena.se Tue Aug 25 04:47:35 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Tue, 25 Aug 2009 11:47:35 +0200 Subject: [llvm-commits] [patch] llvm pr4772 - fix ARM unittest crash by explicitly initialize MMI to 0 during JITEmitter constructor Message-ID: <4A93B337.9080804@zafena.se> http://llvm.org/bugs/show_bug.cgi?id=4772 patch: http://llvm.org/bugs/attachment.cgi?id=3372 Ok to push? (i have commit access) Cheers Xerxes From xerxes at zafena.se Tue Aug 25 05:12:55 2009 From: xerxes at zafena.se (Xerxes Ranby) Date: Tue, 25 Aug 2009 10:12:55 -0000 Subject: [llvm-commits] [llvm] r79982 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200908251012.n7PACt40025133@zion.cs.uiuc.edu> Author: xranby Date: Tue Aug 25 05:12:55 2009 New Revision: 79982 URL: http://llvm.org/viewvc/llvm-project?rev=79982&view=rev Log: Fix PR4772 ARM JIT.GlobalInFuction unittest by explicitly initialize MMI to 0 during JITEmitter constructor. Modified: lib/ExecutionEngine/JIT/JITEmitter.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=79982&r1=79981&r2=79982&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Tue Aug 25 05:12:55 2009 @@ -505,7 +505,7 @@ public: JITEmitter(JIT &jit, JITMemoryManager *JMM) - : SizeEstimate(0), Resolver(jit), CurFn(0) { + : SizeEstimate(0), Resolver(jit), MMI(0), CurFn(0) { MemMgr = JMM ? JMM : JITMemoryManager::CreateDefaultMemManager(); if (jit.getJITInfo().needsGOT()) { MemMgr->AllocateGOT(); From astifter at gmx.at Tue Aug 25 07:53:28 2009 From: astifter at gmx.at (Andreas Neustifter) Date: Tue, 25 Aug 2009 12:53:28 -0000 Subject: [llvm-commits] [llvm] r79983 - /llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp Message-ID: <200908251253.n7PCrSQp012932@zion.cs.uiuc.edu> Author: astifter Date: Tue Aug 25 07:53:27 2009 New Revision: 79983 URL: http://llvm.org/viewvc/llvm-project?rev=79983&view=rev Log: Read profile files as binary as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-August/025020.html. Modified: llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp Modified: llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp?rev=79983&r1=79982&r2=79983&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfoLoader.cpp Tue Aug 25 07:53:27 2009 @@ -76,7 +76,7 @@ Module &TheModule) : Filename(Filename), M(TheModule), Warned(false) { - FILE *F = fopen(Filename.c_str(), "r"); + FILE *F = fopen(Filename.c_str(), "rb"); if (F == 0) { errs() << ToolName << ": Error opening '" << Filename << "': "; perror(0); From e0325716 at student.tuwien.ac.at Tue Aug 25 07:59:46 2009 From: e0325716 at student.tuwien.ac.at (Andreas Neustifter) Date: Tue, 25 Aug 2009 14:59:46 +0200 Subject: [llvm-commits] [llvm] r79615 - in /llvm/trunk/test/Analysis/Profiling: ./ 2009-08-21-irregular-loop.ll 2009-08-21-only-one-block.ll 2009-08-21-several-blocks.ll dg.exp In-Reply-To: <6a8523d60908241238v435742bbxbf7df11512a598c7@mail.gmail.com> References: <200908210936.n7L9aScH013127@zion.cs.uiuc.edu> <76A6DF93-A31D-470D-8504-A9FB859FD2B8@apple.com> <4A8EBD43.60501@gmx.at> <6a8523d60908241238v435742bbxbf7df11512a598c7@mail.gmail.com> Message-ID: <4A93E042.60707@student.tuwien.ac.at> Hi Daniel! Daniel Dunbar wrote: > Hi Andreas, > > I talked with Chris about this the morning, and I think we agreed that > lli based tests for this stuff are ok, as long as we limit them to > just a few. The main thing we basically need lli for is to test the > generation of the profiling information; I think a single solid test > for that would be good enough for now. Yes, thats what I was thinking now. Its possbile to test much of the rest without actually executing it but there has to be one test that exercises the whole profiling tool chain in the intended way. > We should solve the problem that this requires the JIT, though. A > simple first option is to disable the test if there is no JIT support. > A slightly better one would be to run it using the .bca version of the > profiling information, but that of course requires that the user > configure with llvm-gcc support. What is the easiest way to check if JIT is supported on a give platform during the tests? > I think we can find ways to test some of the other stuff without using > lli. For example, the static profile provider should be good enough to > test llvm-prof's output. > > Sound OK? Yes, I will think of more representative tests. Andi From brukman at gmail.com Tue Aug 25 09:09:22 2009 From: brukman at gmail.com (Misha Brukman) Date: Tue, 25 Aug 2009 10:09:22 -0400 Subject: [llvm-commits] [PATCH] Fixing LDRD and STRD definitions for ARM In-Reply-To: References: Message-ID: ping? On Thu, Aug 20, 2009 at 12:43 PM, Misha Brukman wrote: > This time, actually cc: Evan's actual email address. > > > On Thu, Aug 20, 2009 at 12:27 PM, Misha Brukman wrote: > >> Attached is a patch to partly address http://llvm.org/PR4687 -- LDRD and >> STRD require ARMv5TE, not just ARMv5T. See the bug for links to >> supporting documentation. >> >> This doesn't completely fix the bug, but is still required for >> correctness. >> >> Misha >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090825/a1a5afc1/attachment.html From baldrick at free.fr Tue Aug 25 09:30:01 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 25 Aug 2009 14:30:01 -0000 Subject: [llvm-commits] [gcc-plugin] r79988 - /gcc-plugin/trunk/bits_and_bobs.cpp Message-ID: <200908251430.n7PEU14i024993@zion.cs.uiuc.edu> Author: baldrick Date: Tue Aug 25 09:30:01 2009 New Revision: 79988 URL: http://llvm.org/viewvc/llvm-project?rev=79988&view=rev Log: Don't just calculate the value: return it. Modified: gcc-plugin/trunk/bits_and_bobs.cpp Modified: gcc-plugin/trunk/bits_and_bobs.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/bits_and_bobs.cpp?rev=79988&r1=79987&r2=79988&view=diff ============================================================================== --- gcc-plugin/trunk/bits_and_bobs.cpp (original) +++ gcc-plugin/trunk/bits_and_bobs.cpp Tue Aug 25 09:30:01 2009 @@ -37,7 +37,7 @@ bool llvm_set_decl_p(tree t) { assert(HAS_RTL_P(t) && "Expected a gcc decl with RTL!"); - llvm_has_cached(t); + return llvm_has_cached(t); } void eraseLocalLLVMValues() { From gohman at apple.com Tue Aug 25 10:34:52 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 15:34:52 -0000 Subject: [llvm-commits] [llvm] r79990 - in /llvm/trunk: examples/BrainF/ include/llvm/Support/ lib/Analysis/ lib/Bitcode/Writer/ lib/Support/ tools/bugpoint/ tools/gold/ tools/llc/ tools/llvm-as/ tools/llvm-dis/ tools/llvm-extract/ tools/llvm-ld/ tools/llvm-link/ tools/llvm-mc/ tools/lto/ tools/opt/ utils/FileUpdate/ utils/TableGen/ Message-ID: <200908251534.n7PFYrGU000742@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 10:34:52 2009 New Revision: 79990 URL: http://llvm.org/viewvc/llvm-project?rev=79990&view=rev Log: Make LLVM command-line tools overwrite their output files without -f. This is conventional command-line tool behavior. -f now just means "enable binary output on terminals". Add a -f option to llvm-extract and llvm-link, for consistency. Remove F_Force from raw_fd_ostream and enable overwriting and truncating by default. Introduce an F_Excl flag to permit users to enable a failure when the file already exists. This flag is currently unused. Update Makefiles and documentation accordingly. Modified: llvm/trunk/examples/BrainF/BrainFDriver.cpp llvm/trunk/include/llvm/Support/GraphWriter.h llvm/trunk/include/llvm/Support/raw_ostream.h llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp llvm/trunk/lib/Support/raw_ostream.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/OptimizerDriver.cpp llvm/trunk/tools/bugpoint/ToolRunner.cpp llvm/trunk/tools/gold/gold-plugin.cpp llvm/trunk/tools/llc/llc.cpp llvm/trunk/tools/llvm-as/llvm-as.cpp llvm/trunk/tools/llvm-dis/llvm-dis.cpp llvm/trunk/tools/llvm-extract/llvm-extract.cpp llvm/trunk/tools/llvm-ld/llvm-ld.cpp llvm/trunk/tools/llvm-link/llvm-link.cpp llvm/trunk/tools/llvm-mc/llvm-mc.cpp llvm/trunk/tools/lto/LTOCodeGenerator.cpp llvm/trunk/tools/opt/GraphPrinters.cpp llvm/trunk/tools/opt/opt.cpp llvm/trunk/utils/FileUpdate/FileUpdate.cpp llvm/trunk/utils/TableGen/TableGen.cpp Modified: llvm/trunk/examples/BrainF/BrainFDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/BrainF/BrainFDriver.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/examples/BrainF/BrainFDriver.cpp (original) +++ llvm/trunk/examples/BrainF/BrainFDriver.cpp Tue Aug 25 10:34:52 2009 @@ -110,7 +110,6 @@ if (OutputFilename != "-") { std::string ErrInfo; out = new raw_fd_ostream(OutputFilename.c_str(), ErrInfo, - raw_fd_ostream::F_Force| raw_fd_ostream::F_Binary); } } Modified: llvm/trunk/include/llvm/Support/GraphWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GraphWriter.h?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/GraphWriter.h (original) +++ llvm/trunk/include/llvm/Support/GraphWriter.h Tue Aug 25 10:34:52 2009 @@ -274,7 +274,7 @@ errs() << "Writing '" << Filename.str() << "'... "; std::string ErrorInfo; - raw_fd_ostream O(Filename.c_str(), ErrorInfo, raw_fd_ostream::F_Force); + raw_fd_ostream O(Filename.c_str(), ErrorInfo); if (ErrorInfo.empty()) { WriteGraph(O, G, ShortNames, Name, Title); Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Tue Aug 25 10:34:52 2009 @@ -328,18 +328,17 @@ public: enum { - /// F_Force - When opening a file, this flag makes raw_fd_ostream overwrite - /// a file if it already exists instead of emitting an error. This may not - /// be specified with F_Append. - F_Force = 1, + /// F_Excl - When opening a file, this flag makes raw_fd_ostream + /// report an error if the file already exists. + F_Excl = 1, /// F_Append - When opening a file, if it already exists append to the /// existing file instead of returning an error. This may not be specified - /// with F_Force. + /// with F_Excl. F_Append = 2, /// F_Binary - The file should be opened in binary mode on platforms that - /// support this distinction. + /// make this distinction. F_Binary = 4 }; Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Tue Aug 25 10:34:52 2009 @@ -138,7 +138,7 @@ errs() << "Writing '" << Filename << "'..."; std::string ErrorInfo; - raw_fd_ostream File(Filename.c_str(), ErrorInfo, raw_fd_ostream::F_Force); + raw_fd_ostream File(Filename.c_str(), ErrorInfo); if (ErrorInfo.empty()) WriteGraph(File, (const Function*)&F); @@ -170,7 +170,7 @@ errs() << "Writing '" << Filename << "'..."; std::string ErrorInfo; - raw_fd_ostream File(Filename.c_str(), ErrorInfo, raw_fd_ostream::F_Force); + raw_fd_ostream File(Filename.c_str(), ErrorInfo); if (ErrorInfo.empty()) WriteGraph(File, (const Function*)&F, true); Modified: llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp Tue Aug 25 10:34:52 2009 @@ -18,7 +18,7 @@ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) { std::string ErrorInfo; raw_fd_ostream OS(Path, ErrorInfo, - raw_fd_ostream::F_Force|raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrorInfo.empty()) return -1; Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Tue Aug 25 10:34:52 2009 @@ -335,9 +335,9 @@ /// if no error occurred. raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo, unsigned Flags) : pos(0) { - // Verify that we don't have both "append" and "force". - assert((!(Flags & F_Force) || !(Flags & F_Append)) && - "Cannot specify both 'force' and 'append' file creation flags!"); + // Verify that we don't have both "append" and "excl". + assert((!(Flags & F_Excl) || !(Flags & F_Append)) && + "Cannot specify both 'excl' and 'append' file creation flags!"); ErrorInfo.clear(); @@ -358,11 +358,11 @@ OpenFlags |= O_BINARY; #endif - if (Flags & F_Force) - OpenFlags |= O_TRUNC; - else if (Flags & F_Append) + if (Flags & F_Append) OpenFlags |= O_APPEND; else + OpenFlags |= O_TRUNC; + if (Flags & F_Excl) OpenFlags |= O_EXCL; FD = open(Filename, OpenFlags, 0664); Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Tue Aug 25 10:34:52 2009 @@ -337,8 +337,7 @@ sys::RemoveFileOnSignal(uniqueFilename); std::string ErrorInfo; - raw_fd_ostream BlocksToNotExtractFile(uniqueFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Force); + raw_fd_ostream BlocksToNotExtractFile(uniqueFilename.c_str(), ErrorInfo); if (!ErrorInfo.empty()) { outs() << "*** Basic Block extraction failed!\n"; errs() << "Error writing list of blocks to not extract: " << ErrorInfo Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Tue Aug 25 10:34:52 2009 @@ -53,7 +53,7 @@ Module *M) const { std::string ErrInfo; raw_fd_ostream Out(Filename.c_str(), ErrInfo, - raw_fd_ostream::F_Force|raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrInfo.empty()) return true; WriteBitcodeToFile(M ? M : Program, Out); @@ -85,7 +85,7 @@ int BugDriver::runPassesAsChild(const std::vector &Passes) { std::string ErrInfo; raw_fd_ostream OutFile(ChildOutput.c_str(), ErrInfo, - raw_fd_ostream::F_Force|raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrInfo.empty()) { errs() << "Error opening bitcode file: " << ChildOutput << "\n"; return 1; @@ -148,7 +148,7 @@ std::string ErrInfo; raw_fd_ostream InFile(inputFilename.c_str(), ErrInfo, - raw_fd_ostream::F_Force|raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrInfo.empty()) { Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original) +++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Tue Aug 25 10:34:52 2009 @@ -368,7 +368,6 @@ LLCArgs.push_back ("-o"); LLCArgs.push_back (OutputAsmFile.c_str()); // Output to the Asm file - LLCArgs.push_back ("-f"); // Overwrite as necessary... LLCArgs.push_back (Bitcode.c_str()); // This is the input bitcode LLCArgs.push_back (0); Modified: llvm/trunk/tools/gold/gold-plugin.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/gold/gold-plugin.cpp (original) +++ llvm/trunk/tools/gold/gold-plugin.cpp Tue Aug 25 10:34:52 2009 @@ -364,7 +364,7 @@ } raw_fd_ostream *objFile = new raw_fd_ostream(uniqueObjPath.c_str(), ErrMsg, - raw_fd_ostream::F_Force|raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrMsg.empty()) { delete objFile; (*message)(LDPL_ERROR, "%s", ErrMsg.c_str()); Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Tue Aug 25 10:34:52 2009 @@ -55,7 +55,8 @@ static cl::opt OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename")); -static cl::opt Force("f", cl::desc("Overwrite output files")); +static cl::opt +Force("f", cl::desc("Enable binary output on terminals")); // Determine optimization level. static cl::opt @@ -139,12 +140,9 @@ std::string error; raw_fd_ostream *FDOut = new raw_fd_ostream(OutputFilename.c_str(), error, - (Force ? raw_fd_ostream::F_Force : 0)| raw_fd_ostream::F_Binary); if (!error.empty()) { errs() << error << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; delete FDOut; return 0; } @@ -190,14 +188,11 @@ std::string error; unsigned OpenFlags = 0; - if (Force) OpenFlags |= raw_fd_ostream::F_Force; if (Binary) OpenFlags |= raw_fd_ostream::F_Binary; raw_fd_ostream *FDOut = new raw_fd_ostream(OutputFilename.c_str(), error, OpenFlags); if (!error.empty()) { errs() << error << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; delete FDOut; return 0; } Modified: llvm/trunk/tools/llvm-as/llvm-as.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-as/llvm-as.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/llvm-as/llvm-as.cpp (original) +++ llvm/trunk/tools/llvm-as/llvm-as.cpp Tue Aug 25 10:34:52 2009 @@ -38,7 +38,7 @@ cl::value_desc("filename")); static cl::opt -Force("f", cl::desc("Overwrite output files")); +Force("f", cl::desc("Enable binary output on terminals")); static cl::opt DisableOutput("disable-output", cl::desc("Disable output"), cl::init(false)); @@ -98,12 +98,9 @@ std::string ErrorInfo; std::auto_ptr Out (new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - (Force?raw_fd_ostream::F_Force : 0) | raw_fd_ostream::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; return 1; } Modified: llvm/trunk/tools/llvm-dis/llvm-dis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dis/llvm-dis.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/llvm-dis/llvm-dis.cpp (original) +++ llvm/trunk/tools/llvm-dis/llvm-dis.cpp Tue Aug 25 10:34:52 2009 @@ -38,7 +38,7 @@ cl::value_desc("filename")); static cl::opt -Force("f", cl::desc("Overwrite output files")); +Force("f", cl::desc("Enable binary output on terminals")); static cl::opt DontPrint("disable-output", cl::desc("Don't output the .ll file"), cl::Hidden); @@ -93,12 +93,9 @@ std::string ErrorInfo; std::auto_ptr Out(new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - (Force?raw_fd_ostream::F_Force : 0) | raw_fd_ostream::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; return 1; } Modified: llvm/trunk/tools/llvm-extract/llvm-extract.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-extract/llvm-extract.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/llvm-extract/llvm-extract.cpp (original) +++ llvm/trunk/tools/llvm-extract/llvm-extract.cpp Tue Aug 25 10:34:52 2009 @@ -23,6 +23,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/SystemUtils.h" #include "llvm/System/Signals.h" #include using namespace llvm; @@ -37,7 +38,7 @@ cl::value_desc("filename"), cl::init("-")); static cl::opt -Force("f", cl::desc("Overwrite output files")); +Force("f", cl::desc("Enable binary output on terminals")); static cl::opt DeleteFn("delete", cl::desc("Delete specified Globals from Module")); @@ -113,16 +114,15 @@ std::string ErrorInfo; std::auto_ptr Out(new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary | - (Force ? raw_fd_ostream::F_Force : 0))); + raw_fd_ostream::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; return 1; } - Passes.add(createBitcodeWriterPass(*Out)); + if (Force || !CheckBitcodeOutputToConsole(*Out, true)) + Passes.add(createBitcodeWriterPass(*Out)); + Passes.run(*M.get()); return 0; 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=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original) +++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Tue Aug 25 10:34:52 2009 @@ -12,7 +12,7 @@ // Additionally, this program outputs a shell script that is used to invoke LLI // to execute the program. In this manner, the generated executable (a.out for // example), is directly executable, whereas the bitcode file actually lives in -// the a.out.bc file generated by this program. Also, Force is on by default. +// the a.out.bc file generated by this program. // // Note that if someone (or a script) deletes the executable program generated, // the .bc file will be left around. Considering that this is a temporary hack, @@ -231,7 +231,7 @@ // Create the output file. std::string ErrorInfo; raw_fd_ostream Out(FileName.c_str(), ErrorInfo, - raw_fd_ostream::F_Force | raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrorInfo.empty()) PrintAndExit(ErrorInfo); @@ -428,8 +428,7 @@ // Output the script to start the program... std::string ErrorInfo; - raw_fd_ostream Out2(OutputFilename.c_str(), ErrorInfo, - llvm::raw_fd_ostream::F_Force); + raw_fd_ostream Out2(OutputFilename.c_str(), ErrorInfo); if (!ErrorInfo.empty()) PrintAndExit(ErrorInfo); Modified: llvm/trunk/tools/llvm-link/llvm-link.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-link/llvm-link.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/llvm-link/llvm-link.cpp (original) +++ llvm/trunk/tools/llvm-link/llvm-link.cpp Tue Aug 25 10:34:52 2009 @@ -22,6 +22,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/SystemUtils.h" #include "llvm/System/Signals.h" #include "llvm/System/Path.h" #include @@ -35,7 +36,8 @@ OutputFilename("o", cl::desc("Override output filename"), cl::init("-"), cl::value_desc("filename")); -static cl::opt Force("f", cl::desc("Overwrite output files")); +static cl::opt +Force("f", cl::desc("Enable binary output on terminals")); static cl::opt Verbose("v", cl::desc("Print information about actions taken")); @@ -122,12 +124,9 @@ std::string ErrorInfo; std::auto_ptr Out(new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary | - (Force ? raw_fd_ostream::F_Force : 0))); + raw_fd_ostream::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; return 1; } @@ -142,7 +141,8 @@ } if (Verbose) errs() << "Writing bitcode...\n"; - WriteBitcodeToFile(Composite.get(), *Out); + if (Force || !CheckBitcodeOutputToConsole(*Out, true)) + WriteBitcodeToFile(Composite.get(), *Out); return 0; } Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original) +++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Tue Aug 25 10:34:52 2009 @@ -53,7 +53,7 @@ clEnumValEnd)); static cl::opt -Force("f", cl::desc("Overwrite output files")); +Force("f", cl::desc("Enable binary output on terminals")); static cl::list IncludeDirs("I", cl::desc("Directory of include files"), @@ -184,12 +184,9 @@ std::string Err; raw_fd_ostream *Out = new raw_fd_ostream(OutputFilename.c_str(), Err, - raw_fd_ostream::F_Binary | - (Force ? raw_fd_ostream::F_Force : 0)); + raw_fd_ostream::F_Binary); if (!Err.empty()) { errs() << Err << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; delete Out; return 0; } Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original) +++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Tue Aug 25 10:34:52 2009 @@ -148,7 +148,7 @@ // create output file std::string ErrInfo; raw_fd_ostream Out(path, ErrInfo, - raw_fd_ostream::F_Force|raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrInfo.empty()) { errMsg = "could not open bitcode file for writing: "; errMsg += path; @@ -179,8 +179,7 @@ // generate assembly code bool genResult = false; { - raw_fd_ostream asmFD(uniqueAsmPath.c_str(), errMsg, - raw_fd_ostream::F_Force); + raw_fd_ostream asmFD(uniqueAsmPath.c_str(), errMsg); formatted_raw_ostream asmFile(asmFD); if (!errMsg.empty()) return NULL; Modified: llvm/trunk/tools/opt/GraphPrinters.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/GraphPrinters.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/opt/GraphPrinters.cpp (original) +++ llvm/trunk/tools/opt/GraphPrinters.cpp Tue Aug 25 10:34:52 2009 @@ -29,7 +29,7 @@ std::string Filename = GraphName + ".dot"; O << "Writing '" << Filename << "'..."; std::string ErrInfo; - raw_fd_ostream F(Filename.c_str(), ErrInfo, raw_fd_ostream::F_Force); + raw_fd_ostream F(Filename.c_str(), ErrInfo); if (ErrInfo.empty()) WriteGraph(F, GT); Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Tue Aug 25 10:34:52 2009 @@ -55,7 +55,7 @@ cl::value_desc("filename"), cl::init("-")); static cl::opt -Force("f", cl::desc("Overwrite output files")); +Force("f", cl::desc("Enable binary output on terminals")); static cl::opt PrintEachXForm("p", cl::desc("Print module after each transformation")); @@ -367,12 +367,9 @@ if (OutputFilename != "-") { std::string ErrorInfo; Out = new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary | - (Force ? raw_fd_ostream::F_Force : 0)); + raw_fd_ostream::F_Binary); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; - if (!Force) - errs() << "Use -f command line argument to force output\n"; delete Out; return 1; } Modified: llvm/trunk/utils/FileUpdate/FileUpdate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileUpdate/FileUpdate.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/utils/FileUpdate/FileUpdate.cpp (original) +++ llvm/trunk/utils/FileUpdate/FileUpdate.cpp Tue Aug 25 10:34:52 2009 @@ -66,7 +66,7 @@ outs() << argv[0] << ": Updating '" << OutputFilename << "', contents changed.\n"; raw_fd_ostream OutStream(OutputFilename.c_str(), ErrorStr, - raw_fd_ostream::F_Force|raw_fd_ostream::F_Binary); + raw_fd_ostream::F_Binary); if (!ErrorStr.empty()) { errs() << argv[0] << ": Unable to write output '" << OutputFilename << "': " << ErrorStr << '\n'; Modified: llvm/trunk/utils/TableGen/TableGen.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=79990&r1=79989&r2=79990&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/TableGen.cpp (original) +++ llvm/trunk/utils/TableGen/TableGen.cpp Tue Aug 25 10:34:52 2009 @@ -171,8 +171,7 @@ raw_ostream *Out = &outs(); if (OutputFilename != "-") { std::string Error; - Out = new raw_fd_ostream(OutputFilename.c_str(), Error, - raw_fd_ostream::F_Force); + Out = new raw_fd_ostream(OutputFilename.c_str(), Error); if (!Error.empty()) { errs() << argv[0] << ": error opening " << OutputFilename From gohman at apple.com Tue Aug 25 10:38:32 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 15:38:32 -0000 Subject: [llvm-commits] [llvm] r79992 - in /llvm/trunk/test: ./ Assembler/ Bitcode/ CodeGen/ARM/ CodeGen/Alpha/ CodeGen/CPP/ CodeGen/CellSPU/ CodeGen/Generic/ CodeGen/Mips/ CodeGen/PowerPC/ CodeGen/X86/ DebugInfo/ ExecutionEngine/ Feature/ FrontendC++/ FrontendC/ FrontendObjC/ Linker/ Transforms/Inline/ Transforms/InstCombine/ Transforms/TailDup/ Verifier/ lib/ Message-ID: <200908251538.n7PFcgB4001709@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 10:38:29 2009 New Revision: 79992 URL: http://llvm.org/viewvc/llvm-project?rev=79992&view=rev Log: Remove obsolete -f flags. Modified: llvm/trunk/test/Assembler/2002-01-24-BadSymbolTableAssert.ll llvm/trunk/test/Assembler/2002-01-24-ValueRefineAbsType.ll llvm/trunk/test/Assembler/2002-02-19-TypeParsing.ll llvm/trunk/test/Assembler/2002-03-08-NameCollision.ll llvm/trunk/test/Assembler/2002-03-08-NameCollision2.ll llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall.ll llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall2.ll llvm/trunk/test/Assembler/2002-04-05-TypeParsing.ll llvm/trunk/test/Assembler/2002-05-02-InvalidForwardRef.ll llvm/trunk/test/Assembler/2002-05-02-ParseError.ll llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.ll llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.ll llvm/trunk/test/Assembler/2002-08-15-CastAmbiguity.ll llvm/trunk/test/Assembler/2002-08-15-ConstantExprProblem.ll llvm/trunk/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll llvm/trunk/test/Assembler/2002-08-22-DominanceProblem.ll llvm/trunk/test/Assembler/2002-10-08-LargeArrayPerformance.ll llvm/trunk/test/Assembler/2002-10-15-NameClash.ll llvm/trunk/test/Assembler/2002-12-15-GlobalResolve.ll llvm/trunk/test/Assembler/2003-01-30-UnsignedString.ll llvm/trunk/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.ll llvm/trunk/test/Assembler/2003-05-15-SwitchBug.ll llvm/trunk/test/Assembler/2003-05-21-ConstantShiftExpr.ll llvm/trunk/test/Assembler/2003-05-21-EmptyStructTest.ll llvm/trunk/test/Assembler/2003-06-30-RecursiveTypeProblem.ll llvm/trunk/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll llvm/trunk/test/Assembler/2004-02-27-SelfUseAssertError.ll llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.ll llvm/trunk/test/Assembler/2004-11-28-InvalidTypeCrash.ll llvm/trunk/test/Assembler/2005-01-31-CallingAggregateFunction.ll llvm/trunk/test/Assembler/2007-01-02-Undefined-Arg-Type.ll llvm/trunk/test/Assembler/2007-01-05-Cmp-ConstExpr.ll llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast.ll llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast2.ll llvm/trunk/test/Assembler/2007-03-18-InvalidNumberedVar.ll llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll llvm/trunk/test/Assembler/2009-07-24-ZeroArgGEP.ll llvm/trunk/test/Assembler/select.ll llvm/trunk/test/Bitcode/memcpy.ll llvm/trunk/test/Bitcode/metadata-2.ll llvm/trunk/test/Bitcode/metadata.ll llvm/trunk/test/CodeGen/ARM/aliases.ll llvm/trunk/test/CodeGen/Alpha/add.ll llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll llvm/trunk/test/CodeGen/CPP/2009-05-04-CondBr.ll llvm/trunk/test/CodeGen/CellSPU/rotate_ops.ll llvm/trunk/test/CodeGen/Generic/Makefile llvm/trunk/test/CodeGen/Generic/nested-select.ll llvm/trunk/test/CodeGen/Generic/switch-lower-feature-2.ll llvm/trunk/test/CodeGen/Mips/2008-06-05-Carry.ll llvm/trunk/test/CodeGen/Mips/2008-07-07-IntDoubleConvertions.ll llvm/trunk/test/CodeGen/Mips/2008-07-15-InternalConstant.ll llvm/trunk/test/CodeGen/Mips/2008-07-15-SmallSection.ll llvm/trunk/test/CodeGen/Mips/2008-07-16-SignExtInReg.ll llvm/trunk/test/CodeGen/Mips/2008-07-22-Cstpool.ll llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll llvm/trunk/test/CodeGen/Mips/2008-07-31-fcopysign.ll llvm/trunk/test/CodeGen/Mips/2008-08-01-AsmInline.ll llvm/trunk/test/CodeGen/Mips/2008-08-03-fabs64.ll llvm/trunk/test/CodeGen/Mips/2008-08-04-Bitconvert.ll llvm/trunk/test/CodeGen/Mips/2008-08-07-CC.ll llvm/trunk/test/CodeGen/PowerPC/Frames-small.ll llvm/trunk/test/CodeGen/PowerPC/addc.ll llvm/trunk/test/CodeGen/PowerPC/and_add.ll llvm/trunk/test/CodeGen/PowerPC/mulhs.ll llvm/trunk/test/CodeGen/PowerPC/rlwimi2.ll llvm/trunk/test/CodeGen/PowerPC/rlwinm.ll llvm/trunk/test/CodeGen/PowerPC/rlwinm2.ll llvm/trunk/test/CodeGen/PowerPC/stfiwx.ll llvm/trunk/test/CodeGen/PowerPC/subc.ll llvm/trunk/test/CodeGen/PowerPC/vec_br_cmp.ll llvm/trunk/test/CodeGen/PowerPC/vec_splat.ll llvm/trunk/test/CodeGen/PowerPC/vec_vrsave.ll llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll llvm/trunk/test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll llvm/trunk/test/CodeGen/X86/aliases.ll llvm/trunk/test/CodeGen/X86/atomic_op.ll llvm/trunk/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll llvm/trunk/test/CodeGen/X86/dagcombine-buildvector.ll llvm/trunk/test/CodeGen/X86/extract-combine.ll llvm/trunk/test/CodeGen/X86/iv-users-in-other-loops.ll llvm/trunk/test/CodeGen/X86/legalizedag_vec.ll llvm/trunk/test/CodeGen/X86/mingw-alloca.ll llvm/trunk/test/CodeGen/X86/neg_fp.ll llvm/trunk/test/CodeGen/X86/pic-1.ll llvm/trunk/test/CodeGen/X86/pic-2.ll llvm/trunk/test/CodeGen/X86/pic-4.ll llvm/trunk/test/CodeGen/X86/pic-5.ll llvm/trunk/test/CodeGen/X86/pic-6.ll llvm/trunk/test/CodeGen/X86/pic-cpool.ll llvm/trunk/test/CodeGen/X86/pic-jtbl.ll llvm/trunk/test/CodeGen/X86/scalar-extract.ll llvm/trunk/test/CodeGen/X86/vec_clear.ll llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll llvm/trunk/test/CodeGen/X86/vec_extract.ll llvm/trunk/test/CodeGen/X86/vec_i64.ll llvm/trunk/test/CodeGen/X86/vec_insert-8.ll llvm/trunk/test/CodeGen/X86/vec_set-3.ll llvm/trunk/test/CodeGen/X86/vec_set-5.ll llvm/trunk/test/CodeGen/X86/vec_set-6.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-10.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-16.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-22.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-25.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-26.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-27.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-3.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-30.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-31.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-35.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-36.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-5.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-7.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-9.ll llvm/trunk/test/CodeGen/X86/vec_shuffle.ll llvm/trunk/test/CodeGen/X86/vec_splat-3.ll llvm/trunk/test/CodeGen/X86/vec_splat-4.ll llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll llvm/trunk/test/CodeGen/X86/vshift-1.ll llvm/trunk/test/CodeGen/X86/vshift-2.ll llvm/trunk/test/CodeGen/X86/vshift-3.ll llvm/trunk/test/CodeGen/X86/vshift-4.ll llvm/trunk/test/CodeGen/X86/widen_arith-1.ll llvm/trunk/test/CodeGen/X86/widen_arith-2.ll llvm/trunk/test/CodeGen/X86/widen_arith-3.ll llvm/trunk/test/CodeGen/X86/widen_arith-4.ll llvm/trunk/test/CodeGen/X86/widen_arith-5.ll llvm/trunk/test/CodeGen/X86/widen_arith-6.ll llvm/trunk/test/CodeGen/X86/widen_cast-1.ll llvm/trunk/test/CodeGen/X86/widen_cast-2.ll llvm/trunk/test/CodeGen/X86/widen_cast-3.ll llvm/trunk/test/CodeGen/X86/widen_cast-4.ll llvm/trunk/test/CodeGen/X86/widen_cast-5.ll llvm/trunk/test/CodeGen/X86/widen_cast-6.ll llvm/trunk/test/CodeGen/X86/widen_conv-1.ll llvm/trunk/test/CodeGen/X86/widen_conv-2.ll llvm/trunk/test/CodeGen/X86/widen_conv-3.ll llvm/trunk/test/CodeGen/X86/widen_conv-4.ll llvm/trunk/test/CodeGen/X86/widen_select-1.ll llvm/trunk/test/CodeGen/X86/widen_shuffle-1.ll llvm/trunk/test/CodeGen/X86/widen_shuffle-2.ll llvm/trunk/test/CodeGen/X86/x86-64-mem.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-1.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-10.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-11.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-2.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-3.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-4.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-5.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-6.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-7.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-8.ll llvm/trunk/test/CodeGen/X86/x86-64-pic-9.ll llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll llvm/trunk/test/DebugInfo/2009-01-15-member.ll llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll llvm/trunk/test/ExecutionEngine/2002-12-16-ArgTest.ll llvm/trunk/test/ExecutionEngine/2003-01-04-ArgumentBug.ll llvm/trunk/test/ExecutionEngine/2003-01-04-LoopTest.ll llvm/trunk/test/ExecutionEngine/2003-01-04-PhiTest.ll llvm/trunk/test/ExecutionEngine/2003-01-09-SARTest.ll llvm/trunk/test/ExecutionEngine/2003-01-10-FUCOM.ll llvm/trunk/test/ExecutionEngine/2003-01-15-AlignmentTest.ll llvm/trunk/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll llvm/trunk/test/ExecutionEngine/2003-06-04-bzip2-bug.ll llvm/trunk/test/ExecutionEngine/2003-06-05-PHIBug.ll llvm/trunk/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll llvm/trunk/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll llvm/trunk/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll llvm/trunk/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll llvm/trunk/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll llvm/trunk/test/ExecutionEngine/hello.ll llvm/trunk/test/ExecutionEngine/hello2.ll llvm/trunk/test/ExecutionEngine/simplesttest.ll llvm/trunk/test/ExecutionEngine/simpletest.ll llvm/trunk/test/ExecutionEngine/test-arith.ll llvm/trunk/test/ExecutionEngine/test-branch.ll llvm/trunk/test/ExecutionEngine/test-call.ll llvm/trunk/test/ExecutionEngine/test-cast.ll llvm/trunk/test/ExecutionEngine/test-constantexpr.ll llvm/trunk/test/ExecutionEngine/test-fp.ll llvm/trunk/test/ExecutionEngine/test-loadstore.ll llvm/trunk/test/ExecutionEngine/test-logical.ll llvm/trunk/test/ExecutionEngine/test-loop.ll llvm/trunk/test/ExecutionEngine/test-malloc.ll llvm/trunk/test/ExecutionEngine/test-phi.ll llvm/trunk/test/ExecutionEngine/test-ret.ll llvm/trunk/test/ExecutionEngine/test-setcond-fp.ll llvm/trunk/test/ExecutionEngine/test-setcond-int.ll llvm/trunk/test/ExecutionEngine/test-shift.ll llvm/trunk/test/Feature/NamedMDNode2.ll llvm/trunk/test/Feature/globalredefinition3.ll llvm/trunk/test/FrontendC++/2003-08-20-ExceptionFail.cpp llvm/trunk/test/FrontendC++/2003-08-21-EmptyClass.cpp llvm/trunk/test/FrontendC++/2003-08-27-TypeNamespaces.cpp llvm/trunk/test/FrontendC++/2003-08-28-ForwardType.cpp llvm/trunk/test/FrontendC++/2003-08-28-SaveExprBug.cpp llvm/trunk/test/FrontendC++/2003-08-31-StructLayout.cpp llvm/trunk/test/FrontendC++/2003-09-22-CompositeExprValue.cpp llvm/trunk/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp llvm/trunk/test/FrontendC++/2003-09-30-CommaExprBug.cpp llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp llvm/trunk/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp llvm/trunk/test/FrontendC++/2003-10-17-BoolBitfields.cpp llvm/trunk/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp llvm/trunk/test/FrontendC++/2003-11-04-ArrayConstructors.cpp llvm/trunk/test/FrontendC++/2003-11-04-CatchLabelName.cpp llvm/trunk/test/FrontendC++/2003-11-18-EnumArray.cpp llvm/trunk/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp llvm/trunk/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp llvm/trunk/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp llvm/trunk/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp llvm/trunk/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp llvm/trunk/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp llvm/trunk/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp llvm/trunk/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp llvm/trunk/test/FrontendC++/2004-09-27-CompilerCrash.cpp llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp llvm/trunk/test/FrontendC++/2006-11-30-NoCompileUnit.cpp llvm/trunk/test/FrontendC++/2006-11-30-Pubnames.cpp llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp llvm/trunk/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp llvm/trunk/test/FrontendC++/2009-04-21-DtorNames-dbg.cpp llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp llvm/trunk/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c llvm/trunk/test/FrontendC/2002-01-24-ComplexSpaceInType.c llvm/trunk/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c llvm/trunk/test/FrontendC/2002-02-13-ConditionalInCall.c llvm/trunk/test/FrontendC/2002-02-13-ReloadProblem.c llvm/trunk/test/FrontendC/2002-02-13-TypeVarNameCollision.c llvm/trunk/test/FrontendC/2002-02-13-UnnamedLocal.c llvm/trunk/test/FrontendC/2002-02-14-EntryNodePreds.c llvm/trunk/test/FrontendC/2002-02-16-RenamingTest.c llvm/trunk/test/FrontendC/2002-02-17-ArgumentAddress.c llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c llvm/trunk/test/FrontendC/2002-02-18-StaticData.c llvm/trunk/test/FrontendC/2002-03-11-LargeCharInString.c llvm/trunk/test/FrontendC/2002-03-12-ArrayInitialization.c llvm/trunk/test/FrontendC/2002-03-12-StructInitialize.c llvm/trunk/test/FrontendC/2002-03-12-StructInitializer.c llvm/trunk/test/FrontendC/2002-03-14-BrokenPHINode.c llvm/trunk/test/FrontendC/2002-03-14-BrokenSSA.c llvm/trunk/test/FrontendC/2002-03-14-QuotesInStrConst.c llvm/trunk/test/FrontendC/2002-04-07-SwitchStmt.c llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c llvm/trunk/test/FrontendC/2002-04-09-StructRetVal.c llvm/trunk/test/FrontendC/2002-04-10-StructParameters.c llvm/trunk/test/FrontendC/2002-05-23-StaticValues.c llvm/trunk/test/FrontendC/2002-05-23-TypeNameCollision.c llvm/trunk/test/FrontendC/2002-05-24-Alloca.c llvm/trunk/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c llvm/trunk/test/FrontendC/2002-07-14-MiscListTests.c llvm/trunk/test/FrontendC/2002-07-14-MiscTests.c llvm/trunk/test/FrontendC/2002-07-14-MiscTests2.c llvm/trunk/test/FrontendC/2002-07-14-MiscTests3.c llvm/trunk/test/FrontendC/2002-07-16-HardStringInit.c llvm/trunk/test/FrontendC/2002-07-17-StringConstant.c llvm/trunk/test/FrontendC/2002-07-29-Casts.c llvm/trunk/test/FrontendC/2002-07-30-SubregSetAssertion.c llvm/trunk/test/FrontendC/2002-07-30-UnionTest.c llvm/trunk/test/FrontendC/2002-07-30-VarArgsCallFailure.c llvm/trunk/test/FrontendC/2002-07-31-BadAssert.c llvm/trunk/test/FrontendC/2002-07-31-SubregFailure.c llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c llvm/trunk/test/FrontendC/2002-08-19-RecursiveLocals.c llvm/trunk/test/FrontendC/2002-09-08-PointerShifts.c llvm/trunk/test/FrontendC/2002-09-18-UnionProblem.c llvm/trunk/test/FrontendC/2002-09-19-StarInLabel.c llvm/trunk/test/FrontendC/2002-10-12-TooManyArguments.c llvm/trunk/test/FrontendC/2002-12-15-GlobalBoolTest.c llvm/trunk/test/FrontendC/2002-12-15-GlobalConstantTest.c llvm/trunk/test/FrontendC/2002-12-15-GlobalRedefinition.c llvm/trunk/test/FrontendC/2002-12-15-StructParameters.c llvm/trunk/test/FrontendC/2003-03-03-DeferredType.c llvm/trunk/test/FrontendC/2003-06-22-UnionCrash.c llvm/trunk/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c llvm/trunk/test/FrontendC/2003-06-26-CFECrash.c llvm/trunk/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c llvm/trunk/test/FrontendC/2003-08-18-SigSetJmp.c llvm/trunk/test/FrontendC/2003-08-18-StructAsValue.c llvm/trunk/test/FrontendC/2003-08-20-BadBitfieldRef.c llvm/trunk/test/FrontendC/2003-08-20-PrototypeMismatch.c llvm/trunk/test/FrontendC/2003-08-20-vfork-bug.c llvm/trunk/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c llvm/trunk/test/FrontendC/2003-08-21-StmtExpr.c llvm/trunk/test/FrontendC/2003-08-21-WideString.c llvm/trunk/test/FrontendC/2003-08-23-LocalUnionTest.c llvm/trunk/test/FrontendC/2003-08-29-BitFieldStruct.c llvm/trunk/test/FrontendC/2003-08-29-HugeCharConst.c llvm/trunk/test/FrontendC/2003-08-29-StructLayoutBug.c llvm/trunk/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c llvm/trunk/test/FrontendC/2003-09-18-BitfieldTests.c llvm/trunk/test/FrontendC/2003-09-30-StructLayout.c llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c llvm/trunk/test/FrontendC/2003-10-06-NegateExprType.c llvm/trunk/test/FrontendC/2003-10-09-UnionInitializerBug.c llvm/trunk/test/FrontendC/2003-10-28-ident.c llvm/trunk/test/FrontendC/2003-10-29-AsmRename.c llvm/trunk/test/FrontendC/2003-11-01-C99-CompoundLiteral.c llvm/trunk/test/FrontendC/2003-11-01-EmptyStructCrash.c llvm/trunk/test/FrontendC/2003-11-01-GlobalUnionInit.c llvm/trunk/test/FrontendC/2003-11-04-EmptyStruct.c llvm/trunk/test/FrontendC/2003-11-04-OutOfMemory.c llvm/trunk/test/FrontendC/2003-11-12-VoidString.c llvm/trunk/test/FrontendC/2003-11-16-StaticArrayInit.c llvm/trunk/test/FrontendC/2003-11-18-CondExprLValue.c llvm/trunk/test/FrontendC/2003-11-19-BitFieldArray.c llvm/trunk/test/FrontendC/2003-11-20-Bitfields.c llvm/trunk/test/FrontendC/2003-11-20-ComplexDivision.c llvm/trunk/test/FrontendC/2003-11-20-UnionBitfield.c llvm/trunk/test/FrontendC/2003-11-26-PointerShift.c llvm/trunk/test/FrontendC/2003-11-27-ConstructorCast.c llvm/trunk/test/FrontendC/2003-11-27-UnionCtorInitialization.c llvm/trunk/test/FrontendC/2004-01-08-ExternInlineRedefine.c llvm/trunk/test/FrontendC/2004-03-07-ComplexDivEquals.c llvm/trunk/test/FrontendC/2004-03-09-LargeArrayInitializers.c llvm/trunk/test/FrontendC/2004-03-15-SimpleIndirectGoto.c llvm/trunk/test/FrontendC/2004-03-16-AsmRegisterCrash.c llvm/trunk/test/FrontendC/2004-05-07-VarArrays.c llvm/trunk/test/FrontendC/2004-05-21-IncompleteEnum.c llvm/trunk/test/FrontendC/2004-06-08-OpaqueStructArg.c llvm/trunk/test/FrontendC/2004-06-17-UnorderedBuiltins.c llvm/trunk/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c llvm/trunk/test/FrontendC/2004-07-06-FunctionCast.c llvm/trunk/test/FrontendC/2004-08-06-LargeStructTest.c llvm/trunk/test/FrontendC/2005-09-20-ComplexConstants.c llvm/trunk/test/FrontendC/2009-02-17-BitField-dbg.c llvm/trunk/test/FrontendC/2009-07-15-pad-wchar_t-array.c llvm/trunk/test/FrontendObjC/2009-08-17-DebugInfo.m llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll llvm/trunk/test/Linker/2003-04-21-Linkage.ll llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll llvm/trunk/test/Linker/2003-04-26-NullPtrLinkProblem.ll llvm/trunk/test/Linker/2004-02-17-WeakStrongLinkage.ll llvm/trunk/test/Linker/2004-05-07-TypeResolution1.ll llvm/trunk/test/Linker/2006-01-19-ConstantPacked.ll llvm/trunk/test/Linker/2008-03-05-AliasReference.ll llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll llvm/trunk/test/Linker/2008-07-06-AliasFnDecl.ll llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll llvm/trunk/test/Linker/basiclink.ll llvm/trunk/test/Linker/link-archive.ll llvm/trunk/test/Linker/link-global-to-func.ll llvm/trunk/test/Linker/link-messages.ll llvm/trunk/test/Linker/redefinition.ll llvm/trunk/test/Linker/weakextern.ll llvm/trunk/test/Makefile.tests llvm/trunk/test/Transforms/Inline/2007-06-06-NoInline.ll llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll llvm/trunk/test/Transforms/TailDup/if-tail-dup.ll llvm/trunk/test/Verifier/2008-03-01-AllocaSized.ll llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll llvm/trunk/test/Verifier/SelfReferential.ll llvm/trunk/test/Verifier/aliasing-chain.ll llvm/trunk/test/Verifier/byval-4.ll llvm/trunk/test/Verifier/invoke-2.ll llvm/trunk/test/lib/llvm2cpp.exp Modified: llvm/trunk/test/Assembler/2002-01-24-BadSymbolTableAssert.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-01-24-BadSymbolTableAssert.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-01-24-BadSymbolTableAssert.ll (original) +++ llvm/trunk/test/Assembler/2002-01-24-BadSymbolTableAssert.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; This testcase failed due to a bad assertion in SymbolTable.cpp, removed in ; the 1.20 revision. Basically the symbol table assumed that if there was an Modified: llvm/trunk/test/Assembler/2002-01-24-ValueRefineAbsType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-01-24-ValueRefineAbsType.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-01-24-ValueRefineAbsType.ll (original) +++ llvm/trunk/test/Assembler/2002-01-24-ValueRefineAbsType.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; This testcase used to fail due to a lack of this diff in Value.cpp: ; diff -r1.16 Value.cpp Modified: llvm/trunk/test/Assembler/2002-02-19-TypeParsing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-02-19-TypeParsing.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-02-19-TypeParsing.ll (original) +++ llvm/trunk/test/Assembler/2002-02-19-TypeParsing.ll Tue Aug 25 10:38:29 2009 @@ -1,3 +1,3 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %Hosp = type { i32, i32, i32, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* } } Modified: llvm/trunk/test/Assembler/2002-03-08-NameCollision.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-03-08-NameCollision.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-03-08-NameCollision.ll (original) +++ llvm/trunk/test/Assembler/2002-03-08-NameCollision.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; Method arguments were being checked for collisions at the global scope before ; the method object was created by the parser. Because of this, false Modified: llvm/trunk/test/Assembler/2002-03-08-NameCollision2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-03-08-NameCollision2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-03-08-NameCollision2.ll (original) +++ llvm/trunk/test/Assembler/2002-03-08-NameCollision2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; Another name collision problem. Here the problem was that if a forward ; declaration for a method was found, that this would cause spurious conflicts Modified: llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall.ll (original) +++ llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null type { { \2 *, \4 ** }, { \2 *, \4 ** } Modified: llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall2.ll (original) +++ llvm/trunk/test/Assembler/2002-04-04-PureVirtMethCall2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %t = type { { \2*, \2 }, { \2*, \2 } Modified: llvm/trunk/test/Assembler/2002-04-05-TypeParsing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-05-TypeParsing.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-04-05-TypeParsing.ll (original) +++ llvm/trunk/test/Assembler/2002-04-05-TypeParsing.ll Tue Aug 25 10:38:29 2009 @@ -1,3 +1,3 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %Hosp = type { { \2*, { \2, %Hosp }* }, { \2*, { \2, %Hosp }* } } Modified: llvm/trunk/test/Assembler/2002-05-02-InvalidForwardRef.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-05-02-InvalidForwardRef.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-05-02-InvalidForwardRef.ll (original) +++ llvm/trunk/test/Assembler/2002-05-02-InvalidForwardRef.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; It looks like the assembler is not forward resolving the function declaraion ; correctly. Modified: llvm/trunk/test/Assembler/2002-05-02-ParseError.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-05-02-ParseError.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-05-02-ParseError.ll (original) +++ llvm/trunk/test/Assembler/2002-05-02-ParseError.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %T = type i32 * Modified: llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.ll (original) +++ llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ ; This file takes about 48 __MINUTES__ to assemble using as. This is WAY too ; long. The type resolution code needs to be sped up a lot. -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %ALL_INTERSECTIONS_METHOD = type i32 (%OBJECT*, %RAY*, %ISTACK*)* %BBOX = type { %BBOX_VECT, %BBOX_VECT } %BBOX_TREE = type { i16, i16, %BBOX, %BBOX_TREE** } Modified: llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.ll (original) +++ llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ ; Make sure we don't get an assertion failure, even though this is a parse ; error -; RUN: not llvm-as %s -o /dev/null -f |& grep {'@foo' defined with} +; RUN: not llvm-as %s -o /dev/null |& grep {'@foo' defined with} %ty = type void (i32) Modified: llvm/trunk/test/Assembler/2002-08-15-CastAmbiguity.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-08-15-CastAmbiguity.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-08-15-CastAmbiguity.ll (original) +++ llvm/trunk/test/Assembler/2002-08-15-CastAmbiguity.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null define void @test(i32 %X) { call void @test( i32 6 ) Modified: llvm/trunk/test/Assembler/2002-08-15-ConstantExprProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-08-15-ConstantExprProblem.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-08-15-ConstantExprProblem.ll (original) +++ llvm/trunk/test/Assembler/2002-08-15-ConstantExprProblem.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null @.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1] Modified: llvm/trunk/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll (original) +++ llvm/trunk/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null @.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1] Modified: llvm/trunk/test/Assembler/2002-08-22-DominanceProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-08-22-DominanceProblem.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-08-22-DominanceProblem.ll (original) +++ llvm/trunk/test/Assembler/2002-08-22-DominanceProblem.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; Dominance relationships is not calculated correctly for unreachable blocks, ; which causes the verifier to barf on this input. Modified: llvm/trunk/test/Assembler/2002-10-08-LargeArrayPerformance.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-10-08-LargeArrayPerformance.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-10-08-LargeArrayPerformance.ll (original) +++ llvm/trunk/test/Assembler/2002-10-08-LargeArrayPerformance.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; This testcase comes from the following really simple c file: ;; int foo[30000] ;;; We should not be soo slow for such a simple case! Modified: llvm/trunk/test/Assembler/2002-10-15-NameClash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-10-15-NameClash.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-10-15-NameClash.ll (original) +++ llvm/trunk/test/Assembler/2002-10-15-NameClash.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null declare i32 @"ArrayRef"([100 x i32] * %Array) Modified: llvm/trunk/test/Assembler/2002-12-15-GlobalResolve.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-12-15-GlobalResolve.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-12-15-GlobalResolve.ll (original) +++ llvm/trunk/test/Assembler/2002-12-15-GlobalResolve.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null @X = external global i32* @X1 = external global %T* Modified: llvm/trunk/test/Assembler/2003-01-30-UnsignedString.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-01-30-UnsignedString.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-01-30-UnsignedString.ll (original) +++ llvm/trunk/test/Assembler/2003-01-30-UnsignedString.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null @spell_order = global [4 x i8] c"\FF\00\F7\00" Modified: llvm/trunk/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll (original) +++ llvm/trunk/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; There should be absolutely no problem with this testcase. define i32 @test(i32 %arg1, i32 %arg2) { Modified: llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.ll (original) +++ llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ ; This bug was caused by two CPR's existing for the same global variable, ; colliding in the Module level CPR map. -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null define void @test() { call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 ) Modified: llvm/trunk/test/Assembler/2003-05-15-SwitchBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-15-SwitchBug.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-05-15-SwitchBug.ll (original) +++ llvm/trunk/test/Assembler/2003-05-15-SwitchBug.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; Check minimal switch statement Modified: llvm/trunk/test/Assembler/2003-05-21-ConstantShiftExpr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-21-ConstantShiftExpr.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-05-21-ConstantShiftExpr.ll (original) +++ llvm/trunk/test/Assembler/2003-05-21-ConstantShiftExpr.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; Test that shift instructions can be used in constant expressions. global i32 3670016 Modified: llvm/trunk/test/Assembler/2003-05-21-EmptyStructTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-21-EmptyStructTest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-05-21-EmptyStructTest.ll (original) +++ llvm/trunk/test/Assembler/2003-05-21-EmptyStructTest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; The old C front-end never generated empty structures, now the new one ; can. For some reason we never handled them in the parser. Weird. Modified: llvm/trunk/test/Assembler/2003-06-30-RecursiveTypeProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-06-30-RecursiveTypeProblem.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-06-30-RecursiveTypeProblem.ll (original) +++ llvm/trunk/test/Assembler/2003-06-30-RecursiveTypeProblem.ll Tue Aug 25 10:38:29 2009 @@ -1,3 +1,3 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %MidFnTy = type void (%MidFnTy*) Modified: llvm/trunk/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll (original) +++ llvm/trunk/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %T = type i32 @X = global i32* null ; [#uses=0] Modified: llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll (original) +++ llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: not llvm-as %s -o /dev/null -f |& grep {use of undefined type named 'struct.D_Scope'} +; RUN: not llvm-as %s -o /dev/null |& grep {use of undefined type named 'struct.D_Scope'} ; END. @d_reduction_0_dparser_gram = global { Modified: llvm/trunk/test/Assembler/2004-02-27-SelfUseAssertError.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-02-27-SelfUseAssertError.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2004-02-27-SelfUseAssertError.ll (original) +++ llvm/trunk/test/Assembler/2004-02-27-SelfUseAssertError.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null ; %inc2 uses it's own value, but that's ok, as it's unreachable! Modified: llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll (original) +++ llvm/trunk/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null define i32* @t1({ float, i32 }* %X) { %W = getelementptr { float, i32 }* %X, i32 20, i32 1 ; [#uses=0] Modified: llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.ll (original) +++ llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ;; The bytecode writer was trying to treat undef values as ConstantArray's when ;; they looked like strings. -;; RUN: llvm-as %s -o /dev/null -f +;; RUN: llvm-as %s -o /dev/null @G = internal global [8 x i8] undef Modified: llvm/trunk/test/Assembler/2004-11-28-InvalidTypeCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-11-28-InvalidTypeCrash.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2004-11-28-InvalidTypeCrash.ll (original) +++ llvm/trunk/test/Assembler/2004-11-28-InvalidTypeCrash.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ ; Test for PR463. This program is erroneous, but should not crash llvm-as. -; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid type for null constant} +; RUN: not llvm-as %s -o /dev/null |& grep {invalid type for null constant} @.FOO = internal global %struct.none zeroinitializer Modified: llvm/trunk/test/Assembler/2005-01-31-CallingAggregateFunction.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2005-01-31-CallingAggregateFunction.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2005-01-31-CallingAggregateFunction.ll (original) +++ llvm/trunk/test/Assembler/2005-01-31-CallingAggregateFunction.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null define void @test() { call {i32} @foo() Modified: llvm/trunk/test/Assembler/2007-01-02-Undefined-Arg-Type.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2007-01-02-Undefined-Arg-Type.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2007-01-02-Undefined-Arg-Type.ll (original) +++ llvm/trunk/test/Assembler/2007-01-02-Undefined-Arg-Type.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; The assembler should catch an undefined argument type . -; RUN: not llvm-as %s -o /dev/null -f |& grep {use of undefined type named 'typedef.bc_struct'} +; RUN: not llvm-as %s -o /dev/null |& grep {use of undefined type named 'typedef.bc_struct'} ; %typedef.bc_struct = type opaque Modified: llvm/trunk/test/Assembler/2007-01-05-Cmp-ConstExpr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2007-01-05-Cmp-ConstExpr.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2007-01-05-Cmp-ConstExpr.ll (original) +++ llvm/trunk/test/Assembler/2007-01-05-Cmp-ConstExpr.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; Test Case for PR1080 -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null @str = internal constant [4 x i8] c"-ga\00" ; <[4 x i8]*> [#uses=2] Modified: llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast.ll (original) +++ llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; PR1117 -; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid cast opcode for cast from} +; RUN: not llvm-as %s -o /dev/null |& grep {invalid cast opcode for cast from} define i8* @nada(i64 %X) { %result = trunc i64 %X to i8* Modified: llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast2.ll (original) +++ llvm/trunk/test/Assembler/2007-01-16-CrashOnBadCast2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ ; PR1117 -; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid cast opcode for cast from} +; RUN: not llvm-as %s -o /dev/null |& grep {invalid cast opcode for cast from} @X = constant i8* trunc (i64 0 to i8*) Modified: llvm/trunk/test/Assembler/2007-03-18-InvalidNumberedVar.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2007-03-18-InvalidNumberedVar.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2007-03-18-InvalidNumberedVar.ll (original) +++ llvm/trunk/test/Assembler/2007-03-18-InvalidNumberedVar.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; PR 1258 -; RUN: not llvm-as < %s >/dev/null -f |& grep {'%0' defined with type 'i1'} +; RUN: not llvm-as < %s >/dev/null |& grep {'%0' defined with type 'i1'} define i32 @test1(i32 %a, i32 %b) { entry: Modified: llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll (original) +++ llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; Test function notes -; RUN: not llvm-as %s -o /dev/null -f |& grep "Attributes noinline alwaysinline are incompatible" +; RUN: not llvm-as %s -o /dev/null |& grep "Attributes noinline alwaysinline are incompatible" define void @fn1() alwaysinline noinline { ret void } Modified: llvm/trunk/test/Assembler/2009-07-24-ZeroArgGEP.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2009-07-24-ZeroArgGEP.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2009-07-24-ZeroArgGEP.ll (original) +++ llvm/trunk/test/Assembler/2009-07-24-ZeroArgGEP.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null @foo = global i32 0 @bar = constant i32* getelementptr(i32* @foo) Modified: llvm/trunk/test/Assembler/select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/select.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Assembler/select.ll (original) +++ llvm/trunk/test/Assembler/select.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null define i32 @test(i1 %C, i32 %V1, i32 %V2) { Modified: llvm/trunk/test/Bitcode/memcpy.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/memcpy.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Bitcode/memcpy.ll (original) +++ llvm/trunk/test/Bitcode/memcpy.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null define void @test(i32* %P, i32* %Q) { entry: Modified: llvm/trunk/test/Bitcode/metadata-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/metadata-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Bitcode/metadata-2.ll (original) +++ llvm/trunk/test/Bitcode/metadata-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llvm-dis -f -o /dev/null +; RUN: llvm-as < %s | llvm-dis -o /dev/null type { %object.ModuleInfo.__vtbl*, i8*, %"byte[]", %1, %"ClassInfo[]", i32, void ()*, void ()*, void ()*, i8*, void ()* } ; type %0 type { i64, %object.ModuleInfo* } ; type %1 type { i32, void ()* } ; type %2 Modified: llvm/trunk/test/Bitcode/metadata.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/metadata.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Bitcode/metadata.ll (original) +++ llvm/trunk/test/Bitcode/metadata.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llvm-dis -f -o /dev/null +; RUN: llvm-as < %s | llvm-dis -o /dev/null !llvm.foo = !{!0} !0 = metadata !{i32 42} Modified: llvm/trunk/test/CodeGen/ARM/aliases.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/aliases.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/aliases.ll (original) +++ llvm/trunk/test/CodeGen/ARM/aliases.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=arm-linux-gnueabi -o %t -f +; RUN: llc -mtriple=arm-linux-gnueabi -o %t ; RUN: grep set %t | count 5 ; RUN: grep globl %t | count 4 ; RUN: grep weak %t | count 1 Modified: llvm/trunk/test/CodeGen/Alpha/add.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/add.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/add.ll (original) +++ llvm/trunk/test/CodeGen/Alpha/add.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ ;test all the shifted and signextending adds and subs with and without consts ; -; RUN: llvm-as < %s | llc -march=alpha -o %t.s -f +; RUN: llvm-as < %s | llc -march=alpha -o %t.s ; RUN: grep { addl} %t.s | count 2 ; RUN: grep { addq} %t.s | count 2 ; RUN: grep { subl} %t.s | count 2 Modified: llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll (original) +++ llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -f -o %t +; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -o %t define x86_fp80 @some_func() nounwind { entry: Modified: llvm/trunk/test/CodeGen/CPP/2009-05-04-CondBr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CPP/2009-05-04-CondBr.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CPP/2009-05-04-CondBr.ll (original) +++ llvm/trunk/test/CodeGen/CPP/2009-05-04-CondBr.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -f -o %t +; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -o %t ; RUN: grep "BranchInst::Create(label_if_then, label_if_end, int1_cmp, label_entry);" %t define i32 @some_func(i32 %a) nounwind { Modified: llvm/trunk/test/CodeGen/CellSPU/rotate_ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/rotate_ops.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/rotate_ops.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/rotate_ops.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as -o - %s | llc -march=cellspu -f -o %t1.s +; RUN: llvm-as -o - %s | llc -march=cellspu -o %t1.s ; RUN: grep rot %t1.s | count 85 ; RUN: grep roth %t1.s | count 8 ; RUN: grep roti.*5 %t1.s | count 1 Modified: llvm/trunk/test/CodeGen/Generic/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/Makefile?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/Makefile (original) +++ llvm/trunk/test/CodeGen/Generic/Makefile Tue Aug 25 10:38:29 2009 @@ -1,10 +1,10 @@ # Makefile for running ad-hoc custom LLVM tests # %.bc: %.ll - llvm-as -f $< + llvm-as $< %.llc.s: %.bc - llc -f $< -o $@ + llc $< -o $@ %.gcc.s: %.c gcc -O0 -S $< -o $@ Modified: llvm/trunk/test/CodeGen/Generic/nested-select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/nested-select.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/nested-select.ll (original) +++ llvm/trunk/test/CodeGen/Generic/nested-select.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o /dev/null -f +; RUN: llvm-as < %s | llc -o /dev/null ; Test that select of a select works Modified: llvm/trunk/test/CodeGen/Generic/switch-lower-feature-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/switch-lower-feature-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/switch-lower-feature-2.ll (original) +++ llvm/trunk/test/CodeGen/Generic/switch-lower-feature-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -o %t ; RUN: grep jb %t | count 1 ; RUN: grep \\\$6 %t | count 2 ; RUN: grep 1024 %t | count 1 Modified: llvm/trunk/test/CodeGen/Mips/2008-06-05-Carry.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-06-05-Carry.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-06-05-Carry.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-06-05-Carry.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep subu %t | count 2 ; RUN: grep addu %t | count 4 Modified: llvm/trunk/test/CodeGen/Mips/2008-07-07-IntDoubleConvertions.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-07-IntDoubleConvertions.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-07-IntDoubleConvertions.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-07-IntDoubleConvertions.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep __floatsidf %t | count 1 ; RUN: grep __floatunsidf %t | count 1 ; RUN: grep __fixdfsi %t | count 1 Modified: llvm/trunk/test/CodeGen/Mips/2008-07-15-InternalConstant.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-15-InternalConstant.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-15-InternalConstant.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-15-InternalConstant.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep {rodata.str1.4,"aMS", at progbits} %t | count 1 ; RUN: grep {r.data,} %t | count 1 ; RUN: grep {\%hi} %t | count 2 Modified: llvm/trunk/test/CodeGen/Mips/2008-07-15-SmallSection.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-15-SmallSection.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-15-SmallSection.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-15-SmallSection.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -mips-ssection-threshold=8 -march=mips -f -o %t0 -; RUN: llvm-as < %s | llc -mips-ssection-threshold=0 -march=mips -f -o %t1 +; RUN: llvm-as < %s | llc -mips-ssection-threshold=8 -march=mips -o %t0 +; RUN: llvm-as < %s | llc -mips-ssection-threshold=0 -march=mips -o %t1 ; RUN: grep {sdata} %t0 | count 1 ; RUN: grep {sbss} %t0 | count 1 ; RUN: grep {gp_rel} %t0 | count 2 Modified: llvm/trunk/test/CodeGen/Mips/2008-07-16-SignExtInReg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-16-SignExtInReg.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-16-SignExtInReg.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-16-SignExtInReg.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep seh %t | count 1 ; RUN: grep seb %t | count 1 Modified: llvm/trunk/test/CodeGen/Mips/2008-07-22-Cstpool.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-22-Cstpool.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-22-Cstpool.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-22-Cstpool.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep {CPI\[01\]_\[01\]:} %t | count 2 ; RUN: grep {rodata.cst4,"aM", at progbits} %t | count 1 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64" Modified: llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep {c\\..*\\.s} %t | count 3 ; RUN: grep {bc1\[tf\]} %t | count 3 Modified: llvm/trunk/test/CodeGen/Mips/2008-07-31-fcopysign.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-31-fcopysign.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-31-fcopysign.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-31-fcopysign.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep abs.s %t | count 1 ; RUN: grep neg.s %t | count 1 Modified: llvm/trunk/test/CodeGen/Mips/2008-08-01-AsmInline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-08-01-AsmInline.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-08-01-AsmInline.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-08-01-AsmInline.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep mfhi %t | count 1 ; RUN: grep mflo %t | count 1 ; RUN: grep multu %t | count 1 Modified: llvm/trunk/test/CodeGen/Mips/2008-08-03-fabs64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-08-03-fabs64.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-08-03-fabs64.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-08-03-fabs64.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep {lui.*32767} %t | count 1 ; RUN: grep {ori.*65535} %t | count 1 Modified: llvm/trunk/test/CodeGen/Mips/2008-08-04-Bitconvert.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-08-04-Bitconvert.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-08-04-Bitconvert.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-08-04-Bitconvert.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f -o %t +; RUN: llvm-as < %s | llc -march=mips -o %t ; RUN: grep mtc1 %t | count 1 ; RUN: grep mfc1 %t | count 1 Modified: llvm/trunk/test/CodeGen/Mips/2008-08-07-CC.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-08-07-CC.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-08-07-CC.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-08-07-CC.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=mips -f +; RUN: llvm-as < %s | llc -march=mips ; Mips must ignore fastcc target datalayout = Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-small.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/Frames-small.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/Frames-small.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/Frames-small.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -o %t1 -f +; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -o %t1 ; RUN not grep {stw r31, 20(r1)} %t1 ; RUN: grep {stwu r1, -16448(r1)} %t1 ; RUN: grep {addi r1, r1, 16448} %t1 @@ -7,20 +7,20 @@ ; RUN: not grep {lwz r31, 20(r1)} ; RUN: llvm-as < %s | \ ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \ -; RUN: -o %t2 -f +; RUN: -o %t2 ; RUN: grep {stw r31, 20(r1)} %t2 ; RUN: grep {stwu r1, -16448(r1)} %t2 ; RUN: grep {addi r1, r1, 16448} %t2 ; RUN: grep {lwz r31, 20(r1)} %t2 ; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -o %t3 -f +; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -o %t3 ; RUN: not grep {std r31, 40(r1)} %t3 ; RUN: grep {stdu r1, -16496(r1)} %t3 ; RUN: grep {addi r1, r1, 16496} %t3 ; RUN: not grep {ld r31, 40(r1)} %t3 ; RUN: llvm-as < %s | \ ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \ -; RUN: -o %t4 -f +; RUN: -o %t4 ; RUN: grep {std r31, 40(r1)} %t4 ; RUN: grep {stdu r1, -16496(r1)} %t4 ; RUN: grep {addi r1, r1, 16496} %t4 Modified: llvm/trunk/test/CodeGen/PowerPC/addc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/addc.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/addc.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/addc.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; All of these should be codegen'd without loading immediates -; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -o %t ; RUN: grep addc %t | count 1 ; RUN: grep adde %t | count 1 ; RUN: grep addze %t | count 1 Modified: llvm/trunk/test/CodeGen/PowerPC/and_add.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/and_add.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/and_add.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/and_add.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -o %t ; RUN: grep slwi %t ; RUN: not grep addi %t ; RUN: not grep rlwinm %t Modified: llvm/trunk/test/CodeGen/PowerPC/mulhs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/mulhs.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/mulhs.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/mulhs.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -o %t ; RUN: not grep mulhwu %t ; RUN: not grep srawi %t ; RUN: not grep add %t Modified: llvm/trunk/test/CodeGen/PowerPC/rlwimi2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/rlwimi2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/rlwimi2.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/rlwimi2.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -o %t ; RUN: grep rlwimi %t | count 3 ; RUN: grep srwi %t | count 1 ; RUN: not grep slwi %t Modified: llvm/trunk/test/CodeGen/PowerPC/rlwinm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/rlwinm.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/rlwinm.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/rlwinm.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; All of these ands and shifts should be folded into rlwimi's -; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -o %t ; RUN: not grep and %t ; RUN: not grep srawi %t ; RUN: not grep srwi %t Modified: llvm/trunk/test/CodeGen/PowerPC/rlwinm2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/rlwinm2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/rlwinm2.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/rlwinm2.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; All of these ands and shifts should be folded into rlw[i]nm instructions -; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -o %t ; RUN: not grep and %t ; RUN: not grep srawi %t ; RUN: not grep srwi %t Modified: llvm/trunk/test/CodeGen/PowerPC/stfiwx.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/stfiwx.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/stfiwx.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/stfiwx.ll Tue Aug 25 10:38:29 2009 @@ -1,10 +1,10 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1 -f +; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1 ; RUN: grep stfiwx %t1 ; RUN: not grep r1 %t1 ; RUN: llvm-as < %s | \ ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx \ -; RUN: -o %t2 -f +; RUN: -o %t2 ; RUN: not grep stfiwx %t2 ; RUN: grep r1 %t2 Modified: llvm/trunk/test/CodeGen/PowerPC/subc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/subc.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/subc.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/subc.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; All of these should be codegen'd without loading immediates -; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -o %t ; RUN: grep subfc %t | count 1 ; RUN: grep subfe %t | count 1 ; RUN: grep subfze %t | count 1 Modified: llvm/trunk/test/CodeGen/PowerPC/vec_br_cmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/vec_br_cmp.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/vec_br_cmp.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/vec_br_cmp.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t ; RUN: grep vcmpeqfp. %t ; RUN: not grep mfcr %t Modified: llvm/trunk/test/CodeGen/PowerPC/vec_splat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/vec_splat.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/vec_splat.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/vec_splat.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ ; Test that vectors are scalarized/lowered correctly. ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3 | \ ; RUN: grep stfs | count 4 -; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t ; RUN: grep vspltw %t | count 2 ; RUN: grep vsplti %t | count 3 ; RUN: grep vsplth %t | count 1 Modified: llvm/trunk/test/CodeGen/PowerPC/vec_vrsave.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/vec_vrsave.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/vec_vrsave.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/vec_vrsave.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t -f +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 -o %t ; RUN: grep vrlw %t ; RUN: not grep spr %t ; RUN: not grep vrsave %t Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -o %t ; RUN: not grep and %t ; RUN: not grep shr %t ; rdar://6661955 Modified: llvm/trunk/test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o %t1 -f +; RUN: llvm-as < %s | llc -o %t1 ; RUN: grep "subq.*\\\$72, \\\%rsp" %t1 ; RUN: grep "movaps \\\%xmm8, 32\\\(\\\%rsp\\\)" %t1 ; RUN: grep "movaps \\\%xmm7, 48\\\(\\\%rsp\\\)" %t1 Modified: llvm/trunk/test/CodeGen/X86/aliases.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/aliases.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/aliases.ll (original) +++ llvm/trunk/test/CodeGen/X86/aliases.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t -f +; RUN: llc -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t ; RUN: grep set %t | count 7 ; RUN: grep globl %t | count 6 ; RUN: grep weak %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/atomic_op.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/atomic_op.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/atomic_op.ll (original) +++ llvm/trunk/test/CodeGen/X86/atomic_op.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -o %t1 -f +; RUN: llvm-as < %s | llc -march=x86 -o %t1 ; RUN: grep "lock" %t1 | count 17 ; RUN: grep "xaddl" %t1 | count 4 ; RUN: grep "cmpxchgl" %t1 | count 13 Modified: llvm/trunk/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll (original) +++ llvm/trunk/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86-64 -o %t -f -stats -info-output-file - | \ +; RUN: llvm-as < %s | llc -march=x86-64 -o %t -stats -info-output-file - | \ ; RUN: grep {asm-printer} | grep {Number of machine instrs printed} | grep 5 ; RUN: grep {leal 1(\%rsi),} %t Modified: llvm/trunk/test/CodeGen/X86/dagcombine-buildvector.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dagcombine-buildvector.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/dagcombine-buildvector.ll (original) +++ llvm/trunk/test/CodeGen/X86/dagcombine-buildvector.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=penryn -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=penryn -disable-mmx -o %t ; RUN: grep unpcklpd %t | count 1 ; RUN: grep movapd %t | count 1 ; RUN: grep movaps %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/extract-combine.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/extract-combine.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/extract-combine.ll (original) +++ llvm/trunk/test/CodeGen/X86/extract-combine.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86-64 -mcpu=core2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86-64 -mcpu=core2 -o %t ; RUN: not grep unpcklps %t define i32 @foo() nounwind { Modified: llvm/trunk/test/CodeGen/X86/iv-users-in-other-loops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/iv-users-in-other-loops.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/iv-users-in-other-loops.ll (original) +++ llvm/trunk/test/CodeGen/X86/iv-users-in-other-loops.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86-64 -f -o %t +; RUN: llvm-as < %s | llc -march=x86-64 -o %t ; RUN: grep inc %t | count 1 ; RUN: grep dec %t | count 2 ; RUN: grep addq %t | count 13 Modified: llvm/trunk/test/CodeGen/X86/legalizedag_vec.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/legalizedag_vec.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/legalizedag_vec.ll (original) +++ llvm/trunk/test/CodeGen/X86/legalizedag_vec.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse2 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse2 -disable-mmx -o %t ; RUN: grep {call.*divdi3} %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/mingw-alloca.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mingw-alloca.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/mingw-alloca.ll (original) +++ llvm/trunk/test/CodeGen/X86/mingw-alloca.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o %t -f +; RUN: llvm-as < %s | llc -o %t ; RUN: grep __alloca %t | count 2 ; RUN: grep 4294967288 %t ; RUN: grep {pushl %eax} %t Modified: llvm/trunk/test/CodeGen/X86/neg_fp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/neg_fp.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/neg_fp.ll (original) +++ llvm/trunk/test/CodeGen/X86/neg_fp.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t ; RUN: grep xorps %t | count 1 ; Test that when we don't -enable-unsafe-fp-math, we don't do the optimization @@ -9,4 +9,4 @@ %sub = fsub float %a, %b ; [#uses=1] %neg = fsub float -0.000000e+00, %sub ; [#uses=1] ret float %neg -} \ No newline at end of file +} Modified: llvm/trunk/test/CodeGen/X86/pic-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic-1.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f +; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | count 3 ; RUN: grep GOT %t | count 3 Modified: llvm/trunk/test/CodeGen/X86/pic-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic-2.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ -; RUN: -o %t -f +; RUN: -o %t ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | count 3 ; RUN: grep GOTOFF %t | count 4 Modified: llvm/trunk/test/CodeGen/X86/pic-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic-4.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic-4.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f +; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | count 3 ; RUN: grep PLT %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/pic-5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-5.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic-5.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic-5.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ -; RUN: -o %t -f +; RUN: -o %t ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | count 3 ; RUN: grep PLT %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/pic-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-6.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic-6.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ -; RUN: -o %t -f +; RUN: -o %t ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | count 3 ; RUN: grep GOT %t | count 3 Modified: llvm/trunk/test/CodeGen/X86/pic-cpool.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-cpool.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic-cpool.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic-cpool.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ -; RUN: -o %t -f +; RUN: -o %t ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | count 3 ; RUN: grep GOTOFF %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/pic-jtbl.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-jtbl.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic-jtbl.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic-jtbl.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \ -; RUN: -o %t -f +; RUN: -o %t ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t ; RUN: grep piclabel %t | count 3 ; RUN: grep PLT %t | count 6 Modified: llvm/trunk/test/CodeGen/X86/scalar-extract.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/scalar-extract.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/scalar-extract.ll (original) +++ llvm/trunk/test/CodeGen/X86/scalar-extract.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx -o %t ; RUN: not grep movq %t ; Check that widening doesn't introduce a mmx register in this case when Modified: llvm/trunk/test/CodeGen/X86/vec_clear.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_clear.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_clear.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_clear.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -o %t ; RUN: not grep and %t ; RUN: not grep psrldq %t ; RUN: grep xorps %t Modified: llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t ; RUN: grep extractps %t | count 1 ; RUN: grep pextrd %t | count 1 ; RUN: not grep pshufd %t Modified: llvm/trunk/test/CodeGen/X86/vec_extract.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_extract.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_extract.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_extract.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2,-sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2,-sse41 -o %t ; RUN: grep movss %t | count 3 ; RUN: grep movhlps %t | count 1 ; RUN: grep pshufd %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_i64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_i64.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_i64.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_i64.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep movq %t | count 2 ; Used movq to load i64 into a v2i64 when the top i64 is 0. Modified: llvm/trunk/test/CodeGen/X86/vec_insert-8.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_insert-8.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_insert-8.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_insert-8.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t ; tests variable insert and extract of a 4 x i32 Modified: llvm/trunk/test/CodeGen/X86/vec_set-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_set-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_set-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_set-3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep pshufd %t | count 2 define <4 x float> @test(float %a) nounwind { Modified: llvm/trunk/test/CodeGen/X86/vec_set-5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_set-5.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_set-5.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_set-5.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep movlhps %t | count 1 ; RUN: grep movq %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/vec_set-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_set-6.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_set-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_set-6.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep movss %t | count 1 ; RUN: grep movq %t | count 1 ; RUN: grep shufps %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-10.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-10.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-10.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-10.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep unpcklps %t | count 1 ; RUN: grep pshufd %t | count 1 ; RUN: not grep {sub.*esp} %t Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-16.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-16.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-16.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-16.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 -mtriple=i386-apple-darwin -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 -mtriple=i386-apple-darwin -o %t ; RUN: grep shufps %t | count 4 ; RUN: grep movaps %t | count 2 -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -o %t ; RUN: grep pshufd %t | count 4 ; RUN: not grep shufps %t ; RUN: not grep mov %t Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-22.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-22.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-22.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-22.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=pentium-m -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=pentium-m -o %t ; RUN: grep movlhps %t | count 1 ; RUN: grep pshufd %t | count 1 -; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t ; RUN: grep movlhps %t | count 1 ; RUN: grep movddup %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-25.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-25.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-25.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-25.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t ; RUN: grep unpcklps %t | count 3 ; RUN: grep unpckhps %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-26.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-26.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-26.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-26.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t ; RUN: grep unpcklps %t | count 1 ; RUN: grep unpckhps %t | count 3 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-27.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-27.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-27.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-27.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t ; RUN: grep addps %t | count 2 ; RUN: grep mulps %t | count 2 ; RUN: grep subps %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-28.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t ; RUN: grep pshufb %t | count 1 ; FIXME: this test has a superfluous punpcklqdq pre-pshufb currently. Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep movlhps %t | count 1 ; RUN: grep movhlps %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-30.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-30.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-30.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-30.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -disable-mmx -o %t ; RUN: grep pshufhw %t | grep 161 | count 1 ; RUN: grep shufps %t | count 1 ; RUN: not grep pslldq %t Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-31.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-31.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-31.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-31.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t ; RUN: grep pshufb %t | count 1 define <8 x i16> @shuf3(<8 x i16> %T0, <8 x i16> %T1) nounwind readnone { Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-35.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-35.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-35.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-35.ll Tue Aug 25 10:38:29 2009 @@ -1,10 +1,10 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -stack-alignment=16 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -stack-alignment=16 -o %t ; RUN: grep pextrw %t | count 13 ; RUN: grep pinsrw %t | count 14 ; RUN: grep rolw %t | count 13 ; RUN: not grep esp %t ; RUN: not grep ebp %t -; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -stack-alignment=16 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -stack-alignment=16 -o %t ; RUN: grep pshufb %t | count 3 define <16 x i8> @shuf1(<16 x i8> %T0) nounwind readnone { Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-36.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-36.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-36.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-36.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t ; RUN: grep pshufb %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-5.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-5.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-5.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep movhlps %t | count 1 ; RUN: grep shufps %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep movapd %t | count 1 ; RUN: grep movaps %t | count 1 ; RUN: grep movups %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-7.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-7.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-7.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-7.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep xorps %t | count 1 ; RUN: not grep shufps %t Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-9.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-9.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-9.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-9.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t ; RUN: grep punpck %t | count 2 ; RUN: not grep pextrw %t Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mcpu=core2 -o %t ; RUN: grep shufp %t | count 1 ; RUN: grep movupd %t | count 1 ; RUN: grep pshufhw %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/vec_splat-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_splat-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_splat-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_splat-3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t ; RUN: grep punpcklwd %t | count 4 ; RUN: grep punpckhwd %t | count 4 ; RUN: grep "pshufd" %t | count 8 Modified: llvm/trunk/test/CodeGen/X86/vec_splat-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_splat-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_splat-4.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_splat-4.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -o %t ; RUN: grep punpcklbw %t | count 16 ; RUN: grep punpckhbw %t | count 16 ; RUN: grep "pshufd" %t | count 16 Modified: llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,+sse2 -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,+sse2 -o %t ; RUN: grep minss %t | grep CPI | count 2 ; RUN: grep CPI %t | not grep movss Modified: llvm/trunk/test/CodeGen/X86/vshift-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vshift-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vshift-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/vshift-1.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t ; RUN: grep psllq %t | count 2 ; RUN: grep pslld %t | count 2 ; RUN: grep psllw %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/vshift-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vshift-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vshift-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/vshift-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t ; RUN: grep psrlq %t | count 2 ; RUN: grep psrld %t | count 2 ; RUN: grep psrlw %t | count 2 @@ -61,4 +61,4 @@ %lshr = lshr <8 x i16> %val, %7 store <8 x i16> %lshr, <8 x i16>* %dst ret void -} \ No newline at end of file +} Modified: llvm/trunk/test/CodeGen/X86/vshift-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vshift-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vshift-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/vshift-3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t ; RUN: grep psrad %t | count 2 ; RUN: grep psraw %t | count 2 @@ -51,4 +51,4 @@ %ashr = ashr <8 x i16> %val, %7 store <8 x i16> %ashr, <8 x i16>* %dst ret void -} \ No newline at end of file +} Modified: llvm/trunk/test/CodeGen/X86/vshift-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vshift-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vshift-4.ll (original) +++ llvm/trunk/test/CodeGen/X86/vshift-4.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -o %t ; RUN: grep psllq %t | count 1 ; RUN: grep pslld %t | count 3 ; RUN: grep psllw %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/widen_arith-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_arith-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_arith-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_arith-1.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep paddb %t | count 1 ; RUN: grep pextrb %t | count 1 ; RUN: not grep pextrw %t Modified: llvm/trunk/test/CodeGen/X86/widen_arith-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_arith-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_arith-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_arith-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep paddb %t | count 1 ; RUN: grep pand %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/widen_arith-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_arith-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_arith-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_arith-3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep paddw %t | count 1 ; RUN: grep movd %t | count 2 ; RUN: grep pextrw %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/widen_arith-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_arith-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_arith-4.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_arith-4.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep psubw %t | count 1 ; RUN: grep pmullw %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/widen_arith-5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_arith-5.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_arith-5.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_arith-5.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep pmulld %t | count 1 ; RUN: grep psubd %t | count 1 ; RUN: grep movaps %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/widen_arith-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_arith-6.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_arith-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_arith-6.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep mulps %t | count 1 ; RUN: grep addps %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/widen_cast-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_cast-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_cast-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_cast-1.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep paddw %t | count 1 ; RUN: grep movd %t | count 1 ; RUN: grep pextrd %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/widen_cast-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_cast-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_cast-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_cast-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep pextrd %t | count 5 ; RUN: grep movd %t | count 3 Modified: llvm/trunk/test/CodeGen/X86/widen_cast-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_cast-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_cast-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_cast-3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep paddd %t | count 1 ; RUN: grep pextrd %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/widen_cast-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_cast-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_cast-4.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_cast-4.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep sarb %t | count 8 ; v8i8 that is widen to v16i8 then split Modified: llvm/trunk/test/CodeGen/X86/widen_cast-5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_cast-5.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_cast-5.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_cast-5.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; bitcast a i64 to v2i32 Modified: llvm/trunk/test/CodeGen/X86/widen_cast-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_cast-6.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_cast-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_cast-6.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -disable-mmx -o %t ; RUN: grep movd %t | count 1 ; Test bit convert that requires widening in the operand. Modified: llvm/trunk/test/CodeGen/X86/widen_conv-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_conv-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_conv-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_conv-1.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; RUN: grep pshufd %t | count 1 ; RUN: grep paddd %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/widen_conv-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_conv-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_conv-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_conv-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; sign extension v2i32 to v2i16 Modified: llvm/trunk/test/CodeGen/X86/widen_conv-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_conv-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_conv-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_conv-3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; grep cvtsi2ss %t | count 1 ; sign to float v2i16 to v2f32 Modified: llvm/trunk/test/CodeGen/X86/widen_conv-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_conv-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_conv-4.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_conv-4.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; unsigned to float v7i16 to v7f32 Modified: llvm/trunk/test/CodeGen/X86/widen_select-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_select-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_select-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_select-1.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; widening select v6i32 and then a sub Modified: llvm/trunk/test/CodeGen/X86/widen_shuffle-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_shuffle-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_shuffle-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_shuffle-1.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; widening shuffle v3float and then a add Modified: llvm/trunk/test/CodeGen/X86/widen_shuffle-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_shuffle-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_shuffle-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/widen_shuffle-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse42 -disable-mmx -o %t ; widening shuffle v3float and then a add Modified: llvm/trunk/test/CodeGen/X86/x86-64-mem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-mem.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-mem.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-mem.ll Tue Aug 25 10:38:29 2009 @@ -1,10 +1,10 @@ -; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -o %t1 -f +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -o %t1 ; RUN: grep GOTPCREL %t1 | count 4 ; RUN: grep %%rip %t1 | count 6 ; RUN: grep movq %t1 | count 6 ; RUN: grep leaq %t1 | count 1 ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=static -o %t2 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=static -o %t2 ; RUN: grep movl %t2 | count 2 ; RUN: grep movq %t2 | count 2 Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-1.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {call f at PLT} %t1 define void @g() { Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-10.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-10.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-10.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-10.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {call g at PLT} %t1 @g = alias weak i32 ()* @f Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-11.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-11.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-11.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-11.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {call __fixunsxfti at PLT} %t1 define i128 @f(x86_fp80 %a) nounwind { Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-2.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {call f} %t1 ; RUN: not grep {call f at PLT} %t1 Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-3.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {call f} %t1 ; RUN: not grep {call f at PLT} %t1 Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-4.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-4.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {movq a at GOTPCREL(%rip),} %t1 @a = global i32 0 Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-5.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-5.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-5.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {movl a(%rip),} %t1 ; RUN: not grep GOTPCREL %t1 Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-6.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-6.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {movl a(%rip),} %t1 ; RUN: not grep GOTPCREL %t1 Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-7.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-7.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-7.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-7.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {movq f at GOTPCREL(%rip),} %t1 define void ()* @g() nounwind { Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-8.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-8.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-8.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-8.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {leaq f(%rip),} %t1 ; RUN: not grep GOTPCREL %t1 Modified: llvm/trunk/test/CodeGen/X86/x86-64-pic-9.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-pic-9.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-pic-9.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-pic-9.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f +; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 ; RUN: grep {leaq f(%rip),} %t1 ; RUN: not grep GOTPCREL %t1 Modified: llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -f -o /dev/null -verify-dom-info +; RUN: llvm-as < %s | llc -o /dev/null -verify-dom-info %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } Modified: llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -f -o /dev/null +; RUN: llvm-as < %s | llc -o /dev/null ; XFAIL: powerpc target triple = "powerpc-apple-darwin9.5" Modified: llvm/trunk/test/DebugInfo/2009-01-15-member.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-member.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-member.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-15-member.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -f -o /dev/null +; RUN: llvm-as < %s | llc -o /dev/null %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } @@ -27,4 +27,4 @@ @llvm.dbg.composite11 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array to { }*), i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] @.str12 = internal constant [3 x i8] c"s2\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] - at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([3 x i8]* @.str12, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 6, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*), i1 false, i1 true, { }* bitcast (%struct.s* @s2 to { }*), i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] \ No newline at end of file + at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([3 x i8]* @.str12, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 6, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*), i1 false, i1 true, { }* bitcast (%struct.s* @s2 to { }*), i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] Modified: llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll (original) +++ llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -f -o /dev/null +; RUN: llvm-as < %s | llc -o /dev/null %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } Modified: llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll (original) +++ llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -f -o /dev/null +; RUN: llvm-as < %s | llc -o /dev/null %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 } Modified: llvm/trunk/test/ExecutionEngine/2002-12-16-ArgTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2002-12-16-ArgTest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2002-12-16-ArgTest.ll (original) +++ llvm/trunk/test/ExecutionEngine/2002-12-16-ArgTest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null @.LC0 = internal global [10 x i8] c"argc: %d\0A\00" ; <[10 x i8]*> [#uses=1] Modified: llvm/trunk/test/ExecutionEngine/2003-01-04-ArgumentBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-01-04-ArgumentBug.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-01-04-ArgumentBug.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-01-04-ArgumentBug.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @foo(i32 %X, i32 %Y, double %A) { Modified: llvm/trunk/test/ExecutionEngine/2003-01-04-LoopTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-01-04-LoopTest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-01-04-LoopTest.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-01-04-LoopTest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o %t.bc -f +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/2003-01-04-PhiTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-01-04-PhiTest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-01-04-PhiTest.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-01-04-PhiTest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/2003-01-09-SARTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-01-09-SARTest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-01-09-SARTest.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-01-09-SARTest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; We were accidentally inverting the signedness of right shifts. Whoops. Modified: llvm/trunk/test/ExecutionEngine/2003-01-10-FUCOM.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-01-10-FUCOM.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-01-10-FUCOM.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-01-10-FUCOM.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/2003-01-15-AlignmentTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-01-15-AlignmentTest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-01-15-AlignmentTest.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-01-15-AlignmentTest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @bar(i8* %X) { Modified: llvm/trunk/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null target datalayout = "e-p:32:32" Modified: llvm/trunk/test/ExecutionEngine/2003-06-04-bzip2-bug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-06-04-bzip2-bug.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-06-04-bzip2-bug.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-06-04-bzip2-bug.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; Testcase distilled from 256.bzip2. Modified: llvm/trunk/test/ExecutionEngine/2003-06-05-PHIBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-06-05-PHIBug.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-06-05-PHIBug.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-06-05-PHIBug.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; Testcase distilled from 256.bzip2. Modified: llvm/trunk/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; This testcase failed to work because two variable sized allocas confused the Modified: llvm/trunk/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; Modified: llvm/trunk/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; This testcase exposes a bug in the local register allocator where it runs out Modified: llvm/trunk/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll (original) +++ llvm/trunk/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null @A = global i32 0 ; [#uses=1] Modified: llvm/trunk/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll (original) +++ llvm/trunk/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli -force-interpreter=true %t.bc | grep 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:32:32" Modified: llvm/trunk/test/ExecutionEngine/hello.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/hello.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/hello.ll (original) +++ llvm/trunk/test/ExecutionEngine/hello.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null @.LC0 = internal global [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1] Modified: llvm/trunk/test/ExecutionEngine/hello2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/hello2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/hello2.ll (original) +++ llvm/trunk/test/ExecutionEngine/hello2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null @X = global i32 7 ; [#uses=0] Modified: llvm/trunk/test/ExecutionEngine/simplesttest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/simplesttest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/simplesttest.ll (original) +++ llvm/trunk/test/ExecutionEngine/simplesttest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/simpletest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/simpletest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/simpletest.ll (original) +++ llvm/trunk/test/ExecutionEngine/simpletest.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @bar() { Modified: llvm/trunk/test/ExecutionEngine/test-arith.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-arith.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-arith.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-arith.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/test-branch.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-branch.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-branch.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-branch.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; test unconditional branch Modified: llvm/trunk/test/ExecutionEngine/test-call.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-call.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-call.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-call.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null declare void @exit(i32) Modified: llvm/trunk/test/ExecutionEngine/test-cast.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-cast.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-cast.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-cast.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @foo() { Modified: llvm/trunk/test/ExecutionEngine/test-constantexpr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-constantexpr.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-constantexpr.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-constantexpr.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; This tests to make sure that we can evaluate weird constant expressions Modified: llvm/trunk/test/ExecutionEngine/test-fp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-fp.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-fp.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-fp.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define double @test(double* %DP, double %Arg) { Modified: llvm/trunk/test/ExecutionEngine/test-loadstore.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-loadstore.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-loadstore.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-loadstore.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define void @test(i8* %P, i16* %P.upgrd.1, i32* %P.upgrd.2, i64* %P.upgrd.3) { Modified: llvm/trunk/test/ExecutionEngine/test-logical.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-logical.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-logical.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-logical.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/test-loop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-loop.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-loop.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-loop.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/test-malloc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-malloc.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-malloc.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-malloc.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/test-phi.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-phi.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-phi.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-phi.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; test phi node Modified: llvm/trunk/test/ExecutionEngine/test-ret.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-ret.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-ret.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-ret.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null ; test return instructions Modified: llvm/trunk/test/ExecutionEngine/test-setcond-fp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-setcond-fp.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-setcond-fp.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-setcond-fp.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null Modified: llvm/trunk/test/ExecutionEngine/test-setcond-int.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-setcond-int.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-setcond-int.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-setcond-int.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/ExecutionEngine/test-shift.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/test-shift.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/ExecutionEngine/test-shift.ll (original) +++ llvm/trunk/test/ExecutionEngine/test-shift.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -f -o %t.bc +; RUN: llvm-as %s -o %t.bc ; RUN: lli %t.bc > /dev/null define i32 @main() { Modified: llvm/trunk/test/Feature/NamedMDNode2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/NamedMDNode2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Feature/NamedMDNode2.ll (original) +++ llvm/trunk/test/Feature/NamedMDNode2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s -f -o /dev/null +; RUN: llvm-as < %s -o /dev/null ; PR4654 Modified: llvm/trunk/test/Feature/globalredefinition3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/globalredefinition3.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Feature/globalredefinition3.ll (original) +++ llvm/trunk/test/Feature/globalredefinition3.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: not llvm-as %s -o /dev/null -f |& grep {redefinition of global '@B'} +; RUN: not llvm-as %s -o /dev/null |& grep {redefinition of global '@B'} @B = global i32 7 @B = global i32 7 Modified: llvm/trunk/test/FrontendC++/2003-08-20-ExceptionFail.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-08-20-ExceptionFail.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-08-20-ExceptionFail.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-08-20-ExceptionFail.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null void foo(); Modified: llvm/trunk/test/FrontendC++/2003-08-21-EmptyClass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-08-21-EmptyClass.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-08-21-EmptyClass.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-08-21-EmptyClass.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null // This tests compilation of EMPTY_CLASS_EXPR's Modified: llvm/trunk/test/FrontendC++/2003-08-27-TypeNamespaces.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-08-27-TypeNamespaces.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-08-27-TypeNamespaces.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-08-27-TypeNamespaces.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null namespace foo { Modified: llvm/trunk/test/FrontendC++/2003-08-28-ForwardType.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-08-28-ForwardType.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-08-28-ForwardType.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-08-28-ForwardType.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null // Default placement versions of operator new. #include Modified: llvm/trunk/test/FrontendC++/2003-08-28-SaveExprBug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-08-28-SaveExprBug.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-08-28-SaveExprBug.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-08-28-SaveExprBug.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null char* eback(); Modified: llvm/trunk/test/FrontendC++/2003-08-31-StructLayout.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-08-31-StructLayout.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-08-31-StructLayout.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-08-31-StructLayout.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null // There is a HOLE in the derived2 object due to not wanting to place the two // baseclass instances at the same offset! Modified: llvm/trunk/test/FrontendC++/2003-09-22-CompositeExprValue.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-09-22-CompositeExprValue.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-09-22-CompositeExprValue.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-09-22-CompositeExprValue.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct duration { duration operator/=(int c) { Modified: llvm/trunk/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-09-29-ArgumentNumberMismatch.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null // Non-POD classes cannot be passed into a function by component, because their // dtors must be run. Instead, pass them in by reference. The C++ front-end Modified: llvm/trunk/test/FrontendC++/2003-09-30-CommaExprBug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-09-30-CommaExprBug.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-09-30-CommaExprBug.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-09-30-CommaExprBug.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null class Empty {}; Modified: llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-09-30-ForIncrementExprBug.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct C {}; Modified: llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-09-30-ForIncrementExprBug2.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null // Test with an opaque type Modified: llvm/trunk/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-09-30-NestedFunctionDecl.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null // The C++ front-end thinks the two foo's are different, the LLVM emitter // thinks they are the same. The disconnect causes problems. Modified: llvm/trunk/test/FrontendC++/2003-10-17-BoolBitfields.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-10-17-BoolBitfields.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-10-17-BoolBitfields.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-10-17-BoolBitfields.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct test { bool A : 1; Modified: llvm/trunk/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-10-27-VirtualBaseClassCrash.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null template Modified: llvm/trunk/test/FrontendC++/2003-11-04-ArrayConstructors.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-11-04-ArrayConstructors.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-11-04-ArrayConstructors.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-11-04-ArrayConstructors.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct Foo { Modified: llvm/trunk/test/FrontendC++/2003-11-04-CatchLabelName.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-11-04-CatchLabelName.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-11-04-CatchLabelName.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-11-04-CatchLabelName.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null #include Modified: llvm/trunk/test/FrontendC++/2003-11-18-EnumArray.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-11-18-EnumArray.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-11-18-EnumArray.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-11-18-EnumArray.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null enum TchkType { tchkNum, tchkString, tchkSCN, tchkNone Modified: llvm/trunk/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-11-18-PtrMemConstantInitializer.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct Gfx { void opMoveSetShowText(); Modified: llvm/trunk/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-11-25-ReturningOpaqueByValue.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null #include std::vector my_method (); Modified: llvm/trunk/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-11-27-MultipleInheritanceThunk.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct CallSite { Modified: llvm/trunk/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-11-29-DuplicatedCleanupTest.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null void doesntThrow() throw(); Modified: llvm/trunk/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2003-12-08-ArrayOfPtrToMemberFunc.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp (original) +++ llvm/trunk/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct Evil { void fun (); Modified: llvm/trunk/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2004-03-08-ReinterpretCastCopy.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp (original) +++ llvm/trunk/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct A { virtual void Method() = 0; Modified: llvm/trunk/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2004-03-15-CleanupsAndGotos.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp (original) +++ llvm/trunk/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null // Testcase from Bug 291 Modified: llvm/trunk/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2004-06-08-LateTemplateInstantiation.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp (original) +++ llvm/trunk/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null Modified: llvm/trunk/test/FrontendC++/2004-09-27-CompilerCrash.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2004-09-27-CompilerCrash.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2004-09-27-CompilerCrash.cpp (original) +++ llvm/trunk/test/FrontendC++/2004-09-27-CompilerCrash.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null struct Pass {} ; template Modified: llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2006-11-06-StackTrace.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp (original) +++ llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ // This is a regression test on debug info to make sure that we can get a // meaningful stack trace from a C++ program. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \ -// RUN: llc --disable-fp-elim -o %t.s -f -O0 -relocation-model=pic +// RUN: llc --disable-fp-elim -o %t.s -O0 -relocation-model=pic // RUN: %compile_c %t.s -o %t.o // RUN: %link %t.o -o %t.exe // RUN: echo {break DeepStack::deepest\nrun 17\nwhere\n} > %t.in Modified: llvm/trunk/test/FrontendC++/2006-11-30-NoCompileUnit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2006-11-30-NoCompileUnit.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2006-11-30-NoCompileUnit.cpp (original) +++ llvm/trunk/test/FrontendC++/2006-11-30-NoCompileUnit.cpp Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ // This is a regression test on debug info to make sure we don't hit a compile // unit size issue with gdb. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \ -// RUN: llc --disable-fp-elim -o NoCompileUnit.s -f +// RUN: llc --disable-fp-elim -o NoCompileUnit.s // RUN: %compile_c NoCompileUnit.s -o NoCompileUnit.o // RUN: %link NoCompileUnit.o -o NoCompileUnit.exe // RUN: echo {break main\nrun\np NoCompileUnit::pubname} > %t2 Modified: llvm/trunk/test/FrontendC++/2006-11-30-Pubnames.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2006-11-30-Pubnames.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2006-11-30-Pubnames.cpp (original) +++ llvm/trunk/test/FrontendC++/2006-11-30-Pubnames.cpp Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ // This is a regression test on debug info to make sure that we can access // qualified global names. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \ -// RUN: llc --disable-fp-elim -o %t.s -f -O0 +// RUN: llc --disable-fp-elim -o %t.s -O0 // RUN: %compile_c %t.s -o %t.o // RUN: %link %t.o -o %t.exe // RUN: %llvmdsymutil %t.exe Modified: llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2007-04-05-PackedBitFields-1.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp (original) +++ llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null #ifdef PACKED #define P __attribute__((packed)) Modified: llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2007-04-05-PackedBitFieldsOverlap-2.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp (original) +++ llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null #ifdef PACKED #define P __attribute__((packed)) Modified: llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2007-04-05-PackedBitFieldsOverlap.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp (original) +++ llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null #ifdef PACKED Modified: llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2007-04-05-PackedBitFieldsSmall.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp (original) +++ llvm/trunk/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null #ifdef PACKED Modified: llvm/trunk/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2007-04-05-StructPackedFieldUnpacked.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp (original) +++ llvm/trunk/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null #ifdef PACKED #define P __attribute__((packed)) Modified: llvm/trunk/test/FrontendC++/2009-04-21-DtorNames-dbg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-04-21-DtorNames-dbg.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2009-04-21-DtorNames-dbg.cpp (original) +++ llvm/trunk/test/FrontendC++/2009-04-21-DtorNames-dbg.cpp Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -c -g %s -o - | llc -O0 -f -o %t.s +// RUN: %llvmgcc -c -g %s -o - | llc -O0 -o %t.s // RUN: %compile_c %t.s -o %t.o // PR4025 Modified: llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-07-15-LineNumbers.cpp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp (original) +++ llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ // This is a regression test on debug info to make sure that we can // print line numbers in asm. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \ -// RUN: llc --disable-fp-elim -f -O0 -relocation-model=pic | grep {# SrcLine 25} +// RUN: llc --disable-fp-elim -O0 -relocation-model=pic | grep {# SrcLine 25} // XFAIL: * #include Modified: llvm/trunk/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c (original) +++ llvm/trunk/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* Regression test. Just compile .c -> .ll to test */ int foo(void) { Modified: llvm/trunk/test/FrontendC/2002-01-24-ComplexSpaceInType.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-01-24-ComplexSpaceInType.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-01-24-ComplexSpaceInType.c (original) +++ llvm/trunk/test/FrontendC/2002-01-24-ComplexSpaceInType.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null // This caused generation of the following type name: // %Array = uninitialized global [10 x %complex int] Modified: llvm/trunk/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c (original) +++ llvm/trunk/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void *dlclose(void*); Modified: llvm/trunk/test/FrontendC/2002-02-13-ConditionalInCall.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-13-ConditionalInCall.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-13-ConditionalInCall.c (original) +++ llvm/trunk/test/FrontendC/2002-02-13-ConditionalInCall.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* Test problem where bad code was generated with a ?: statement was in a function call argument */ Modified: llvm/trunk/test/FrontendC/2002-02-13-ReloadProblem.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-13-ReloadProblem.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-13-ReloadProblem.c (original) +++ llvm/trunk/test/FrontendC/2002-02-13-ReloadProblem.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* This triggered a problem in reload, fixed by disabling most of the * steps of compilation in GCC. Before this change, the code went through Modified: llvm/trunk/test/FrontendC/2002-02-13-TypeVarNameCollision.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-13-TypeVarNameCollision.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-13-TypeVarNameCollision.c (original) +++ llvm/trunk/test/FrontendC/2002-02-13-TypeVarNameCollision.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* This testcase causes a symbol table collision. Type names and variable * names should be in distinct namespaces Modified: llvm/trunk/test/FrontendC/2002-02-13-UnnamedLocal.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-13-UnnamedLocal.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-13-UnnamedLocal.c (original) +++ llvm/trunk/test/FrontendC/2002-02-13-UnnamedLocal.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* Testcase for a problem where GCC allocated xqic to a register, * and did not have a VAR_DECL that explained the stack slot to LLVM. Modified: llvm/trunk/test/FrontendC/2002-02-14-EntryNodePreds.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-14-EntryNodePreds.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-14-EntryNodePreds.c (original) +++ llvm/trunk/test/FrontendC/2002-02-14-EntryNodePreds.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* GCC Used to generate code that contained a branch to the entry node of * the do_merge function. This is illegal LLVM code. To fix this, GCC now Modified: llvm/trunk/test/FrontendC/2002-02-16-RenamingTest.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-16-RenamingTest.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-16-RenamingTest.c (original) +++ llvm/trunk/test/FrontendC/2002-02-16-RenamingTest.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* test that locals are renamed with . notation */ Modified: llvm/trunk/test/FrontendC/2002-02-17-ArgumentAddress.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-17-ArgumentAddress.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-17-ArgumentAddress.c (original) +++ llvm/trunk/test/FrontendC/2002-02-17-ArgumentAddress.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int test(int X) { return X; Modified: llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c (original) +++ llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* GCC wasn't handling 64 bit constants right fixed */ Modified: llvm/trunk/test/FrontendC/2002-02-18-StaticData.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-18-StaticData.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-02-18-StaticData.c (original) +++ llvm/trunk/test/FrontendC/2002-02-18-StaticData.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null double FOO = 17; Modified: llvm/trunk/test/FrontendC/2002-03-11-LargeCharInString.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-03-11-LargeCharInString.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-03-11-LargeCharInString.c (original) +++ llvm/trunk/test/FrontendC/2002-03-11-LargeCharInString.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include Modified: llvm/trunk/test/FrontendC/2002-03-12-ArrayInitialization.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-03-12-ArrayInitialization.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-03-12-ArrayInitialization.c (original) +++ llvm/trunk/test/FrontendC/2002-03-12-ArrayInitialization.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* GCC would generate bad code if not enough initializers are specified for an array. Modified: llvm/trunk/test/FrontendC/2002-03-12-StructInitialize.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-03-12-StructInitialize.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-03-12-StructInitialize.c (original) +++ llvm/trunk/test/FrontendC/2002-03-12-StructInitialize.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct Connection_Type { Modified: llvm/trunk/test/FrontendC/2002-03-12-StructInitializer.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-03-12-StructInitializer.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-03-12-StructInitializer.c (original) +++ llvm/trunk/test/FrontendC/2002-03-12-StructInitializer.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* GCC was not emitting string constants of the correct length when * embedded into a structure field like this. It thought the strlength Modified: llvm/trunk/test/FrontendC/2002-03-14-BrokenPHINode.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-03-14-BrokenPHINode.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-03-14-BrokenPHINode.c (original) +++ llvm/trunk/test/FrontendC/2002-03-14-BrokenPHINode.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* GCC was generating PHI nodes with an arity < #pred of the basic block the * PHI node lived in. This was breaking LLVM because the number of entries Modified: llvm/trunk/test/FrontendC/2002-03-14-BrokenSSA.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-03-14-BrokenSSA.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-03-14-BrokenSSA.c (original) +++ llvm/trunk/test/FrontendC/2002-03-14-BrokenSSA.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* This code used to break GCC's SSA computation code. It would create uses of B & C that are not dominated by their definitions. See: Modified: llvm/trunk/test/FrontendC/2002-03-14-QuotesInStrConst.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-03-14-QuotesInStrConst.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-03-14-QuotesInStrConst.c (original) +++ llvm/trunk/test/FrontendC/2002-03-14-QuotesInStrConst.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* GCC was not escaping quotes in string constants correctly, so this would * get emitted: Modified: llvm/trunk/test/FrontendC/2002-04-07-SwitchStmt.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-04-07-SwitchStmt.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-04-07-SwitchStmt.c (original) +++ llvm/trunk/test/FrontendC/2002-04-07-SwitchStmt.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int printf(const char *, ...); int foo(); Modified: llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c (original) +++ llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* GCC is not outputting the static array to the LLVM backend, so bad things * happen. Note that if this is defined static, everything seems fine. Modified: llvm/trunk/test/FrontendC/2002-04-09-StructRetVal.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-04-09-StructRetVal.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-04-09-StructRetVal.c (original) +++ llvm/trunk/test/FrontendC/2002-04-09-StructRetVal.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct S { int i; Modified: llvm/trunk/test/FrontendC/2002-04-10-StructParameters.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-04-10-StructParameters.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-04-10-StructParameters.c (original) +++ llvm/trunk/test/FrontendC/2002-04-10-StructParameters.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { Modified: llvm/trunk/test/FrontendC/2002-05-23-StaticValues.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-05-23-StaticValues.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-05-23-StaticValues.c (original) +++ llvm/trunk/test/FrontendC/2002-05-23-StaticValues.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* Make sure the frontend is correctly marking static stuff as internal! */ Modified: llvm/trunk/test/FrontendC/2002-05-23-TypeNameCollision.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-05-23-TypeNameCollision.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-05-23-TypeNameCollision.c (original) +++ llvm/trunk/test/FrontendC/2002-05-23-TypeNameCollision.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* Testcase for when struct tag conflicts with typedef name... grr */ Modified: llvm/trunk/test/FrontendC/2002-05-24-Alloca.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-05-24-Alloca.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-05-24-Alloca.c (original) +++ llvm/trunk/test/FrontendC/2002-05-24-Alloca.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include #include Modified: llvm/trunk/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c (original) +++ llvm/trunk/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include Modified: llvm/trunk/test/FrontendC/2002-07-14-MiscListTests.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-14-MiscListTests.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-14-MiscListTests.c (original) +++ llvm/trunk/test/FrontendC/2002-07-14-MiscListTests.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null // Test list stuff Modified: llvm/trunk/test/FrontendC/2002-07-14-MiscTests.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-14-MiscTests.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-14-MiscTests.c (original) +++ llvm/trunk/test/FrontendC/2002-07-14-MiscTests.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null /* These are random tests that I used when working on the GCC frontend originally. */ Modified: llvm/trunk/test/FrontendC/2002-07-14-MiscTests2.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-14-MiscTests2.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-14-MiscTests2.c (original) +++ llvm/trunk/test/FrontendC/2002-07-14-MiscTests2.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null // Test ?: in function calls Modified: llvm/trunk/test/FrontendC/2002-07-14-MiscTests3.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-14-MiscTests3.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-14-MiscTests3.c (original) +++ llvm/trunk/test/FrontendC/2002-07-14-MiscTests3.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null Modified: llvm/trunk/test/FrontendC/2002-07-16-HardStringInit.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-16-HardStringInit.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-16-HardStringInit.c (original) +++ llvm/trunk/test/FrontendC/2002-07-16-HardStringInit.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null char auto_kibitz_list[100][20] = { {"diepx"}, Modified: llvm/trunk/test/FrontendC/2002-07-17-StringConstant.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-17-StringConstant.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-17-StringConstant.c (original) +++ llvm/trunk/test/FrontendC/2002-07-17-StringConstant.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null char * foo() { return "\\begin{"; } Modified: llvm/trunk/test/FrontendC/2002-07-29-Casts.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-29-Casts.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-29-Casts.c (original) +++ llvm/trunk/test/FrontendC/2002-07-29-Casts.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include #include Modified: llvm/trunk/test/FrontendC/2002-07-30-SubregSetAssertion.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-30-SubregSetAssertion.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-30-SubregSetAssertion.c (original) +++ llvm/trunk/test/FrontendC/2002-07-30-SubregSetAssertion.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null union X { Modified: llvm/trunk/test/FrontendC/2002-07-30-UnionTest.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-30-UnionTest.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-30-UnionTest.c (original) +++ llvm/trunk/test/FrontendC/2002-07-30-UnionTest.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null union X; struct Empty {}; Modified: llvm/trunk/test/FrontendC/2002-07-30-VarArgsCallFailure.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-30-VarArgsCallFailure.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-30-VarArgsCallFailure.c (original) +++ llvm/trunk/test/FrontendC/2002-07-30-VarArgsCallFailure.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int tcount; void test(char *, const char*, int); Modified: llvm/trunk/test/FrontendC/2002-07-31-BadAssert.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-31-BadAssert.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-31-BadAssert.c (original) +++ llvm/trunk/test/FrontendC/2002-07-31-BadAssert.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { Modified: llvm/trunk/test/FrontendC/2002-07-31-SubregFailure.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-07-31-SubregFailure.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-07-31-SubregFailure.c (original) +++ llvm/trunk/test/FrontendC/2002-07-31-SubregFailure.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef union { Modified: llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c (original) +++ llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* In this testcase, the return value of foo() is being promotedto a register * which breaks stuff Modified: llvm/trunk/test/FrontendC/2002-08-19-RecursiveLocals.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-08-19-RecursiveLocals.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-08-19-RecursiveLocals.c (original) +++ llvm/trunk/test/FrontendC/2002-08-19-RecursiveLocals.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* This testcase doesn't actually test a bug, it's just the result of me * figuring out the syntax for forward declaring a static variable. */ Modified: llvm/trunk/test/FrontendC/2002-09-08-PointerShifts.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-09-08-PointerShifts.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-09-08-PointerShifts.c (original) +++ llvm/trunk/test/FrontendC/2002-09-08-PointerShifts.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int foo(int *A, unsigned X) { Modified: llvm/trunk/test/FrontendC/2002-09-18-UnionProblem.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-09-18-UnionProblem.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-09-18-UnionProblem.c (original) +++ llvm/trunk/test/FrontendC/2002-09-18-UnionProblem.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct DWstruct { Modified: llvm/trunk/test/FrontendC/2002-09-19-StarInLabel.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-09-19-StarInLabel.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-09-19-StarInLabel.c (original) +++ llvm/trunk/test/FrontendC/2002-09-19-StarInLabel.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null extern void start() __asm__("start"); extern void _start() __asm__("_start"); Modified: llvm/trunk/test/FrontendC/2002-10-12-TooManyArguments.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-10-12-TooManyArguments.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-10-12-TooManyArguments.c (original) +++ llvm/trunk/test/FrontendC/2002-10-12-TooManyArguments.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void foo() {} Modified: llvm/trunk/test/FrontendC/2002-12-15-GlobalBoolTest.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-12-15-GlobalBoolTest.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-12-15-GlobalBoolTest.c (original) +++ llvm/trunk/test/FrontendC/2002-12-15-GlobalBoolTest.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null _Bool X = 0; Modified: llvm/trunk/test/FrontendC/2002-12-15-GlobalConstantTest.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-12-15-GlobalConstantTest.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-12-15-GlobalConstantTest.c (original) +++ llvm/trunk/test/FrontendC/2002-12-15-GlobalConstantTest.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null const char *W = "foo"; Modified: llvm/trunk/test/FrontendC/2002-12-15-GlobalRedefinition.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-12-15-GlobalRedefinition.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-12-15-GlobalRedefinition.c (original) +++ llvm/trunk/test/FrontendC/2002-12-15-GlobalRedefinition.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null extern char algbrfile[9]; char algbrfile[9] = "abcdefgh"; Modified: llvm/trunk/test/FrontendC/2002-12-15-StructParameters.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-12-15-StructParameters.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2002-12-15-StructParameters.c (original) +++ llvm/trunk/test/FrontendC/2002-12-15-StructParameters.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { Modified: llvm/trunk/test/FrontendC/2003-03-03-DeferredType.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-03-03-DeferredType.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-03-03-DeferredType.c (original) +++ llvm/trunk/test/FrontendC/2003-03-03-DeferredType.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null Modified: llvm/trunk/test/FrontendC/2003-06-22-UnionCrash.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-06-22-UnionCrash.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-06-22-UnionCrash.c (original) +++ llvm/trunk/test/FrontendC/2003-06-22-UnionCrash.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct Blend_Map_Entry { union { Modified: llvm/trunk/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c (original) +++ llvm/trunk/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null double Test(double A, double B, double C, double D) { return -(A-B) - (C-D); Modified: llvm/trunk/test/FrontendC/2003-06-26-CFECrash.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-06-26-CFECrash.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-06-26-CFECrash.c (original) +++ llvm/trunk/test/FrontendC/2003-06-26-CFECrash.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct min_info { long offset; Modified: llvm/trunk/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c (original) +++ llvm/trunk/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null /* This is apparently legal C. */ Modified: llvm/trunk/test/FrontendC/2003-08-18-SigSetJmp.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-18-SigSetJmp.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-18-SigSetJmp.c (original) +++ llvm/trunk/test/FrontendC/2003-08-18-SigSetJmp.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include Modified: llvm/trunk/test/FrontendC/2003-08-18-StructAsValue.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-18-StructAsValue.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-18-StructAsValue.c (original) +++ llvm/trunk/test/FrontendC/2003-08-18-StructAsValue.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { Modified: llvm/trunk/test/FrontendC/2003-08-20-BadBitfieldRef.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-20-BadBitfieldRef.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-20-BadBitfieldRef.c (original) +++ llvm/trunk/test/FrontendC/2003-08-20-BadBitfieldRef.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void foo() { Modified: llvm/trunk/test/FrontendC/2003-08-20-PrototypeMismatch.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-20-PrototypeMismatch.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-20-PrototypeMismatch.c (original) +++ llvm/trunk/test/FrontendC/2003-08-20-PrototypeMismatch.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null Modified: llvm/trunk/test/FrontendC/2003-08-20-vfork-bug.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-20-vfork-bug.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-20-vfork-bug.c (original) +++ llvm/trunk/test/FrontendC/2003-08-20-vfork-bug.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null extern int vfork(void); test() { Modified: llvm/trunk/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c (original) +++ llvm/trunk/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct bar; Modified: llvm/trunk/test/FrontendC/2003-08-21-StmtExpr.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-21-StmtExpr.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-21-StmtExpr.c (original) +++ llvm/trunk/test/FrontendC/2003-08-21-StmtExpr.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { Modified: llvm/trunk/test/FrontendC/2003-08-21-WideString.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-21-WideString.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-21-WideString.c (original) +++ llvm/trunk/test/FrontendC/2003-08-21-WideString.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include Modified: llvm/trunk/test/FrontendC/2003-08-23-LocalUnionTest.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-23-LocalUnionTest.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-23-LocalUnionTest.c (original) +++ llvm/trunk/test/FrontendC/2003-08-23-LocalUnionTest.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null Modified: llvm/trunk/test/FrontendC/2003-08-29-BitFieldStruct.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-29-BitFieldStruct.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-29-BitFieldStruct.c (original) +++ llvm/trunk/test/FrontendC/2003-08-29-BitFieldStruct.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct Word { short bar; Modified: llvm/trunk/test/FrontendC/2003-08-29-HugeCharConst.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-29-HugeCharConst.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-29-HugeCharConst.c (original) +++ llvm/trunk/test/FrontendC/2003-08-29-HugeCharConst.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void foo() { unsigned char int_latin1[] = "f\200\372b\200\343\200\340"; Modified: llvm/trunk/test/FrontendC/2003-08-29-StructLayoutBug.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-29-StructLayoutBug.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-29-StructLayoutBug.c (original) +++ llvm/trunk/test/FrontendC/2003-08-29-StructLayoutBug.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct foo { unsigned int I:1; Modified: llvm/trunk/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c (original) +++ llvm/trunk/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct foo { unsigned int I:1; Modified: llvm/trunk/test/FrontendC/2003-09-18-BitfieldTests.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-09-18-BitfieldTests.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-09-18-BitfieldTests.c (original) +++ llvm/trunk/test/FrontendC/2003-09-18-BitfieldTests.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null typedef struct BF { Modified: llvm/trunk/test/FrontendC/2003-09-30-StructLayout.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-09-30-StructLayout.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-09-30-StructLayout.c (original) +++ llvm/trunk/test/FrontendC/2003-09-30-StructLayout.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null enum En { ENUM_VAL Modified: llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c (original) +++ llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include Modified: llvm/trunk/test/FrontendC/2003-10-06-NegateExprType.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-10-06-NegateExprType.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-10-06-NegateExprType.c (original) +++ llvm/trunk/test/FrontendC/2003-10-06-NegateExprType.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null extern int A[10]; Modified: llvm/trunk/test/FrontendC/2003-10-09-UnionInitializerBug.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-10-09-UnionInitializerBug.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-10-09-UnionInitializerBug.c (original) +++ llvm/trunk/test/FrontendC/2003-10-09-UnionInitializerBug.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct Foo { unsigned a; Modified: llvm/trunk/test/FrontendC/2003-10-28-ident.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-10-28-ident.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-10-28-ident.c (original) +++ llvm/trunk/test/FrontendC/2003-10-28-ident.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #ident "foo" Modified: llvm/trunk/test/FrontendC/2003-10-29-AsmRename.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-10-29-AsmRename.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-10-29-AsmRename.c (original) +++ llvm/trunk/test/FrontendC/2003-10-29-AsmRename.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct foo { int X; }; Modified: llvm/trunk/test/FrontendC/2003-11-01-C99-CompoundLiteral.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-01-C99-CompoundLiteral.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-01-C99-CompoundLiteral.c (original) +++ llvm/trunk/test/FrontendC/2003-11-01-C99-CompoundLiteral.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { int foo; } spinlock_t; typedef struct wait_queue_head_t { spinlock_t lock; } wait_queue_head_t; Modified: llvm/trunk/test/FrontendC/2003-11-01-EmptyStructCrash.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-01-EmptyStructCrash.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-01-EmptyStructCrash.c (original) +++ llvm/trunk/test/FrontendC/2003-11-01-EmptyStructCrash.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { } the_coolest_struct_in_the_world; extern the_coolest_struct_in_the_world xyzzy; Modified: llvm/trunk/test/FrontendC/2003-11-01-GlobalUnionInit.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-01-GlobalUnionInit.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-01-GlobalUnionInit.c (original) +++ llvm/trunk/test/FrontendC/2003-11-01-GlobalUnionInit.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null union bdflush_param { struct { int x; } b_un; Modified: llvm/trunk/test/FrontendC/2003-11-04-EmptyStruct.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-04-EmptyStruct.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-04-EmptyStruct.c (original) +++ llvm/trunk/test/FrontendC/2003-11-04-EmptyStruct.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { } rwlock_t; struct fs_struct { rwlock_t lock; int umask; }; Modified: llvm/trunk/test/FrontendC/2003-11-04-OutOfMemory.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-04-OutOfMemory.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-04-OutOfMemory.c (original) +++ llvm/trunk/test/FrontendC/2003-11-04-OutOfMemory.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void schedule_timeout(signed long timeout) { Modified: llvm/trunk/test/FrontendC/2003-11-12-VoidString.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-12-VoidString.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-12-VoidString.c (original) +++ llvm/trunk/test/FrontendC/2003-11-12-VoidString.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void query_newnamebuf(void) { ((void)"query_newnamebuf"); } Modified: llvm/trunk/test/FrontendC/2003-11-16-StaticArrayInit.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-16-StaticArrayInit.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-16-StaticArrayInit.c (original) +++ llvm/trunk/test/FrontendC/2003-11-16-StaticArrayInit.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void bar () { static char x[10]; Modified: llvm/trunk/test/FrontendC/2003-11-18-CondExprLValue.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-18-CondExprLValue.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-18-CondExprLValue.c (original) +++ llvm/trunk/test/FrontendC/2003-11-18-CondExprLValue.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null typedef struct { unsigned long pgprot; } pgprot_t; Modified: llvm/trunk/test/FrontendC/2003-11-19-BitFieldArray.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-19-BitFieldArray.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-19-BitFieldArray.c (original) +++ llvm/trunk/test/FrontendC/2003-11-19-BitFieldArray.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct _GIOChannel { int write_buf; Modified: llvm/trunk/test/FrontendC/2003-11-20-Bitfields.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-20-Bitfields.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-20-Bitfields.c (original) +++ llvm/trunk/test/FrontendC/2003-11-20-Bitfields.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct face_cachel { unsigned int reverse :1; Modified: llvm/trunk/test/FrontendC/2003-11-20-ComplexDivision.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-20-ComplexDivision.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-20-ComplexDivision.c (original) +++ llvm/trunk/test/FrontendC/2003-11-20-ComplexDivision.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int test() { __complex__ double C; Modified: llvm/trunk/test/FrontendC/2003-11-20-UnionBitfield.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-20-UnionBitfield.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-20-UnionBitfield.c (original) +++ llvm/trunk/test/FrontendC/2003-11-20-UnionBitfield.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct printf_spec { unsigned int minus_flag:1; Modified: llvm/trunk/test/FrontendC/2003-11-26-PointerShift.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-26-PointerShift.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-26-PointerShift.c (original) +++ llvm/trunk/test/FrontendC/2003-11-26-PointerShift.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null unsigned long do_csum(const unsigned char *buff, int len, unsigned long result) { if (2 & (unsigned long) buff) result += 1; Modified: llvm/trunk/test/FrontendC/2003-11-27-ConstructorCast.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-27-ConstructorCast.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-27-ConstructorCast.c (original) +++ llvm/trunk/test/FrontendC/2003-11-27-ConstructorCast.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct i387_soft_struct { long cwd; Modified: llvm/trunk/test/FrontendC/2003-11-27-UnionCtorInitialization.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-11-27-UnionCtorInitialization.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2003-11-27-UnionCtorInitialization.c (original) +++ llvm/trunk/test/FrontendC/2003-11-27-UnionCtorInitialization.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct i387_soft_struct { long cwd; Modified: llvm/trunk/test/FrontendC/2004-01-08-ExternInlineRedefine.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-01-08-ExternInlineRedefine.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-01-08-ExternInlineRedefine.c (original) +++ llvm/trunk/test/FrontendC/2004-01-08-ExternInlineRedefine.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null extern __inline long int Modified: llvm/trunk/test/FrontendC/2004-03-07-ComplexDivEquals.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-03-07-ComplexDivEquals.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-03-07-ComplexDivEquals.c (original) +++ llvm/trunk/test/FrontendC/2004-03-07-ComplexDivEquals.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null void test(__complex__ double D, double X) { Modified: llvm/trunk/test/FrontendC/2004-03-09-LargeArrayInitializers.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-03-09-LargeArrayInitializers.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-03-09-LargeArrayInitializers.c (original) +++ llvm/trunk/test/FrontendC/2004-03-09-LargeArrayInitializers.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null // Test that these initializers are handled efficiently Modified: llvm/trunk/test/FrontendC/2004-03-15-SimpleIndirectGoto.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-03-15-SimpleIndirectGoto.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-03-15-SimpleIndirectGoto.c (original) +++ llvm/trunk/test/FrontendC/2004-03-15-SimpleIndirectGoto.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int code[]={0,0,0,0,1}; void foo(int x) { Modified: llvm/trunk/test/FrontendC/2004-03-16-AsmRegisterCrash.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-03-16-AsmRegisterCrash.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-03-16-AsmRegisterCrash.c (original) +++ llvm/trunk/test/FrontendC/2004-03-16-AsmRegisterCrash.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int foo() { #ifdef __ppc__ Modified: llvm/trunk/test/FrontendC/2004-05-07-VarArrays.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-05-07-VarArrays.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-05-07-VarArrays.c (original) +++ llvm/trunk/test/FrontendC/2004-05-07-VarArrays.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null int foo(int len, char arr[][len], int X) { return arr[X][0]; Modified: llvm/trunk/test/FrontendC/2004-05-21-IncompleteEnum.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-05-21-IncompleteEnum.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-05-21-IncompleteEnum.c (original) +++ llvm/trunk/test/FrontendC/2004-05-21-IncompleteEnum.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null void test(enum foo *X) { } Modified: llvm/trunk/test/FrontendC/2004-06-08-OpaqueStructArg.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-06-08-OpaqueStructArg.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-06-08-OpaqueStructArg.c (original) +++ llvm/trunk/test/FrontendC/2004-06-08-OpaqueStructArg.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct fu; void foo(struct fu); Modified: llvm/trunk/test/FrontendC/2004-06-17-UnorderedBuiltins.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-06-17-UnorderedBuiltins.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-06-17-UnorderedBuiltins.c (original) +++ llvm/trunk/test/FrontendC/2004-06-17-UnorderedBuiltins.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null _Bool A, B, C, D, E, F, G, H; Modified: llvm/trunk/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c (original) +++ llvm/trunk/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null struct S { }; Modified: llvm/trunk/test/FrontendC/2004-07-06-FunctionCast.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-07-06-FunctionCast.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-07-06-FunctionCast.c (original) +++ llvm/trunk/test/FrontendC/2004-07-06-FunctionCast.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null static int unused_func(void) { return 1; Modified: llvm/trunk/test/FrontendC/2004-08-06-LargeStructTest.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-08-06-LargeStructTest.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2004-08-06-LargeStructTest.c (original) +++ llvm/trunk/test/FrontendC/2004-08-06-LargeStructTest.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #define A(X) int X; Modified: llvm/trunk/test/FrontendC/2005-09-20-ComplexConstants.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2005-09-20-ComplexConstants.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2005-09-20-ComplexConstants.c (original) +++ llvm/trunk/test/FrontendC/2005-09-20-ComplexConstants.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc %s -S -o - | llvm-as -o /dev/null -f +// RUN: %llvmgcc %s -S -o - | llvm-as -o /dev/null const double _Complex x[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; Modified: llvm/trunk/test/FrontendC/2009-02-17-BitField-dbg.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2009-02-17-BitField-dbg.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2009-02-17-BitField-dbg.c (original) +++ llvm/trunk/test/FrontendC/2009-02-17-BitField-dbg.c Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ // Check bitfields. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \ -// RUN: llc --disable-fp-elim -o 2009-02-17-BitField-dbg.s -f +// RUN: llc --disable-fp-elim -o 2009-02-17-BitField-dbg.s // RUN: %compile_c 2009-02-17-BitField-dbg.s -o 2009-02-17-BitField-dbg.o // RUN: echo {ptype mystruct} > %t2 // RUN: gdb -q -batch -n -x %t2 2009-02-17-BitField-dbg.o | \ Modified: llvm/trunk/test/FrontendC/2009-07-15-pad-wchar_t-array.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2009-07-15-pad-wchar_t-array.c?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2009-07-15-pad-wchar_t-array.c (original) +++ llvm/trunk/test/FrontendC/2009-07-15-pad-wchar_t-array.c Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null #include signed short _iodbcdm_sqlerror( ) Modified: llvm/trunk/test/FrontendObjC/2009-08-17-DebugInfo.m URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC/2009-08-17-DebugInfo.m?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/FrontendObjC/2009-08-17-DebugInfo.m (original) +++ llvm/trunk/test/FrontendObjC/2009-08-17-DebugInfo.m Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ // This is a regression test on debug info to make sure that we can set a // breakpoint on a objective message. -// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc -o %t.s -f -O0 +// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc -o %t.s -O0 // RUN: %compile_c %t.s -o %t.o // RUN: %link %t.o -o %t.exe -framework Foundation // RUN: echo {break randomFunc\n} > %t.in Modified: llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll (original) +++ llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll Tue Aug 25 10:38:29 2009 @@ -2,7 +2,7 @@ ; one... ; RUN: echo {define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc -; RUN: llvm-as %s -o %t.2.bc -f +; RUN: llvm-as %s -o %t.2.bc ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep @foo() | grep -v internal define i32 @foo() { ret i32 0 } Modified: llvm/trunk/test/Linker/2003-04-21-Linkage.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-04-21-Linkage.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-04-21-Linkage.ll (original) +++ llvm/trunk/test/Linker/2003-04-21-Linkage.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ ; RUN: echo {@X = linkonce global i32 5 \ ; RUN: define linkonce i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc -; RUN: llvm-as %s -o %t.2.bc -f +; RUN: llvm-as %s -o %t.2.bc ; RUN: llvm-link %t.1.bc %t.2.bc @X = external global i32 Modified: llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll (original) +++ llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll Tue Aug 25 10:38:29 2009 @@ -2,8 +2,8 @@ ; one... ; RUN: echo { define linkonce void @foo() \{ ret void \} } | \ -; RUN: llvm-as -o %t.2.bc -f -; RUN: llvm-as %s -o %t.1.bc -f +; RUN: llvm-as -o %t.2.bc +; RUN: llvm-as %s -o %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep foo | grep linkonce declare void @foo() Modified: llvm/trunk/test/Linker/2003-04-26-NullPtrLinkProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-04-26-NullPtrLinkProblem.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-04-26-NullPtrLinkProblem.ll (original) +++ llvm/trunk/test/Linker/2003-04-26-NullPtrLinkProblem.ll Tue Aug 25 10:38:29 2009 @@ -2,7 +2,7 @@ ; the same type to be created! ; RUN: echo {%T = type i32} | llvm-as > %t.2.bc -; RUN: llvm-as %s -f -o %t.1.bc +; RUN: llvm-as %s -o %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc %T = type opaque Modified: llvm/trunk/test/Linker/2004-02-17-WeakStrongLinkage.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2004-02-17-WeakStrongLinkage.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2004-02-17-WeakStrongLinkage.ll (original) +++ llvm/trunk/test/Linker/2004-02-17-WeakStrongLinkage.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s > %t.out2.bc ; RUN: echo "@me = global i32* null" | llvm-as > %t.out1.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc -o /dev/null -f +; RUN: llvm-link %t.out1.bc %t.out2.bc -o /dev/null @me = weak global i32* null ; [#uses=0] Modified: llvm/trunk/test/Linker/2004-05-07-TypeResolution1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2004-05-07-TypeResolution1.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2004-05-07-TypeResolution1.ll (original) +++ llvm/trunk/test/Linker/2004-05-07-TypeResolution1.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ -; RUN: llvm-as %s -f -o %t1.bc -; RUN: llvm-as < %p/2004-05-07-TypeResolution2.ll -o %t2.bc -f -; RUN: llvm-link -f -o %t3.bc %t1.bc %t2.bc +; RUN: llvm-as %s -o %t1.bc +; RUN: llvm-as < %p/2004-05-07-TypeResolution2.ll -o %t2.bc +; RUN: llvm-link -o %t3.bc %t1.bc %t2.bc target datalayout = "e-p:32:32" %myint = type opaque Modified: llvm/trunk/test/Linker/2006-01-19-ConstantPacked.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2006-01-19-ConstantPacked.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2006-01-19-ConstantPacked.ll (original) +++ llvm/trunk/test/Linker/2006-01-19-ConstantPacked.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as %s -f -o %t1.bc -; RUN: llvm-link -f -o %t2.bc %t1.bc +; RUN: llvm-as %s -o %t1.bc +; RUN: llvm-link -o %t2.bc %t1.bc target datalayout = "E-p:32:32" target triple = "powerpc-apple-darwin7.7.0" Modified: llvm/trunk/test/Linker/2008-03-05-AliasReference.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-03-05-AliasReference.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-03-05-AliasReference.ll (original) +++ llvm/trunk/test/Linker/2008-03-05-AliasReference.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ ; PR2054 -; RUN: llvm-as %s -o %t1.bc -f -; RUN: llvm-as %p/2008-03-05-AliasReference2.ll -o %t2.bc -f -; RUN: llvm-link %t2.bc %t1.bc -f -o %t3.bc +; RUN: llvm-as %s -o %t1.bc +; RUN: llvm-as %p/2008-03-05-AliasReference2.ll -o %t2.bc +; RUN: llvm-link %t2.bc %t1.bc -o %t3.bc ; ModuleID = 'bug.o' 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/Linker/2008-06-13-LinkOnceRedefinition.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll (original) +++ llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll Tue Aug 25 10:38:29 2009 @@ -1,8 +1,8 @@ ; Test linking two functions with different prototypes and two globals ; in different modules. -; RUN: llvm-as %s -o %t.foo1.bc -f -; RUN: llvm-as %s -o %t.foo2.bc -f -; RUN: echo {define linkonce void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc -f +; RUN: llvm-as %s -o %t.foo1.bc +; RUN: llvm-as %s -o %t.foo2.bc +; RUN: echo {define linkonce void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc ; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis ; RUN: llvm-link %t.foo1.bc %t.foo3.bc | llvm-dis define linkonce void @foo() { ret void } Modified: llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll (original) +++ llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ ; Test linking two functions with different prototypes and two globals ; in different modules. -; RUN: llvm-as %s -o %t.foo1.bc -f -; RUN: echo | llvm-as -o %t.foo2.bc -f +; RUN: llvm-as %s -o %t.foo1.bc +; RUN: echo | llvm-as -o %t.foo2.bc ; RUN: llvm-link %t.foo2.bc %t.foo1.bc | llvm-dis | grep {addrspace(2)} ; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis | grep {addrspace(2)} ; rdar://6038021 Modified: llvm/trunk/test/Linker/2008-07-06-AliasFnDecl.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-07-06-AliasFnDecl.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-07-06-AliasFnDecl.ll (original) +++ llvm/trunk/test/Linker/2008-07-06-AliasFnDecl.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ ; PR2146 -; RUN: llvm-as %s -o %t1.bc -f -; RUN: llvm-as %p/2008-07-06-AliasFnDecl2.ll -o %t2.bc -f -; RUN: llvm-link %t1.bc %t2.bc -f -o %t3.bc +; RUN: llvm-as %s -o %t1.bc +; RUN: llvm-as %p/2008-07-06-AliasFnDecl2.ll -o %t2.bc +; RUN: llvm-link %t1.bc %t2.bc -o %t3.bc @b = alias void ()* @a Modified: llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll (original) +++ llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll Tue Aug 25 10:38:29 2009 @@ -1,8 +1,8 @@ ; PR2463 -; RUN: llvm-as %s -o %t1.bc -f -; RUN: llvm-as %p/2008-07-06-AliasWeakDest2.ll -o %t2.bc -f -; RUN: llvm-link %t1.bc %t2.bc -f -o %t3.bc -; RUN: llvm-link %t2.bc %t1.bc -f -o %t4.bc +; RUN: llvm-as %s -o %t1.bc +; RUN: llvm-as %p/2008-07-06-AliasWeakDest2.ll -o %t2.bc +; RUN: llvm-link %t1.bc %t2.bc -o %t3.bc +; RUN: llvm-link %t2.bc %t1.bc -o %t4.bc 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" target triple = "i386-pc-linux-gnu" Modified: llvm/trunk/test/Linker/basiclink.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/basiclink.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/basiclink.ll (original) +++ llvm/trunk/test/Linker/basiclink.ll Tue Aug 25 10:38:29 2009 @@ -1,10 +1,10 @@ ; Test linking two functions with different prototypes and two globals ; in different modules. This is for PR411 -; RUN: llvm-as %s -o %t.bar.bc -f +; RUN: llvm-as %s -o %t.bar.bc ; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \ -; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f -; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc -f -; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc -f +; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc +; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc +; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc declare i32* @foo(...) define i32* @bar() { %ret = call i32* (...)* @foo( i32 123 ) Modified: llvm/trunk/test/Linker/link-archive.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-archive.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/link-archive.ll (original) +++ llvm/trunk/test/Linker/link-archive.ll Tue Aug 25 10:38:29 2009 @@ -1,8 +1,8 @@ ; Test linking of a bc file to an archive via llvm-ld. ; PR1434 -; RUN: llvm-as %s -o %t.bar.bc -f +; RUN: llvm-as %s -o %t.bar.bc ; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \ -; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f +; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc ; RUN: llvm-ar rcf %t.foo.a %t.foo.bc ; RUN: llvm-ar rcf %t.bar.a %t.bar.bc ; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc Modified: llvm/trunk/test/Linker/link-global-to-func.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-global-to-func.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/link-global-to-func.ll (original) +++ llvm/trunk/test/Linker/link-global-to-func.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as %s -o %t1.bc -f -; RUN: echo {declare void @__eprintf(i8*, i8*, i32, i8*) noreturn define void @foo() { tail call void @__eprintf( i8* undef, i8* undef, i32 4, i8* null ) noreturn nounwind unreachable }} | llvm-as -o %t2.bc -f +; RUN: llvm-as %s -o %t1.bc +; RUN: echo {declare void @__eprintf(i8*, i8*, i32, i8*) noreturn define void @foo() { tail call void @__eprintf( i8* undef, i8* undef, i32 4, i8* null ) noreturn nounwind unreachable }} | llvm-as -o %t2.bc ; RUN: llvm-link %t2.bc %t1.bc -o - | llvm-dis | grep __eprintf ; RUN: llvm-link %t1.bc %t2.bc -o - | llvm-dis | grep __eprintf Modified: llvm/trunk/test/Linker/link-messages.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-messages.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/link-messages.ll (original) +++ llvm/trunk/test/Linker/link-messages.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ ; Test that linking two files with the same definition causes an error and ; that error is printed out. -; RUN: llvm-as %s -o %t.one.bc -f -; RUN: llvm-as %s -o %t.two.bc -f +; RUN: llvm-as %s -o %t.one.bc +; RUN: llvm-as %s -o %t.two.bc ; RUN: not llvm-ld -disable-opt -link-as-library %t.one.bc %t.two.bc \ ; RUN: -o %t.bc 2>%t.err ; RUN: grep "symbol multiply defined" %t.err Modified: llvm/trunk/test/Linker/redefinition.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/redefinition.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/redefinition.ll (original) +++ llvm/trunk/test/Linker/redefinition.ll Tue Aug 25 10:38:29 2009 @@ -1,8 +1,8 @@ ; Test linking two functions with different prototypes and two globals ; in different modules. -; RUN: llvm-as %s -o %t.foo1.bc -f -; RUN: llvm-as %s -o %t.foo2.bc -f -; RUN: echo {define void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc -f +; RUN: llvm-as %s -o %t.foo1.bc +; RUN: llvm-as %s -o %t.foo2.bc +; RUN: echo {define void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc ; RUN: not llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc |& \ ; RUN: grep {symbol multiply defined} ; RUN: not llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc |& \ Modified: llvm/trunk/test/Linker/weakextern.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/weakextern.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Linker/weakextern.ll (original) +++ llvm/trunk/test/Linker/weakextern.ll Tue Aug 25 10:38:29 2009 @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s > %t.bc ; RUN: llvm-as < %p/testlink1.ll > %t2.bc -; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc -f +; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc ; RUN: llvm-dis < %t1.bc | grep {kallsyms_names = extern_weak} ; RUN: llvm-dis < %t1.bc | grep {MyVar = external global i32} ; RUN: llvm-dis < %t1.bc | grep {Inte = global i32} Modified: llvm/trunk/test/Makefile.tests URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile.tests?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Makefile.tests (original) +++ llvm/trunk/test/Makefile.tests Tue Aug 25 10:38:29 2009 @@ -69,7 +69,7 @@ # LLVM source, use the non-transforming assembler. # Output/%.bc: %.ll $(LLVMAS) Output/.dir - -$(LLVMAS) -f $< -o $@ + -$(LLVMAS) $< -o $@ ## Cancel built-in implicit rules that override above rules %: %.s Modified: llvm/trunk/test/Transforms/Inline/2007-06-06-NoInline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2007-06-06-NoInline.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Transforms/Inline/2007-06-06-NoInline.ll (original) +++ llvm/trunk/test/Transforms/Inline/2007-06-06-NoInline.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline -f - | llvm-dis | grep "define internal i32 @bar" +; RUN: llvm-as < %s | opt -inline - | llvm-dis | grep "define internal i32 @bar" @llvm.noinline = appending global [1 x i8*] [ i8* bitcast (i32 (i32, i32)* @bar to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] define internal i32 @bar(i32 %x, i32 %y) { Modified: llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll Tue Aug 25 10:38:29 2009 @@ -1,7 +1,7 @@ ; Test that this transform works: ; udiv X, (Select Cond, C1, C2) --> Select Cond, (shr X, C1), (shr X, C2) ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis -f -o %t +; RUN: llvm-as < %s | opt -instcombine | llvm-dis -o %t ; RUN: not grep select %t ; RUN: grep lshr %t | count 2 ; RUN: not grep udiv %t Modified: llvm/trunk/test/Transforms/TailDup/if-tail-dup.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/TailDup/if-tail-dup.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Transforms/TailDup/if-tail-dup.ll (original) +++ llvm/trunk/test/Transforms/TailDup/if-tail-dup.ll Tue Aug 25 10:38:29 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | opt -tailduplicate | \ -; RUN: llc -march=x86 -o %t -f +; RUN: llc -march=x86 -o %t ; RUN: grep {\\\} %t ; RUN: not grep jmp %t ; END. Modified: llvm/trunk/test/Verifier/2008-03-01-AllocaSized.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/2008-03-01-AllocaSized.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Verifier/2008-03-01-AllocaSized.ll (original) +++ llvm/trunk/test/Verifier/2008-03-01-AllocaSized.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: not llvm-as -f %s -o /dev/null |& grep {Cannot allocate unsized type} +; RUN: not llvm-as %s -o /dev/null |& grep {Cannot allocate unsized type} ; PR2113 define void @test() { Modified: llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll (original) +++ llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: not llvm-as -f %s -o /dev/null |& grep {alignment argument of memory intrinsics must be a constant int} +; RUN: not llvm-as %s -o /dev/null |& grep {alignment argument of memory intrinsics must be a constant int} ; PR2318 define void @x(i8* %a, i8* %src, i64 %len, i32 %align) nounwind { Modified: llvm/trunk/test/Verifier/SelfReferential.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/SelfReferential.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Verifier/SelfReferential.ll (original) +++ llvm/trunk/test/Verifier/SelfReferential.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: not llvm-as -f %s -o /dev/null |& grep {Only PHI nodes may reference their own value} +; RUN: not llvm-as %s -o /dev/null |& grep {Only PHI nodes may reference their own value} ; Test that self referential instructions are not allowed Modified: llvm/trunk/test/Verifier/aliasing-chain.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/aliasing-chain.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Verifier/aliasing-chain.ll (original) +++ llvm/trunk/test/Verifier/aliasing-chain.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: not llvm-as -f %s -o /dev/null |& grep {Aliasing chain should end with function or global variable} +; RUN: not llvm-as %s -o /dev/null |& grep {Aliasing chain should end with function or global variable} ; Test that alising chain does not create a cycle Modified: llvm/trunk/test/Verifier/byval-4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/byval-4.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Verifier/byval-4.ll (original) +++ llvm/trunk/test/Verifier/byval-4.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as %s -o /dev/null %struct.foo = type { i64 } declare void @h(%struct.foo* byval %num) Modified: llvm/trunk/test/Verifier/invoke-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/invoke-2.ll?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/Verifier/invoke-2.ll (original) +++ llvm/trunk/test/Verifier/invoke-2.ll Tue Aug 25 10:38:29 2009 @@ -1,4 +1,4 @@ -; RUN: not llvm-as %s -f |& grep {not verify as correct} +; RUN: not llvm-as %s |& grep {not verify as correct} ; PR1042 define i32 @foo() { Modified: llvm/trunk/test/lib/llvm2cpp.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lib/llvm2cpp.exp?rev=79992&r1=79991&r2=79992&view=diff ============================================================================== --- llvm/trunk/test/lib/llvm2cpp.exp (original) +++ llvm/trunk/test/lib/llvm2cpp.exp Tue Aug 25 10:38:29 2009 @@ -48,7 +48,7 @@ # Run llvm-as/llvm-dis set pipeline llvm-as|llvm-dis set retval [ catch { - exec -keepnewline $llvmas < $test -o - | $llvmdis -f -o $assembly 2>/dev/null } msg ] + exec -keepnewline $llvmas < $test -o - | $llvmdis-o $assembly 2>/dev/null } msg ] if { $retval != 0 } { fail "$test: $pipeline returned $retval\n$msg" @@ -65,7 +65,7 @@ } set retval [ catch { - exec -keepnewline $llc -march=cpp -f -o $generated < $bytecode 2>/dev/null } msg] + exec -keepnewline $llc -march=cpp-o $generated < $bytecode 2>/dev/null } msg] if { $retval != 0 } { fail "$test: llvm2cpp returned $retval\n$msg" From gohman at apple.com Tue Aug 25 10:39:26 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 15:39:26 -0000 Subject: [llvm-commits] [test-suite] r79993 - in /test-suite/trunk: Makefile.programs Makefile.rules Makefile.tests Message-ID: <200908251539.n7PFdQkL001812@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 10:39:26 2009 New Revision: 79993 URL: http://llvm.org/viewvc/llvm-project?rev=79993&view=rev Log: Remove obsolete -f flags. Modified: test-suite/trunk/Makefile.programs test-suite/trunk/Makefile.rules test-suite/trunk/Makefile.tests Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=79993&r1=79992&r2=79993&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Tue Aug 25 10:39:26 2009 @@ -262,16 +262,16 @@ $(PROGRAMS_TO_TEST:%=Output/%.linked.bc): \ Output/%.linked.bc: Output/%.linked.rbc $(LOPT) $(VERB) $(RM) -f $(CURDIR)/$@.info - -$(LOPT) -std-compile-opts -info-output-file=$(CURDIR)/$@.info $(STATS) $(EXTRA_LOPT_OPTIONS) $< -o $@ -f + -$(LOPT) -std-compile-opts -info-output-file=$(CURDIR)/$@.info $(STATS) $(EXTRA_LOPT_OPTIONS) $< -o $@ $(PROGRAMS_TO_TEST:%=Output/%.llvm.stripped.bc): \ Output/%.llvm.stripped.bc: Output/%.llvm.bc $(LOPT) - -$(LOPT) -mstrip $< -o $@ -f + -$(LOPT) -mstrip $< -o $@ $(PROGRAMS_TO_TEST:%=Output/%.linked.optbeta.bc): \ Output/%.linked.optbeta.bc: Output/%.linked.rbc $(LOPT) $(VERB) $(RM) -f $(CURDIR)/$@.info - -$(LOPT) $(OPTBETAOPTIONS) -info-output-file=$(CURDIR)/$@.info $(STATS) $< -o $@ -f + -$(LOPT) $(OPTBETAOPTIONS) -info-output-file=$(CURDIR)/$@.info $(STATS) $< -o $@ ifndef DISABLE_FOR_LLVM_PROGRAMS @@ -284,7 +284,7 @@ -$(LLVMLD) -info-output-file=$(CURDIR)/$@.info $(STATS) $< \ $(EXTRA_LINKTIME_OPT_FLAGS) $(LLVMLD_FLAGS) -lc $(LIBS) -o Output/$*.llvm ifneq ($(OPTPASSES),) - -$(LOPT) -q $(OPTPASSES) $@ -o $@.tmp -f + -$(LOPT) -q $(OPTPASSES) $@ -o $@.tmp $(MV) -f $@.tmp $@ endif @@ -293,7 +293,7 @@ -$(LLVMLD) -info-output-file=$(CURDIR)/$@.info $(STATS) $< \ $(EXTRA_LINKTIME_OPT_FLAGS) $(LLVMLD_FLAGS) -lc $(LIBS) -o Output/$*.llvm ifneq ($(OPTPASSES),) - -$(LOPT) -q $(OPTPASSES) $@ -o $@.tmp -f + -$(LOPT) -q $(OPTPASSES) $@ -o $@.tmp $(MV) -f $@.tmp $@ endif @@ -377,7 +377,7 @@ # $(PROGRAMS_TO_TEST:%=Output/%.cbe.c): \ Output/%.cbe.c: Output/%.llvm.bc $(LLC) - -$(LLC) $(LLCFLAGS) -march=c $< -o $@ -f + -$(LLC) $(LLCFLAGS) -march=c $< -o $@ $(PROGRAMS_TO_TEST:%=Output/%.cbe): \ Output/%.cbe: Output/%.cbe.c @@ -388,15 +388,15 @@ # $(PROGRAMS_TO_TEST:%=Output/%.llc.s): \ Output/%.llc.s: Output/%.llvm.bc $(LLC) - -$(LLC) $(LLCFLAGS) -f $< -o $@ + -$(LLC) $(LLCFLAGS) $< -o $@ $(PROGRAMS_TO_TEST:%=Output/%.llc-beta.s): \ Output/%.llc-beta.s: Output/%.llvm.bc $(LLC) - -$(LLC) $(LLCFLAGS) -f $(LLCBETAOPTION) $< -o $@ + -$(LLC) $(LLCFLAGS) $(LLCBETAOPTION) $< -o $@ $(PROGRAMS_TO_TEST:%=Output/%.opt-beta.s): \ Output/%.opt-beta.s: Output/%.llvm.optbeta.bc $(LLC) - -$(LLC) $(LLCFLAGS) -f $< -o $@ + -$(LLC) $(LLCFLAGS) $< -o $@ # On darwin, pass -force_cpusubtype_ALL to allow all ppc instructions. ifeq ($(ARCH),PowerPC) @@ -610,7 +610,7 @@ # $(PROGRAMS_TO_TEST:%=Output/%.llvm-prof.bc): \ Output/%.llvm-prof.bc: Output/%.llvm.bc - $(LOPT) -insert-edge-profiling $< -o $@ -f + $(LOPT) -insert-edge-profiling $< -o $@ $(PROGRAMS_TO_TEST:%=Output/%.printprof): \ Output/%.printprof: Output/%.llvm.bc Output/%.prof $(LPROF) Modified: test-suite/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.rules?rev=79993&r1=79992&r2=79993&view=diff ============================================================================== --- test-suite/trunk/Makefile.rules (original) +++ test-suite/trunk/Makefile.rules Tue Aug 25 10:39:26 2009 @@ -847,7 +847,7 @@ $(LLVMGCC) $(CPPFLAGS) -c $< -o $@ $(PROJ_OBJ_DIR)/BytecodeObj/%.bc: %.ll $(PROJ_OBJ_DIR)/BytecodeObj/.dir $(LLVMAS) - $(LLVMAS) $< -f -o $@ + $(LLVMAS) $< -o $@ # Modified: test-suite/trunk/Makefile.tests URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.tests?rev=79993&r1=79992&r2=79993&view=diff ============================================================================== --- test-suite/trunk/Makefile.tests (original) +++ test-suite/trunk/Makefile.tests Tue Aug 25 10:39:26 2009 @@ -65,7 +65,7 @@ # LLVM source, use the non-transforming assembler. # Output/%.bc: %.ll $(LLVMAS) Output/.dir - -$(LLVMAS) -f $< -o $@ + -$(LLVMAS) $< -o $@ ## Cancel built-in implicit rules that override above rules %: %.s From gohman at apple.com Tue Aug 25 10:45:45 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 15:45:45 -0000 Subject: [llvm-commits] [llvm] r79994 - /llvm/trunk/test/lib/llvm2cpp.exp Message-ID: <200908251545.n7PFjj2x002719@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 10:45:44 2009 New Revision: 79994 URL: http://llvm.org/viewvc/llvm-project?rev=79994&view=rev Log: Fix a few typos from the removal of -f. Modified: llvm/trunk/test/lib/llvm2cpp.exp Modified: llvm/trunk/test/lib/llvm2cpp.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lib/llvm2cpp.exp?rev=79994&r1=79993&r2=79994&view=diff ============================================================================== --- llvm/trunk/test/lib/llvm2cpp.exp (original) +++ llvm/trunk/test/lib/llvm2cpp.exp Tue Aug 25 10:45:44 2009 @@ -48,7 +48,7 @@ # Run llvm-as/llvm-dis set pipeline llvm-as|llvm-dis set retval [ catch { - exec -keepnewline $llvmas < $test -o - | $llvmdis-o $assembly 2>/dev/null } msg ] + exec -keepnewline $llvmas < $test -o - | $llvmdis -o $assembly 2>/dev/null } msg ] if { $retval != 0 } { fail "$test: $pipeline returned $retval\n$msg" @@ -65,7 +65,7 @@ } set retval [ catch { - exec -keepnewline $llc -march=cpp-o $generated < $bytecode 2>/dev/null } msg] + exec -keepnewline $llc -march=cpp -o $generated < $bytecode 2>/dev/null } msg] if { $retval != 0 } { fail "$test: llvm2cpp returned $retval\n$msg" From gohman at apple.com Tue Aug 25 10:54:01 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 15:54:01 -0000 Subject: [llvm-commits] [llvm] r79996 - in /llvm/trunk/docs: CodeGenerator.html CommandGuide/llc.pod CommandGuide/llvm-as.pod CommandGuide/llvm-dis.pod CommandGuide/llvm-extract.pod CommandGuide/llvm-link.pod CommandGuide/opt.pod CommandLine.html HowToSubmitABug.html Message-ID: <200908251554.n7PFs2QS003850@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 10:54:01 2009 New Revision: 79996 URL: http://llvm.org/viewvc/llvm-project?rev=79996&view=rev Log: Update documentation for the -f change. Modified: llvm/trunk/docs/CodeGenerator.html llvm/trunk/docs/CommandGuide/llc.pod llvm/trunk/docs/CommandGuide/llvm-as.pod llvm/trunk/docs/CommandGuide/llvm-dis.pod llvm/trunk/docs/CommandGuide/llvm-extract.pod llvm/trunk/docs/CommandGuide/llvm-link.pod llvm/trunk/docs/CommandGuide/opt.pod llvm/trunk/docs/CommandLine.html llvm/trunk/docs/HowToSubmitABug.html Modified: llvm/trunk/docs/CodeGenerator.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodeGenerator.html?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CodeGenerator.html (original) +++ llvm/trunk/docs/CodeGenerator.html Tue Aug 25 10:54:01 2009 @@ -1616,9 +1616,9 @@
-$ llc -f -regalloc=simple file.bc -o sp.s;
-$ llc -f -regalloc=local file.bc -o lc.s;
-$ llc -f -regalloc=linearscan file.bc -o ln.s;
+$ llc -regalloc=simple file.bc -o sp.s;
+$ llc -regalloc=local file.bc -o lc.s;
+$ llc -regalloc=linearscan file.bc -o ln.s;
 
Modified: llvm/trunk/docs/CommandGuide/llc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llc.pod?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llc.pod (original) +++ llvm/trunk/docs/CommandGuide/llc.pod Tue Aug 25 10:54:01 2009 @@ -49,8 +49,9 @@ =item B<-f> -Overwrite output files. By default, B will refuse to overwrite -an output file which already exists. +Enable binary output on terminals. Normally, B will refuse to +write raw bitcode output if the output stream is a terminal. With this option, +B will write raw bitcode regardless of the output device. =item B<-mtriple>=I Modified: llvm/trunk/docs/CommandGuide/llvm-as.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-as.pod?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-as.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-as.pod Tue Aug 25 10:54:01 2009 @@ -46,9 +46,9 @@ =item B<-f> -Force overwrite. Normally, B will refuse to overwrite an -output file that already exists. With this option, B -will overwrite the output file and replace it with new bitcode. +Enable binary output on terminals. Normally, B will refuse to +write raw bitcode output if the output stream is a terminal. With this option, +B will write raw bitcode regardless of the output device. =item B<--help> Modified: llvm/trunk/docs/CommandGuide/llvm-dis.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-dis.pod?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-dis.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-dis.pod Tue Aug 25 10:54:01 2009 @@ -29,9 +29,9 @@ =item B<-f> -Force overwrite. Normally, B will refuse to overwrite -an output file that already exists. With this option, B -will overwrite the output file. +Enable binary output on terminals. Normally, B will refuse to +write raw bitcode output if the output stream is a terminal. With this option, +B will write raw bitcode regardless of the output device. =item B<--help> Modified: llvm/trunk/docs/CommandGuide/llvm-extract.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-extract.pod?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-extract.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-extract.pod Tue Aug 25 10:54:01 2009 @@ -28,9 +28,9 @@ =item B<-f> -Force overwrite. Normally, B will refuse to overwrite an -output file that already exists. With this option, B -will overwrite the output file and replace it with new bitcode. +Enable binary output on terminals. Normally, B will refuse to +write raw bitcode output if the output stream is a terminal. With this option, +B will write raw bitcode regardless of the output device. =item B<--func> I Modified: llvm/trunk/docs/CommandGuide/llvm-link.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-link.pod?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-link.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-link.pod Tue Aug 25 10:54:01 2009 @@ -33,8 +33,9 @@ =item B<-f> -Overwrite output files. By default, B will not overwrite an output -file if it already exists. +Enable binary output on terminals. Normally, B will refuse to +write raw bitcode output if the output stream is a terminal. With this option, +B will write raw bitcode regardless of the output device. =item B<-o> F Modified: llvm/trunk/docs/CommandGuide/opt.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/opt.pod?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/opt.pod (original) +++ llvm/trunk/docs/CommandGuide/opt.pod Tue Aug 25 10:54:01 2009 @@ -39,9 +39,9 @@ =item B<-f> -Force overwrite. Normally, B will refuse to overwrite an -output file that already exists. With this option, B will -overwrite the output file and replace it with new bitcode. +Enable binary output on terminals. Normally, B will refuse to +write raw bitcode output if the output stream is a terminal. With this option, +B will write raw bitcode regardless of the output device. =item B<-help> Modified: llvm/trunk/docs/CommandLine.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandLine.html?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/CommandLine.html (original) +++ llvm/trunk/docs/CommandLine.html Tue Aug 25 10:54:01 2009 @@ -331,13 +331,13 @@

In addition to input and output filenames, we would like the compiler example -to support three boolean flags: "-f" to force overwriting of the output -file, "--quiet" to enable quiet mode, and "-q" for backwards -compatibility with some of our users. We can support these by declaring options -of boolean type like this:

+to support three boolean flags: "-f" to force writing binary output to +a terminal, "--quiet" to enable quiet mode, and "-q" for +backwards compatibility with some of our users. We can support these by +declaring options of boolean type like this:

-cl::opt<bool> Force ("f", cl::desc("Overwrite output files"));
+cl::opt<bool> Force ("f", cl::desc("Enable binary output on terminals"));
 cl::opt<bool> Quiet ("quiet", cl::desc("Don't print informational messages"));
 cl::opt<bool> Quiet2("q", cl::desc("Don't print informational messages"), cl::Hidden);
 
@@ -378,7 +378,7 @@ USAGE: compiler [options] <input file> OPTIONS: - -f - Overwrite output files + -f - Enable binary output on terminals -o - Override output filename -quiet - Don't print informational messages -help - display available options (--help-hidden for more) @@ -390,7 +390,7 @@ USAGE: compiler [options] <input file> OPTIONS: - -f - Overwrite output files + -f - Enable binary output on terminals -o - Override output filename -q - Don't print informational messages -quiet - Don't print informational messages @@ -530,7 +530,7 @@ -O1 - Enable trivial optimizations -O2 - Enable default optimizations -O3 - Enable expensive optimizations - -f - Overwrite output files + -f - Enable binary output on terminals -help - display available options (--help-hidden for more) -o <filename> - Specify output filename -quiet - Don't print informational messages @@ -614,7 +614,7 @@ =none - disable debug information =quick - enable quick debug information =detailed - enable detailed debug information - -f - Overwrite output files + -f - Enable binary output on terminals -help - display available options (--help-hidden for more) -o <filename> - Specify output filename -quiet - Don't print informational messages Modified: llvm/trunk/docs/HowToSubmitABug.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/HowToSubmitABug.html?rev=79996&r1=79995&r2=79996&view=diff ============================================================================== --- llvm/trunk/docs/HowToSubmitABug.html (original) +++ llvm/trunk/docs/HowToSubmitABug.html Tue Aug 25 10:54:01 2009 @@ -183,12 +183,12 @@ foo.bc, one of the following commands should fail:

    -
  1. llc foo.bc -f
  2. -
  3. llc foo.bc -f -relocation-model=pic
  4. -
  5. llc foo.bc -f -relocation-model=static
  6. -
  7. llc foo.bc -f -enable-eh
  8. -
  9. llc foo.bc -f -relocation-model=pic -enable-eh
  10. -
  11. llc foo.bc -f -relocation-model=static -enable-eh
  12. +
  13. llc foo.bc
  14. +
  15. llc foo.bc -relocation-model=pic
  16. +
  17. llc foo.bc -relocation-model=static
  18. +
  19. llc foo.bc -enable-eh
  20. +
  21. llc foo.bc -relocation-model=pic -enable-eh
  22. +
  23. llc foo.bc -relocation-model=static -enable-eh

If none of these crash, please follow the instructions for a @@ -320,7 +320,7 @@

-llc test.bc -o test.s -f
+llc test.bc -o test.s
gcc test.s safe.so -o test.llc
./test.llc [program options]

From gohman at apple.com Tue Aug 25 11:00:35 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 16:00:35 -0000 Subject: [llvm-commits] [llvm] r79997 - in /llvm/trunk/lib/VMCore: LLVMContextImpl.h Type.cpp Message-ID: <200908251600.n7PG0al4004715@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 11:00:35 2009 New Revision: 79997 URL: http://llvm.org/viewvc/llvm-project?rev=79997&view=rev Log: Allocate the basic types inside the LLVMContextImpl instance, rather than separately with new. Move the members above the TypeMap members to avoid destruction order issues. This fixes a leak of these objects, and eliminates an extra level of indirection in Type::getInt32Ty and friends. Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.h llvm/trunk/lib/VMCore/Type.cpp Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.h?rev=79997&r1=79996&r2=79997&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/LLVMContextImpl.h (original) +++ llvm/trunk/lib/VMCore/LLVMContextImpl.h Tue Aug 25 11:00:35 2009 @@ -147,6 +147,21 @@ // multithreaded mode. sys::SmartMutex AbstractTypeUsersLock; + // Basic type instances. + const Type VoidTy; + const Type LabelTy; + const Type FloatTy; + const Type DoubleTy; + const Type MetadataTy; + const Type X86_FP80Ty; + const Type FP128Ty; + const Type PPC_FP128Ty; + const IntegerType Int1Ty; + const IntegerType Int8Ty; + const IntegerType Int16Ty; + const IntegerType Int32Ty; + const IntegerType Int64Ty; + // Concrete/Abstract TypeDescriptions - We lazily calculate type descriptions // for types as they are needed. Because resolution of types must invalidate // all of the abstract type descriptions, we keep them in a seperate map to @@ -160,22 +175,7 @@ TypeMap FunctionTypes; TypeMap StructTypes; TypeMap IntegerTypes; - - const Type *VoidTy; - const Type *LabelTy; - const Type *FloatTy; - const Type *DoubleTy; - const Type *MetadataTy; - const Type *X86_FP80Ty; - const Type *FP128Ty; - const Type *PPC_FP128Ty; - - const IntegerType *Int1Ty; - const IntegerType *Int8Ty; - const IntegerType *Int16Ty; - const IntegerType *Int32Ty; - const IntegerType *Int64Ty; - + /// ValueHandles - This map keeps track of all of the value handles that are /// watching a Value*. The Value::HasValueHandle bit is used to know // whether or not a value has an entry in this map. @@ -183,42 +183,19 @@ ValueHandlesTy ValueHandles; LLVMContextImpl(LLVMContext &C) : TheTrueVal(0), TheFalseVal(0), - VoidTy(new Type(C, Type::VoidTyID)), - LabelTy(new Type(C, Type::LabelTyID)), - FloatTy(new Type(C, Type::FloatTyID)), - DoubleTy(new Type(C, Type::DoubleTyID)), - MetadataTy(new Type(C, Type::MetadataTyID)), - X86_FP80Ty(new Type(C, Type::X86_FP80TyID)), - FP128Ty(new Type(C, Type::FP128TyID)), - PPC_FP128Ty(new Type(C, Type::PPC_FP128TyID)), - Int1Ty(new IntegerType(C, 1)), - Int8Ty(new IntegerType(C, 8)), - Int16Ty(new IntegerType(C, 16)), - Int32Ty(new IntegerType(C, 32)), - Int64Ty(new IntegerType(C, 64)) { } - - ~LLVMContextImpl() { - // In principle, we should delete the member types here. However, - // this causes destruction order issues with the types in the TypeMaps. - // For now, just leak this, which is at least not a regression from the - // previous behavior, though still undesirable. -#if 0 - delete VoidTy; - delete LabelTy; - delete FloatTy; - delete DoubleTy; - delete MetadataTy; - delete X86_FP80Ty; - delete FP128Ty; - delete PPC_FP128Ty; - - delete Int1Ty; - delete Int8Ty; - delete Int16Ty; - delete Int32Ty; - delete Int64Ty; -#endif - } + VoidTy(C, Type::VoidTyID), + LabelTy(C, Type::LabelTyID), + FloatTy(C, Type::FloatTyID), + DoubleTy(C, Type::DoubleTyID), + MetadataTy(C, Type::MetadataTyID), + X86_FP80Ty(C, Type::X86_FP80TyID), + FP128Ty(C, Type::FP128TyID), + PPC_FP128Ty(C, Type::PPC_FP128TyID), + Int1Ty(C, 1), + Int8Ty(C, 8), + Int16Ty(C, 16), + Int32Ty(C, 32), + Int64Ty(C, 64) { } }; } Modified: llvm/trunk/lib/VMCore/Type.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=79997&r1=79996&r2=79997&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Type.cpp (original) +++ llvm/trunk/lib/VMCore/Type.cpp Tue Aug 25 11:00:35 2009 @@ -304,55 +304,55 @@ //===----------------------------------------------------------------------===// const Type *Type::getVoidTy(LLVMContext &C) { - return C.pImpl->VoidTy; + return &C.pImpl->VoidTy; } const Type *Type::getLabelTy(LLVMContext &C) { - return C.pImpl->LabelTy; + return &C.pImpl->LabelTy; } const Type *Type::getFloatTy(LLVMContext &C) { - return C.pImpl->FloatTy; + return &C.pImpl->FloatTy; } const Type *Type::getDoubleTy(LLVMContext &C) { - return C.pImpl->DoubleTy; + return &C.pImpl->DoubleTy; } const Type *Type::getMetadataTy(LLVMContext &C) { - return C.pImpl->MetadataTy; + return &C.pImpl->MetadataTy; } const Type *Type::getX86_FP80Ty(LLVMContext &C) { - return C.pImpl->X86_FP80Ty; + return &C.pImpl->X86_FP80Ty; } const Type *Type::getFP128Ty(LLVMContext &C) { - return C.pImpl->FP128Ty; + return &C.pImpl->FP128Ty; } const Type *Type::getPPC_FP128Ty(LLVMContext &C) { - return C.pImpl->PPC_FP128Ty; + return &C.pImpl->PPC_FP128Ty; } const IntegerType *Type::getInt1Ty(LLVMContext &C) { - return C.pImpl->Int1Ty; + return &C.pImpl->Int1Ty; } const IntegerType *Type::getInt8Ty(LLVMContext &C) { - return C.pImpl->Int8Ty; + return &C.pImpl->Int8Ty; } const IntegerType *Type::getInt16Ty(LLVMContext &C) { - return C.pImpl->Int16Ty; + return &C.pImpl->Int16Ty; } const IntegerType *Type::getInt32Ty(LLVMContext &C) { - return C.pImpl->Int32Ty; + return &C.pImpl->Int32Ty; } const IntegerType *Type::getInt64Ty(LLVMContext &C) { - return C.pImpl->Int64Ty; + return &C.pImpl->Int64Ty; } //===----------------------------------------------------------------------===// From edwintorok at gmail.com Tue Aug 25 11:53:15 2009 From: edwintorok at gmail.com (Torok Edwin) Date: Tue, 25 Aug 2009 16:53:15 -0000 Subject: [llvm-commits] [llvm] r80000 - /llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll Message-ID: <200908251653.n7PGrFLc011489@zion.cs.uiuc.edu> Author: edwin Date: Tue Aug 25 11:53:15 2009 New Revision: 80000 URL: http://llvm.org/viewvc/llvm-project?rev=80000&view=rev Log: Remove target triple from this test, it fails on x86-64 with --enable-targets=host-only otherwise. Modified: llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll Modified: llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll?rev=80000&r1=79999&r2=80000&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll Tue Aug 25 11:53:15 2009 @@ -2,7 +2,6 @@ ; RUN: llvm-as < %s | llc -o /dev/null ; XFAIL: powerpc -target triple = "powerpc-apple-darwin9.5" %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }*, i8*, i8* } @llvm.dbg.variable24 = external constant %llvm.dbg.variable.type ; <%llvm.dbg.variable.type*> [#uses=1] From asl at math.spbu.ru Tue Aug 25 12:00:24 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 25 Aug 2009 17:00:24 -0000 Subject: [llvm-commits] [llvm] r80001 - in /llvm/trunk: lib/Target/MSP430/MSP430ISelLowering.cpp lib/Target/MSP430/MSP430RegisterInfo.cpp test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll Message-ID: <200908251700.n7PH0Oum012396@zion.cs.uiuc.edu> Author: asl Date: Tue Aug 25 12:00:23 2009 New Revision: 80001 URL: http://llvm.org/viewvc/llvm-project?rev=80001&view=rev Log: Provide dynamic_stackalloc lowering for MSP430. This fixes PR4769 Added: llvm/trunk/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=80001&r1=80000&r2=80001&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Tue Aug 25 12:00:23 2009 @@ -95,6 +95,8 @@ setOperationAction(ISD::SELECT_CC, MVT::i8, Custom); setOperationAction(ISD::SELECT_CC, MVT::i16, Custom); setOperationAction(ISD::SIGN_EXTEND, MVT::i16, Custom); + setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i8, Expand); + setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i16, Expand); setOperationAction(ISD::CTTZ, MVT::i8, Expand); setOperationAction(ISD::CTTZ, MVT::i16, Expand); Modified: llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp?rev=80001&r1=80000&r2=80001&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430RegisterInfo.cpp Tue Aug 25 12:00:23 2009 @@ -328,7 +328,16 @@ // mergeSPUpdatesUp(MBB, MBBI, StackPtr, &NumBytes); if (MFI->hasVarSizedObjects()) { - llvm_unreachable("Not implemented yet!"); + BuildMI(MBB, MBBI, DL, + TII.get(MSP430::MOV16rr), MSP430::SPW).addReg(MSP430::FPW); + if (CSSize) { + MachineInstr *MI = + BuildMI(MBB, MBBI, DL, + TII.get(MSP430::SUB16ri), MSP430::SPW) + .addReg(MSP430::SPW).addImm(CSSize); + // The SRW implicit def is dead. + MI->getOperand(3).setIsDead(); + } } else { // adjust stack pointer back: SPW += numbytes if (NumBytes) { Added: llvm/trunk/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll?rev=80001&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll (added) +++ llvm/trunk/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll Tue Aug 25 12:00:23 2009 @@ -0,0 +1,30 @@ +; RUN: llvm-as < %s | llc +; PR4769 +target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8" +target triple = "msp430-generic-generic" + +define i16 @foo() nounwind readnone { +entry: + %result = alloca i16, align 1 ; [#uses=2] + volatile store i16 0, i16* %result + %tmp = volatile load i16* %result ; [#uses=1] + ret i16 %tmp +} + +define i16 @main() nounwind { +entry: + br label %while.cond + +while.cond: ; preds = %while.cond, %entry + %call = call i16 @bar() nounwind ; [#uses=1] + %tobool = icmp eq i16 %call, 0 ; [#uses=1] + br i1 %tobool, label %while.end, label %while.cond + +while.end: ; preds = %while.cond + %result.i = alloca i16, align 1 ; [#uses=2] + volatile store i16 0, i16* %result.i + %tmp.i = volatile load i16* %result.i ; [#uses=0] + ret i16 0 +} + +declare i16 @bar() From david_goodwin at apple.com Tue Aug 25 12:03:05 2009 From: david_goodwin at apple.com (David Goodwin) Date: Tue, 25 Aug 2009 17:03:05 -0000 Subject: [llvm-commits] [llvm] r80002 - in /llvm/trunk: lib/CodeGen/PostRASchedulerList.cpp test/CodeGen/ARM/2009-08-21-PostRAKill.ll test/CodeGen/ARM/2009-08-21-PostRAKill2.ll test/CodeGen/ARM/2009-08-21-PostRAKill3.ll Message-ID: <200908251703.n7PH368Z012822@zion.cs.uiuc.edu> Author: david_goodwin Date: Tue Aug 25 12:03:05 2009 New Revision: 80002 URL: http://llvm.org/viewvc/llvm-project?rev=80002&view=rev Log: Fixup register kills after scheduling. Added: llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill.ll llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=80002&r1=80001&r2=80002&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Tue Aug 25 12:03:05 2009 @@ -40,6 +40,7 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/Statistic.h" #include +#include using namespace llvm; STATISTIC(NumNoops, "Number of noops inserted"); @@ -140,6 +141,11 @@ /// Schedule - Schedule the instruction range using list scheduling. /// void Schedule(); + + /// FixupKills - Fix register kill flags that have been made + /// invalid due to scheduling + /// + void FixupKills(MachineBasicBlock *MBB); /// Observe - Update liveness information to account for the current /// instruction, which will not be scheduled. @@ -150,6 +156,11 @@ /// void FinishBlock(); + /// GenerateLivenessForKills - If true then generate Def/Kill + /// information for use in updating register kill. If false then + /// generate Def/Kill information for anti-dependence breaking. + bool GenerateLivenessForKills; + private: void PrescanInstruction(MachineInstr *MI); void ScanInstruction(MachineInstr *MI, unsigned Count); @@ -202,6 +213,7 @@ for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end(); MBB != MBBe; ++MBB) { // Initialize register live-range state for scheduling in this block. + Scheduler.GenerateLivenessForKills = false; Scheduler.StartBlock(MBB); // Schedule each sequence of instructions not interrupted by a label @@ -228,6 +240,12 @@ // Clean up register live-range state. Scheduler.FinishBlock(); + + // Initialize register live-range state again and update register kills + Scheduler.GenerateLivenessForKills = true; + Scheduler.StartBlock(MBB); + Scheduler.FixupKills(MBB); + Scheduler.FinishBlock(); } return true; @@ -287,26 +305,28 @@ } } - // Consider callee-saved registers as live-out, since we're running after - // prologue/epilogue insertion so there's no way to add additional - // saved registers. - // - // TODO: If the callee saves and restores these, then we can potentially - // use them between the save and the restore. To do that, we could scan - // the exit blocks to see which of these registers are defined. - // Alternatively, callee-saved registers that aren't saved and restored - // could be marked live-in in every block. - for (const unsigned *I = TRI->getCalleeSavedRegs(); *I; ++I) { - unsigned Reg = *I; - Classes[Reg] = reinterpret_cast(-1); - KillIndices[Reg] = BB->size(); - DefIndices[Reg] = ~0u; - // Repeat, for all aliases. - for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias) { - unsigned AliasReg = *Alias; - Classes[AliasReg] = reinterpret_cast(-1); - KillIndices[AliasReg] = BB->size(); - DefIndices[AliasReg] = ~0u; + if (!GenerateLivenessForKills) { + // Consider callee-saved registers as live-out, since we're running after + // prologue/epilogue insertion so there's no way to add additional + // saved registers. + // + // TODO: If the callee saves and restores these, then we can potentially + // use them between the save and the restore. To do that, we could scan + // the exit blocks to see which of these registers are defined. + // Alternatively, callee-saved registers that aren't saved and restored + // could be marked live-in in every block. + for (const unsigned *I = TRI->getCalleeSavedRegs(); *I; ++I) { + unsigned Reg = *I; + Classes[Reg] = reinterpret_cast(-1); + KillIndices[Reg] = BB->size(); + DefIndices[Reg] = ~0u; + // Repeat, for all aliases. + for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias) { + unsigned AliasReg = *Alias; + Classes[AliasReg] = reinterpret_cast(-1); + KillIndices[AliasReg] = BB->size(); + DefIndices[AliasReg] = ~0u; + } } } } @@ -467,11 +487,17 @@ Classes[SubregReg] = 0; RegRefs.erase(SubregReg); } - // Conservatively mark super-registers as unusable. + // Conservatively mark super-registers as unusable. If + // initializing for kill updating, then mark all supers as defined + // as well. for (const unsigned *Super = TRI->getSuperRegisters(Reg); *Super; ++Super) { unsigned SuperReg = *Super; Classes[SuperReg] = reinterpret_cast(-1); + if (GenerateLivenessForKills) { + DefIndices[SuperReg] = Count; + KillIndices[SuperReg] = ~0u; + } } } for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { @@ -753,6 +779,53 @@ return Changed; } +/// FixupKills - Fix the register kill flags, they may have been made +/// incorrect by instruction reordering. +/// +void SchedulePostRATDList::FixupKills(MachineBasicBlock *MBB) { + DEBUG(errs() << "Fixup kills for BB ID#" << MBB->getNumber() << '\n'); + + std::set killedRegs; + BitVector ReservedRegs = TRI->getReservedRegs(MF); + + unsigned Count = MBB->size(); + for (MachineBasicBlock::iterator I = MBB->end(), E = MBB->begin(); + I != E; --Count) { + MachineInstr *MI = --I; + + // After regalloc, IMPLICIT_DEF instructions aren't safe to treat as + // dependence-breaking. In the case of an INSERT_SUBREG, the IMPLICIT_DEF + // is left behind appearing to clobber the super-register, while the + // subregister needs to remain live. So we just ignore them. + if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) + continue; + + PrescanInstruction(MI); + ScanInstruction(MI, Count); + + // Examine all used registers and set kill flag. When a register + // is used multiple times we only set the kill flag on the first + // use. + killedRegs.clear(); + for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { + MachineOperand &MO = MI->getOperand(i); + if (!MO.isReg() || !MO.isUse()) continue; + unsigned Reg = MO.getReg(); + if ((Reg == 0) || ReservedRegs.test(Reg)) continue; + + bool kill = ((KillIndices[Reg] == Count) && + (killedRegs.find(Reg) == killedRegs.end())); + if (MO.isKill() != kill) { + MO.setIsKill(kill); + DEBUG(errs() << "Fixed " << MO << " in "); + DEBUG(MI->dump()); + } + + killedRegs.insert(Reg); + } + } +} + //===----------------------------------------------------------------------===// // Top-Down Scheduling //===----------------------------------------------------------------------===// Added: llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill.ll?rev=80002&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill.ll Tue Aug 25 12:03:05 2009 @@ -0,0 +1,40 @@ +; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 -mcpu=cortex-a8 -disable-post-RA-scheduler=0 -avoid-hazards + +; ModuleID = '' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "armv7-apple-darwin9" + +%struct.tree = type { i32, double, double, %struct.tree*, %struct.tree*, %struct.tree*, %struct.tree* } + at g = common global %struct.tree* null + +define arm_apcscc %struct.tree* @tsp(%struct.tree* %t, i32 %nproc) nounwind { +entry: + %t.idx51.val.i = load double* null ; [#uses=1] + br i1 undef, label %bb4.i, label %bb.i + +bb.i: ; preds = %entry + unreachable + +bb4.i: ; preds = %entry + %0 = load %struct.tree** @g, align 4 ; <%struct.tree*> [#uses=2] + %.idx45.i = getelementptr %struct.tree* %0, i32 0, i32 1 ; [#uses=1] + %.idx45.val.i = load double* %.idx45.i ; [#uses=1] + %.idx46.i = getelementptr %struct.tree* %0, i32 0, i32 2 ; [#uses=1] + %.idx46.val.i = load double* %.idx46.i ; [#uses=1] + %1 = fsub double 0.000000e+00, %.idx45.val.i ; [#uses=2] + %2 = fmul double %1, %1 ; [#uses=1] + %3 = fsub double %t.idx51.val.i, %.idx46.val.i ; [#uses=2] + %4 = fmul double %3, %3 ; [#uses=1] + %5 = fadd double %2, %4 ; [#uses=1] + %6 = tail call double @llvm.sqrt.f64(double %5) nounwind ; [#uses=1] + br i1 undef, label %bb7.i4, label %bb6.i + +bb6.i: ; preds = %bb4.i + br label %bb7.i4 + +bb7.i4: ; preds = %bb6.i, %bb4.i + %tton1.0.i = phi double [ %6, %bb6.i ], [ undef, %bb4.i ] ; [#uses=0] + unreachable +} + +declare double @llvm.sqrt.f64(double) nounwind readonly Added: llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll?rev=80002&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill2.ll Tue Aug 25 12:03:05 2009 @@ -0,0 +1,38 @@ +; RUN: llvm-as < %s | llc -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -disable-post-RA-scheduler=0 -avoid-hazards + +; ModuleID = '' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "armv7-apple-darwin9" + +%struct.anon = type { [3 x double], double, %struct.node*, [64 x %struct.bnode*], [64 x %struct.bnode*] } +%struct.bnode = type { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x double], double, %struct.bnode*, %struct.bnode* } +%struct.icstruct = type { [3 x i32], i16 } +%struct.node = type { i16, double, [3 x double], i32, i32 } + +declare arm_apcscc double @floor(double) nounwind readnone + +define void @intcoord(%struct.icstruct* noalias nocapture sret %agg.result, i1 %a, double %b) { +entry: + br i1 %a, label %bb3, label %bb1 + +bb1: ; preds = %entry + unreachable + +bb3: ; preds = %entry + br i1 %a, label %bb7, label %bb5 + +bb5: ; preds = %bb3 + unreachable + +bb7: ; preds = %bb3 + br i1 %a, label %bb11, label %bb9 + +bb9: ; preds = %bb7 + %0 = tail call arm_apcscc double @floor(double %b) nounwind readnone ; [#uses=0] + br label %bb11 + +bb11: ; preds = %bb9, %bb7 + %1 = getelementptr %struct.icstruct* %agg.result, i32 0, i32 0, i32 0 ; [#uses=1] + store i32 0, i32* %1 + ret void +} Added: llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll?rev=80002&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2009-08-21-PostRAKill3.ll Tue Aug 25 12:03:05 2009 @@ -0,0 +1,31 @@ +; RUN: llvm-as < %s | llc -asm-verbose=false -O3 -relocation-model=pic -disable-fp-elim -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -disable-post-RA-scheduler=0 -avoid-hazards + +; ModuleID = '' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "armv7-apple-darwin9" + +%struct.Hosp = type { i32, i32, i32, %struct.List, %struct.List, %struct.List, %struct.List } +%struct.List = type { %struct.List*, %struct.Patient*, %struct.List* } +%struct.Patient = type { i32, i32, i32, %struct.Village* } +%struct.Village = type { [4 x %struct.Village*], %struct.Village*, %struct.List, %struct.Hosp, i32, i32 } + +define arm_apcscc %struct.Village* @alloc_tree(i32 %level, i32 %label, %struct.Village* %back, i1 %p) nounwind { +entry: + br i1 %p, label %bb8, label %bb1 + +bb1: ; preds = %entry + %0 = malloc %struct.Village ; <%struct.Village*> [#uses=3] + %exp2 = call double @ldexp(double 1.000000e+00, i32 %level) nounwind ; [#uses=1] + %.c = fptosi double %exp2 to i32 ; [#uses=1] + store i32 %.c, i32* null + %1 = getelementptr %struct.Village* %0, i32 0, i32 3, i32 6, i32 0 ; <%struct.List**> [#uses=1] + store %struct.List* null, %struct.List** %1 + %2 = getelementptr %struct.Village* %0, i32 0, i32 3, i32 6, i32 2 ; <%struct.List**> [#uses=1] + store %struct.List* null, %struct.List** %2 + ret %struct.Village* %0 + +bb8: ; preds = %entry + ret %struct.Village* null +} + +declare double @ldexp(double, i32) From clattner at apple.com Tue Aug 25 12:06:18 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 25 Aug 2009 10:06:18 -0700 Subject: [llvm-commits] [llvm] r79990 - in /llvm/trunk: examples/BrainF/ include/llvm/Support/ lib/Analysis/ lib/Bitcode/Writer/ lib/Support/ tools/bugpoint/ tools/gold/ tools/llc/ tools/llvm-as/ tools/llvm-dis/ tools/llvm-extract/ tools/llvm-ld/ tools/llvm-link/ tools/llvm-mc/ tools/lto/ tools/opt/ utils/FileUpdate/ utils/TableGen/ In-Reply-To: <200908251534.n7PFYrGU000742@zion.cs.uiuc.edu> References: <200908251534.n7PFYrGU000742@zion.cs.uiuc.edu> Message-ID: <7E875BEC-FF59-4A44-B1F2-318918D99CDC@apple.com> On Aug 25, 2009, at 8:34 AM, Dan Gohman wrote: > Author: djg > Date: Tue Aug 25 10:34:52 2009 > New Revision: 79990 > > URL: http://llvm.org/viewvc/llvm-project?rev=79990&view=rev > Log: > Make LLVM command-line tools overwrite their output files without -f. > This is conventional command-line tool behavior. -f now just means > "enable binary output on terminals". > > Add a -f option to llvm-extract and llvm-link, for consistency. > > Remove F_Force from raw_fd_ostream and enable overwriting and > truncating by default. Introduce an F_Excl flag to permit users to > enable a failure when the file already exists. This flag is > currently unused. > > Update Makefiles and documentation accordingly. Hi Dan, Thanks for doing this, please send an email with an 'obvious' subject line to llvmdev as a heads up. Please make sure people know it is in mainline, not 2.6. -Chris From baldrick at free.fr Tue Aug 25 12:24:02 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 25 Aug 2009 17:24:02 -0000 Subject: [llvm-commits] [gcc-plugin] r80004 - in /gcc-plugin/trunk: Makefile llvm-backend.cpp Message-ID: <200908251724.n7PHO28l015627@zion.cs.uiuc.edu> Author: baldrick Date: Tue Aug 25 12:24:01 2009 New Revision: 80004 URL: http://llvm.org/viewvc/llvm-project?rev=80004&view=rev Log: Teach the plugin how to write .s files. Since it's hard to stop gcc outputting stuff the following trick is used: very early on, the plugin discovers the name of the .s file, and replaces it with /dev/null or the host equivalent. This is done early enough that gcc hasn't had time to output anything yet. The result is that all gcc generated output is discarded, and the plugin can freely write to the original file. For efficiency it would be nice to reduce to a minimum the amount of stuff gcc calculates and outputs (eg: global variables), but than can wait till later. Currently the plugin is capable of generating correct code for the empty function! Various notes: Output is done using raw_ostream and formatted_raw_ostream, like in clang. The .ident string is implemented as a module level ASM. This means it will end up in bitcode too. Might be worth doing in llvm-gcc as well. Some flags (emit_llvm etc) are not wired up yet. The flag_inline_trees flag does not exist anymore - will take care of this properly later. Modified: gcc-plugin/trunk/Makefile gcc-plugin/trunk/llvm-backend.cpp Modified: gcc-plugin/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/Makefile?rev=80004&r1=80003&r2=80004&view=diff ============================================================================== --- gcc-plugin/trunk/Makefile (original) +++ gcc-plugin/trunk/Makefile Tue Aug 25 12:24:01 2009 @@ -21,7 +21,7 @@ -I${GCCOBJECT_DIR}/libdecnumber -I. CXXFLAGS+=$(CFLAGS) $(shell llvm-config --cppflags) -LDFLAGS+=$(shell llvm-config --ldflags) $(shell llvm-config --libs analysis core target x86) +LDFLAGS+=$(shell llvm-config --ldflags) $(shell llvm-config --libs analysis core ipo scalaropts target x86) llvm.so: $(PLUGIN_OBJECT_FILES) $(CXX) -shared $^ -o $@ ${LDFLAGS} Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=80004&r1=80003&r2=80004&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Tue Aug 25 12:24:01 2009 @@ -79,6 +79,7 @@ #include "tree-inline.h" #include "tree-flow.h" #include "tree-pass.h" +#include "version.h" } // Plugin headers @@ -99,17 +100,22 @@ // Non-zero if implicit floating point instructions are disabled. static int flag_no_implicit_float = 0; +/// llvm_asm_file_name - Name of file to use for assembly code output. +static const char *llvm_asm_file_name; + // Global state for the LLVM backend. Module *TheModule = 0; DebugInfo *TheDebugInfo = 0; TargetMachine *TheTarget = 0; TargetFolder *TheFolder = 0; TypeConverter *TheTypeConverter = 0; +llvm::raw_ostream *OutStream = 0; // Stream to write assembly code to. +llvm::formatted_raw_ostream FormattedOutStream; -/// DisableLLVMOptimizations - Allow the user to specify: -/// "-mllvm -disable-llvm-optzns" on the llvm-gcc command line to force llvm -/// optimizations off. -static cl::opt DisableLLVMOptimizations("disable-llvm-optzns"); +static bool DisableLLVMOptimizations = false;//TODO +static bool emit_llvm = false;//TODO +static bool emit_llvm_bc = false;//TODO +static int flag_inline_trees = 2;//TODO std::vector > StaticCtors, StaticDtors; SmallSetVector AttributeUsedGlobals; @@ -125,7 +131,7 @@ static void createPerFunctionOptimizationPasses(); static void createPerModuleOptimizationPasses(); -static void destroyOptimizationPasses(); +//TODOstatic void destroyOptimizationPasses(); //TODO//===----------------------------------------------------------------------===// //TODO// Matching LLVM Values with GCC DECL trees @@ -489,6 +495,30 @@ TheModule = new Module("", getGlobalContext()); + if (main_input_filename) + TheModule->setModuleIdentifier(main_input_filename); + + // Insert a special .ident directive to identify the version of the plugin + // which compiled this code. The format of the .ident string is patterned + // after the ones produced by GCC. +#ifdef IDENT_ASM_OP + if (!flag_no_ident) { + const char *pkg_version = "(GNU) "; + + if (strcmp ("(GCC) ", pkgversion_string)) + pkg_version = pkgversion_string; + + std::string IdentString = IDENT_ASM_OP; + IdentString += "\"GCC: "; + IdentString += pkg_version; + IdentString += version_string; + IdentString += "; LLVM: "; + IdentString += REVISION; + IdentString += '"'; + TheModule->setModuleInlineAsm(IdentString); + } +#endif + // If the target wants to override the architecture, e.g. turning // powerpc-darwin-... into powerpc64-darwin-... when -m64 is enabled, do so // now. @@ -548,6 +578,8 @@ //TODO if (!flag_pch_file && //TODO debug_info_level > DINFO_LEVEL_NONE) //TODO TheDebugInfo = new DebugInfo(TheModule); +//TODO if (TheDebugInfo) +//TODO TheDebugInfo->Initialize(); //TODO} //TODO //TODO/// performLateBackendInitialization - Set backend options that may only be @@ -567,25 +599,27 @@ //TODO I->addFnAttr(Attribute::NoImplicitFloat); //TODO } //TODO} -//TODO -//TODOvoid llvm_lang_dependent_init(const char *Name) { -//TODO if (TheDebugInfo) -//TODO TheDebugInfo->Initialize(); -//TODO if (Name) -//TODO TheModule->setModuleIdentifier(Name); -//TODO} Initialized = true; } -void llvm_lang_dependent_init(const char *Name) { - if (TheDebugInfo) - TheDebugInfo->Initialize(); - if (Name) - TheModule->setModuleIdentifier(Name); +/// InitializeOutputStreams - Initialize the assembly code output streams. +static void InitializeOutputStreams(bool Binary) { + assert(!OutStream && "Output stream already initialized!"); + std::string Error; + unsigned Flags = raw_fd_ostream::F_Force; + + if (Binary) + Flags |= raw_fd_ostream::F_Binary; + + OutStream = new raw_fd_ostream(llvm_asm_file_name, Error, Flags); + + if (!Error.empty()) + llvm_report_error(Error); + + FormattedOutStream.setStream(*OutStream, + formatted_raw_ostream::PRESERVE_STREAM); } -//TODOoFILEstream *AsmOutStream = 0; -//TODOstatic formatted_raw_ostream *AsmOutRawStream = 0; //TODOoFILEstream *AsmIntermediateOutStream = 0; //TODO //TODO/// llvm_pch_read - Read bytecode from PCH file. Initialize TheModule and setup @@ -650,7 +684,7 @@ //TODO //TODO // Emit an LLVM .bc file to the output. This is used when passed //TODO // -emit-llvm -c to the GCC driver. -//TODO PerModulePasses->add(CreateBitcodeWriterPass(*AsmOutStream)); +//TODO PerModulePasses->add(createBitcodeWriterPass(*AsmOutStream)); //TODO //TODO // Disable emission of .ident into the output file... which is completely //TODO // wrong for llvm/.bc emission cases. @@ -670,174 +704,178 @@ //TODO PerModulePasses = 0; //TODO CodeGenPasses = 0; //TODO} -//TODO -//TODOstatic void createPerFunctionOptimizationPasses() { -//TODO if (PerFunctionPasses) -//TODO return; -//TODO -//TODO // Create and set up the per-function pass manager. -//TODO // FIXME: Move the code generator to be function-at-a-time. -//TODO PerFunctionPasses = -//TODO new FunctionPassManager(new ExistingModuleProvider(TheModule)); -//TODO PerFunctionPasses->add(new TargetData(*TheTarget->getTargetData())); -//TODO -//TODO // In -O0 if checking is disabled, we don't even have per-function passes. -//TODO bool HasPerFunctionPasses = false; -//TODO#ifdef ENABLE_CHECKING -//TODO PerFunctionPasses->add(createVerifierPass()); -//TODO HasPerFunctionPasses = true; -//TODO#endif -//TODO -//TODO if (optimize > 0 && !DisableLLVMOptimizations) { -//TODO HasPerFunctionPasses = true; -//TODO PerFunctionPasses->add(createCFGSimplificationPass()); -//TODO if (optimize == 1) -//TODO PerFunctionPasses->add(createPromoteMemoryToRegisterPass()); -//TODO else -//TODO PerFunctionPasses->add(createScalarReplAggregatesPass()); -//TODO PerFunctionPasses->add(createInstructionCombiningPass()); -//TODO } -//TODO -//TODO // If there are no module-level passes that have to be run, we codegen as -//TODO // each function is parsed. -//TODO // FIXME: We can't figure this out until we know there are no always-inline -//TODO // functions. -//TODO // FIXME: This is disabled right now until bugs can be worked out. Reenable -//TODO // this for fast -O0 compiles! -//TODO if (!emit_llvm_bc && !emit_llvm && 0) { -//TODO FunctionPassManager *PM = PerFunctionPasses; -//TODO HasPerFunctionPasses = true; -//TODO -//TODO CodeGenOpt::Level OptLevel = CodeGenOpt::Default; -//TODO -//TODO switch (optimize) { -//TODO default: break; -//TODO case 0: OptLevel = CodeGenOpt::None; break; -//TODO case 3: OptLevel = CodeGenOpt::Aggressive; break; -//TODO } -//TODO -//TODO // Normal mode, emit a .s file by running the code generator. -//TODO // Note, this also adds codegenerator level optimization passes. -//TODO switch (TheTarget->addPassesToEmitFile(*PM, *AsmOutRawStream, -//TODO TargetMachine::AssemblyFile, -//TODO OptLevel)) { -//TODO default: -//TODO case FileModel::Error: -//TODO errs() << "Error interfacing to target machine!\n"; -//TODO exit(1); -//TODO case FileModel::AsmFile: -//TODO break; -//TODO } -//TODO -//TODO if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0, -//TODO OptLevel)) { -//TODO errs() << "Error interfacing to target machine!\n"; -//TODO exit(1); -//TODO } -//TODO } -//TODO -//TODO if (HasPerFunctionPasses) { -//TODO PerFunctionPasses->doInitialization(); -//TODO } else { -//TODO delete PerFunctionPasses; -//TODO PerFunctionPasses = 0; -//TODO } -//TODO} -//TODO -//TODOstatic void createPerModuleOptimizationPasses() { -//TODO if (PerModulePasses) -//TODO // llvm_pch_write_init has already created the per module passes. -//TODO return; -//TODO -//TODO // FIXME: AT -O0/O1, we should stream out functions at a time. -//TODO PerModulePasses = new PassManager(); -//TODO PerModulePasses->add(new TargetData(*TheTarget->getTargetData())); -//TODO bool HasPerModulePasses = false; -//TODO -//TODO if (!DisableLLVMOptimizations) { -//TODO bool NeedAlwaysInliner = false; -//TODO llvm::Pass *InliningPass = 0; -//TODO if (flag_inline_trees > 1) { // respect -fno-inline-functions -//TODO InliningPass = createFunctionInliningPass(); // Inline small functions -//TODO } else { -//TODO // If full inliner is not run, check if always-inline is needed to handle -//TODO // functions that are marked as always_inline. -//TODO for (Module::iterator I = TheModule->begin(), E = TheModule->end(); -//TODO I != E; ++I) -//TODO if (I->hasFnAttr(Attribute::AlwaysInline)) { -//TODO NeedAlwaysInliner = true; -//TODO break; -//TODO } -//TODO -//TODO if (NeedAlwaysInliner) -//TODO InliningPass = createAlwaysInlinerPass(); // Inline always_inline funcs -//TODO } -//TODO -//TODO HasPerModulePasses = true; -//TODO createStandardModulePasses(PerModulePasses, optimize, -//TODO optimize_size || optimize < 3, -//TODO flag_unit_at_a_time, flag_unroll_loops, -//TODO !flag_no_simplify_libcalls, flag_exceptions, -//TODO InliningPass); -//TODO } -//TODO -//TODO if (emit_llvm_bc) { -//TODO // Emit an LLVM .bc file to the output. This is used when passed -//TODO // -emit-llvm -c to the GCC driver. -//TODO PerModulePasses->add(CreateBitcodeWriterPass(*AsmOutStream)); -//TODO HasPerModulePasses = true; -//TODO } else if (emit_llvm) { -//TODO // Emit an LLVM .ll file to the output. This is used when passed -//TODO // -emit-llvm -S to the GCC driver. -//TODO PerModulePasses->add(createPrintModulePass(AsmOutRawStream)); -//TODO HasPerModulePasses = true; -//TODO } else { -//TODO // If there are passes we have to run on the entire module, we do codegen -//TODO // as a separate "pass" after that happens. -//TODO // However if there are no module-level passes that have to be run, we -//TODO // codegen as each function is parsed. -//TODO // FIXME: This is disabled right now until bugs can be worked out. Reenable -//TODO // this for fast -O0 compiles! -//TODO if (PerModulePasses || 1) { -//TODO FunctionPassManager *PM = CodeGenPasses = -//TODO new FunctionPassManager(new ExistingModuleProvider(TheModule)); -//TODO PM->add(new TargetData(*TheTarget->getTargetData())); -//TODO -//TODO CodeGenOpt::Level OptLevel = CodeGenOpt::Default; -//TODO -//TODO switch (optimize) { -//TODO default: break; -//TODO case 0: OptLevel = CodeGenOpt::None; break; -//TODO case 3: OptLevel = CodeGenOpt::Aggressive; break; -//TODO } -//TODO -//TODO // Normal mode, emit a .s file by running the code generator. -//TODO // Note, this also adds codegenerator level optimization passes. -//TODO switch (TheTarget->addPassesToEmitFile(*PM, *AsmOutRawStream, -//TODO TargetMachine::AssemblyFile, -//TODO OptLevel)) { -//TODO default: -//TODO case FileModel::Error: -//TODO errs() << "Error interfacing to target machine!\n"; -//TODO exit(1); -//TODO case FileModel::AsmFile: -//TODO break; -//TODO } -//TODO -//TODO if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0, -//TODO OptLevel)) { -//TODO errs() << "Error interfacing to target machine!\n"; -//TODO exit(1); -//TODO } -//TODO } -//TODO } -//TODO -//TODO if (!HasPerModulePasses) { -//TODO delete PerModulePasses; -//TODO PerModulePasses = 0; -//TODO } -//TODO} -//TODO + +static void createPerFunctionOptimizationPasses() { + if (PerFunctionPasses) + return; + + // Create and set up the per-function pass manager. + // FIXME: Move the code generator to be function-at-a-time. + PerFunctionPasses = + new FunctionPassManager(new ExistingModuleProvider(TheModule)); + PerFunctionPasses->add(new TargetData(*TheTarget->getTargetData())); + + // In -O0 if checking is disabled, we don't even have per-function passes. + bool HasPerFunctionPasses = false; +#ifdef ENABLE_CHECKING + PerFunctionPasses->add(createVerifierPass()); + HasPerFunctionPasses = true; +#endif + + if (optimize > 0 && !DisableLLVMOptimizations) { + HasPerFunctionPasses = true; + PerFunctionPasses->add(createCFGSimplificationPass()); + if (optimize == 1) + PerFunctionPasses->add(createPromoteMemoryToRegisterPass()); + else + PerFunctionPasses->add(createScalarReplAggregatesPass()); + PerFunctionPasses->add(createInstructionCombiningPass()); + } + + // If there are no module-level passes that have to be run, we codegen as + // each function is parsed. + // FIXME: We can't figure this out until we know there are no always-inline + // functions. + // FIXME: This is disabled right now until bugs can be worked out. Reenable + // this for fast -O0 compiles! + if (!emit_llvm_bc && !emit_llvm && 0) { + FunctionPassManager *PM = PerFunctionPasses; + HasPerFunctionPasses = true; + + CodeGenOpt::Level OptLevel = CodeGenOpt::Default; + + switch (optimize) { + default: break; + case 0: OptLevel = CodeGenOpt::None; break; + case 3: OptLevel = CodeGenOpt::Aggressive; break; + } + + // Normal mode, emit a .s file by running the code generator. + // Note, this also adds codegenerator level optimization passes. + InitializeOutputStreams(false); + switch (TheTarget->addPassesToEmitFile(*PM, FormattedOutStream, + TargetMachine::AssemblyFile, + OptLevel)) { + default: + case FileModel::Error: + errs() << "Error interfacing to target machine!\n"; + exit(1); + case FileModel::AsmFile: + break; + } + + if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0, + OptLevel)) { + errs() << "Error interfacing to target machine!\n"; + exit(1); + } + } + + if (HasPerFunctionPasses) { + PerFunctionPasses->doInitialization(); + } else { + delete PerFunctionPasses; + PerFunctionPasses = 0; + } +} + +static void createPerModuleOptimizationPasses() { + if (PerModulePasses) + // llvm_pch_write_init has already created the per module passes. + return; + + // FIXME: AT -O0/O1, we should stream out functions at a time. + PerModulePasses = new PassManager(); + PerModulePasses->add(new TargetData(*TheTarget->getTargetData())); + bool HasPerModulePasses = false; + + if (!DisableLLVMOptimizations) { + bool NeedAlwaysInliner = false; + llvm::Pass *InliningPass = 0; + if (flag_inline_trees > 1) { // respect -fno-inline-functions + InliningPass = createFunctionInliningPass(); // Inline small functions + } else { + // If full inliner is not run, check if always-inline is needed to handle + // functions that are marked as always_inline. + for (Module::iterator I = TheModule->begin(), E = TheModule->end(); + I != E; ++I) + if (I->hasFnAttr(Attribute::AlwaysInline)) { + NeedAlwaysInliner = true; + break; + } + + if (NeedAlwaysInliner) + InliningPass = createAlwaysInlinerPass(); // Inline always_inline funcs + } + + HasPerModulePasses = true; + createStandardModulePasses(PerModulePasses, optimize, + optimize_size || optimize < 3, + flag_unit_at_a_time, flag_unroll_loops, + !flag_no_simplify_libcalls, flag_exceptions, + InliningPass); + } + + if (emit_llvm_bc) { + // Emit an LLVM .bc file to the output. This is used when passed + // -emit-llvm -c to the GCC driver. + InitializeOutputStreams(true); + PerModulePasses->add(createBitcodeWriterPass(*OutStream)); + HasPerModulePasses = true; + } else if (emit_llvm) { + // Emit an LLVM .ll file to the output. This is used when passed + // -emit-llvm -S to the GCC driver. + InitializeOutputStreams(false); + PerModulePasses->add(createPrintModulePass(OutStream)); + HasPerModulePasses = true; + } else { + // If there are passes we have to run on the entire module, we do codegen + // as a separate "pass" after that happens. + // However if there are no module-level passes that have to be run, we + // codegen as each function is parsed. + // FIXME: This is disabled right now until bugs can be worked out. Reenable + // this for fast -O0 compiles! + if (PerModulePasses || 1) { + FunctionPassManager *PM = CodeGenPasses = + new FunctionPassManager(new ExistingModuleProvider(TheModule)); + PM->add(new TargetData(*TheTarget->getTargetData())); + + CodeGenOpt::Level OptLevel = CodeGenOpt::Default; + + switch (optimize) { + default: break; + case 0: OptLevel = CodeGenOpt::None; break; + case 3: OptLevel = CodeGenOpt::Aggressive; break; + } + + // Normal mode, emit a .s file by running the code generator. + // Note, this also adds codegenerator level optimization passes. + InitializeOutputStreams(false); + switch (TheTarget->addPassesToEmitFile(*PM, FormattedOutStream, + TargetMachine::AssemblyFile, + OptLevel)) { + default: + case FileModel::Error: + errs() << "Error interfacing to target machine!\n"; + exit(1); + case FileModel::AsmFile: + break; + } + + if (TheTarget->addPassesToEmitFileFinish(*PM, (MachineCodeEmitter *)0, + OptLevel)) { + errs() << "Error interfacing to target machine!\n"; + exit(1); + } + } + } + + if (!HasPerModulePasses) { + delete PerModulePasses; + PerModulePasses = 0; + } +} + //TODO/// llvm_asm_file_start - Start the .s file. //TODOvoid llvm_asm_file_start(void) { //TODO timevar_push(TV_LLVM_INIT); @@ -893,81 +931,83 @@ Array, Name); } -//TODO/// llvm_asm_file_end - Finish the .s file. -//TODOvoid llvm_asm_file_end(void) { +/// llvm_finish_unit - Finish the .s file. +static void llvm_finish_unit(void *gcc_data, void *user_data) { + LazilyInitializeModule(); + //TODO timevar_push(TV_LLVM_PERFILE); -//TODO LLVMContext &Context = getGlobalContext(); -//TODO + LLVMContext &Context = getGlobalContext(); + //TODO performLateBackendInitialization(); -//TODO createPerFunctionOptimizationPasses(); + createPerFunctionOptimizationPasses(); //TODO //TODO if (flag_pch_file) { //TODO writeLLVMTypesStringTable(); //TODO writeLLVMValues(); //TODO } -//TODO -//TODO // Add an llvm.global_ctors global if needed. -//TODO if (!StaticCtors.empty()) -//TODO CreateStructorsList(StaticCtors, "llvm.global_ctors"); -//TODO // Add an llvm.global_dtors global if needed. -//TODO if (!StaticDtors.empty()) -//TODO CreateStructorsList(StaticDtors, "llvm.global_dtors"); -//TODO -//TODO if (!AttributeUsedGlobals.empty()) { -//TODO std::vector AUGs; -//TODO const Type *SBP= PointerType::getUnqual(Type::getInt8Ty(Context)); -//TODO for (SmallSetVector::iterator -//TODO AI = AttributeUsedGlobals.begin(), -//TODO AE = AttributeUsedGlobals.end(); AI != AE; ++AI) { -//TODO Constant *C = *AI; -//TODO AUGs.push_back(TheFolder->CreateBitCast(C, SBP)); -//TODO } -//TODO -//TODO ArrayType *AT = ArrayType::get(SBP, AUGs.size()); -//TODO Constant *Init = ConstantArray::get(AT, AUGs); -//TODO GlobalValue *gv = new GlobalVariable(*TheModule, AT, false, -//TODO GlobalValue::AppendingLinkage, Init, -//TODO "llvm.used"); -//TODO gv->setSection("llvm.metadata"); -//TODO AttributeUsedGlobals.clear(); -//TODO } -//TODO -//TODO if (!AttributeCompilerUsedGlobals.empty()) { -//TODO std::vector ACUGs; -//TODO const Type *SBP= PointerType::getUnqual(Type::getInt8Ty(Context)); -//TODO for (SmallSetVector::iterator -//TODO AI = AttributeCompilerUsedGlobals.begin(), -//TODO AE = AttributeCompilerUsedGlobals.end(); AI != AE; ++AI) { -//TODO Constant *C = *AI; -//TODO ACUGs.push_back(TheFolder->CreateBitCast(C, SBP)); -//TODO } -//TODO -//TODO ArrayType *AT = ArrayType::get(SBP, ACUGs.size()); -//TODO Constant *Init = ConstantArray::get(AT, ACUGs); -//TODO GlobalValue *gv = new GlobalVariable(*TheModule, AT, false, -//TODO GlobalValue::AppendingLinkage, Init, -//TODO "llvm.compiler.used"); -//TODO gv->setSection("llvm.metadata"); -//TODO AttributeCompilerUsedGlobals.clear(); -//TODO } -//TODO -//TODO // Add llvm.global.annotations -//TODO if (!AttributeAnnotateGlobals.empty()) { -//TODO Constant *Array = ConstantArray::get( -//TODO ArrayType::get(AttributeAnnotateGlobals[0]->getType(), -//TODO AttributeAnnotateGlobals.size()), -//TODO AttributeAnnotateGlobals); -//TODO GlobalValue *gv = new GlobalVariable(*TheModule, Array->getType(), false, -//TODO GlobalValue::AppendingLinkage, Array, -//TODO "llvm.global.annotations"); -//TODO gv->setSection("llvm.metadata"); -//TODO AttributeAnnotateGlobals.clear(); -//TODO } -//TODO -//TODO // Finish off the per-function pass. -//TODO if (PerFunctionPasses) -//TODO PerFunctionPasses->doFinalization(); -//TODO + + // Add an llvm.global_ctors global if needed. + if (!StaticCtors.empty()) + CreateStructorsList(StaticCtors, "llvm.global_ctors"); + // Add an llvm.global_dtors global if needed. + if (!StaticDtors.empty()) + CreateStructorsList(StaticDtors, "llvm.global_dtors"); + + if (!AttributeUsedGlobals.empty()) { + std::vector AUGs; + const Type *SBP= PointerType::getUnqual(Type::getInt8Ty(Context)); + for (SmallSetVector::iterator + AI = AttributeUsedGlobals.begin(), + AE = AttributeUsedGlobals.end(); AI != AE; ++AI) { + Constant *C = *AI; + AUGs.push_back(TheFolder->CreateBitCast(C, SBP)); + } + + ArrayType *AT = ArrayType::get(SBP, AUGs.size()); + Constant *Init = ConstantArray::get(AT, AUGs); + GlobalValue *gv = new GlobalVariable(*TheModule, AT, false, + GlobalValue::AppendingLinkage, Init, + "llvm.used"); + gv->setSection("llvm.metadata"); + AttributeUsedGlobals.clear(); + } + + if (!AttributeCompilerUsedGlobals.empty()) { + std::vector ACUGs; + const Type *SBP= PointerType::getUnqual(Type::getInt8Ty(Context)); + for (SmallSetVector::iterator + AI = AttributeCompilerUsedGlobals.begin(), + AE = AttributeCompilerUsedGlobals.end(); AI != AE; ++AI) { + Constant *C = *AI; + ACUGs.push_back(TheFolder->CreateBitCast(C, SBP)); + } + + ArrayType *AT = ArrayType::get(SBP, ACUGs.size()); + Constant *Init = ConstantArray::get(AT, ACUGs); + GlobalValue *gv = new GlobalVariable(*TheModule, AT, false, + GlobalValue::AppendingLinkage, Init, + "llvm.compiler.used"); + gv->setSection("llvm.metadata"); + AttributeCompilerUsedGlobals.clear(); + } + + // Add llvm.global.annotations + if (!AttributeAnnotateGlobals.empty()) { + Constant *Array = ConstantArray::get( + ArrayType::get(AttributeAnnotateGlobals[0]->getType(), + AttributeAnnotateGlobals.size()), + AttributeAnnotateGlobals); + GlobalValue *gv = new GlobalVariable(*TheModule, Array->getType(), false, + GlobalValue::AppendingLinkage, Array, + "llvm.global.annotations"); + gv->setSection("llvm.metadata"); + AttributeAnnotateGlobals.clear(); + } + + // Finish off the per-function pass. + if (PerFunctionPasses) + PerFunctionPasses->doFinalization(); + //TODO // Emit intermediate file before module level optimization passes are run. //TODO if (flag_debug_llvm_module_opt) { //TODO @@ -975,14 +1015,14 @@ //TODO IntermediatePM->add(new TargetData(*TheTarget->getTargetData())); //TODO //TODO char asm_intermediate_out_filename[MAXPATHLEN]; -//TODO strcpy(&asm_intermediate_out_filename[0], asm_file_name); +//TODO strcpy(&asm_intermediate_out_filename[0], llvm_asm_file_name); //TODO strcat(&asm_intermediate_out_filename[0],".0"); //TODO FILE *asm_intermediate_out_file = fopen(asm_intermediate_out_filename, "w+b"); //TODO AsmIntermediateOutStream = new oFILEstream(asm_intermediate_out_file); //TODO raw_ostream *AsmIntermediateRawOutStream = //TODO new raw_os_ostream(*AsmIntermediateOutStream); //TODO if (emit_llvm_bc) -//TODO IntermediatePM->add(CreateBitcodeWriterPass(*AsmIntermediateOutStream)); +//TODO IntermediatePM->add(createBitcodeWriterPass(*AsmIntermediateOutStream)); //TODO if (emit_llvm) //TODO IntermediatePM->add(createPrintModulePass(AsmIntermediateRawOutStream)); //TODO IntermediatePM->run(*TheModule); @@ -994,32 +1034,31 @@ //TODO delete AsmIntermediateOutStream; //TODO AsmIntermediateOutStream = 0; //TODO } -//TODO -//TODO // Run module-level optimizers, if any are present. -//TODO createPerModuleOptimizationPasses(); -//TODO if (PerModulePasses) -//TODO PerModulePasses->run(*TheModule); -//TODO -//TODO // Run the code generator, if present. -//TODO if (CodeGenPasses) { -//TODO CodeGenPasses->doInitialization(); -//TODO for (Module::iterator I = TheModule->begin(), E = TheModule->end(); -//TODO I != E; ++I) -//TODO if (!I->isDeclaration()) -//TODO CodeGenPasses->run(*I); -//TODO CodeGenPasses->doFinalization(); -//TODO } -//TODO -//TODO AsmOutRawStream->flush(); -//TODO AsmOutStream->flush(); -//TODO fflush(asm_out_file); + + // Run module-level optimizers, if any are present. + createPerModuleOptimizationPasses(); + if (PerModulePasses) + PerModulePasses->run(*TheModule); + + // Run the code generator, if present. + if (CodeGenPasses) { + CodeGenPasses->doInitialization(); + for (Module::iterator I = TheModule->begin(), E = TheModule->end(); + I != E; ++I) + if (!I->isDeclaration()) + CodeGenPasses->run(*I); + CodeGenPasses->doFinalization(); + } + + FormattedOutStream.flush(); + OutStream->flush(); //TODO delete AsmOutRawStream; //TODO AsmOutRawStream = 0; //TODO delete AsmOutStream; //TODO AsmOutStream = 0; //TODO timevar_pop(TV_LLVM_PERFILE); -//TODO} -//TODO +} + //TODO// llvm_call_llvm_shutdown - Release LLVM global state. //TODOvoid llvm_call_llvm_shutdown(void) { //TODO llvm_shutdown(); @@ -1897,13 +1936,13 @@ Function *Fn = Emitter.EmitFunction(); //TODO performLateBackendInitialization(); -//TODO createPerFunctionOptimizationPasses(); -//TODO -//TODO if (PerFunctionPasses) -//TODO PerFunctionPasses->run(*Fn); -//TODO -//TODO // TODO: Nuke the .ll code for the function at -O[01] if we don't want to -//TODO // inline it or something else. + createPerFunctionOptimizationPasses(); + + if (PerFunctionPasses) + PerFunctionPasses->run(*Fn); + + // TODO: Nuke the .ll code for the function at -O[01] if we don't want to + // inline it or something else. // Finally, we have written out this function! TREE_ASM_WRITTEN(current_function_decl) = 1; @@ -1919,6 +1958,31 @@ return 0; } +/// TakeoverAsmOutput - Obtain exclusive use of the assembly code output file. +/// Any GCC output will be thrown away. +static void TakeoverAsmOutput(void) { + // Calculate the output file name as in init_asm_output (toplev.c). + if (!dump_base_name && main_input_filename) + dump_base_name = main_input_filename[0] ? main_input_filename : "gccdump"; + + if (!main_input_filename && !asm_file_name) { + llvm_asm_file_name = "-"; + } else if (!asm_file_name) { + int len = strlen (dump_base_name); + char *dumpname = XNEWVEC (char, len + 6); + + memcpy (dumpname, dump_base_name, len + 1); + strip_off_ending (dumpname, len); + strcat (dumpname, ".s"); + llvm_asm_file_name = dumpname; + } else { + llvm_asm_file_name = asm_file_name; + } + + // Redirect any GCC output to /dev/null. + asm_file_name = HOST_BIT_BUCKET; +} + /// pass_emit_llvm - RTL pass that turns gimple functions into LLVM IR. static struct rtl_opt_pass pass_emit_llvm = { @@ -2037,6 +2101,9 @@ // Provide our version and help information. register_callback (plugin_name, PLUGIN_INFO, NULL, &llvm_plugin_info); + // Obtain exclusive use of the assembly code output file. + TakeoverAsmOutput(); + // Replace rtl expansion with gimple to LLVM conversion. pass_info.pass = &pass_emit_llvm.pass; pass_info.reference_pass_name = "expand"; @@ -2067,5 +2134,8 @@ register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); } + // Finish the .s file. + register_callback (plugin_name, PLUGIN_FINISH_UNIT, llvm_finish_unit, NULL); + return 0; } From baldrick at free.fr Tue Aug 25 12:26:03 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 25 Aug 2009 17:26:03 -0000 Subject: [llvm-commits] [gcc-plugin] r80005 - /gcc-plugin/trunk/llvm-backend.cpp Message-ID: <200908251726.n7PHQ33Q015938@zion.cs.uiuc.edu> Author: baldrick Date: Tue Aug 25 12:26:03 2009 New Revision: 80005 URL: http://llvm.org/viewvc/llvm-project?rev=80005&view=rev Log: Remove some unneeded name space qualifiers. Modified: gcc-plugin/trunk/llvm-backend.cpp Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=80005&r1=80004&r2=80005&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Tue Aug 25 12:26:03 2009 @@ -109,8 +109,8 @@ TargetMachine *TheTarget = 0; TargetFolder *TheFolder = 0; TypeConverter *TheTypeConverter = 0; -llvm::raw_ostream *OutStream = 0; // Stream to write assembly code to. -llvm::formatted_raw_ostream FormattedOutStream; +raw_ostream *OutStream = 0; // Stream to write assembly code to. +formatted_raw_ostream FormattedOutStream; static bool DisableLLVMOptimizations = false;//TODO static bool emit_llvm = false;//TODO From resistor at mac.com Tue Aug 25 12:26:32 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 25 Aug 2009 17:26:32 -0000 Subject: [llvm-commits] [llvm] r80006 - /llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Message-ID: <200908251726.n7PHQW6n016016@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 25 12:26:32 2009 New Revision: 80006 URL: http://llvm.org/viewvc/llvm-project?rev=80006&view=rev Log: Pull out this predicate loop into a helper function. Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=80006&r1=80005&r2=80006&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Tue Aug 25 12:26:32 2009 @@ -361,6 +361,17 @@ return newFunction; } +static BasicBlock* FindPhiPredForUseInBlock(Value* Used, BasicBlock* BB) { + for (Value::use_iterator UI = Used->use_begin(), + UE = Used->use_end(); UI != UE; ++UI) { + PHINode *P = dyn_cast(*UI); + if (P && P->getParent() == BB) + return P->getIncomingBlock(UI); + } + + return 0; +} + /// emitCallAndSwitchStatement - This method sets up the caller side by adding /// the call instruction, splitting any PHI nodes in the header block as /// necessary. @@ -540,17 +551,10 @@ // then we need to test for dominance of the phi's predecessor // instead. Unfortunately, this a little complicated since we // have already rewritten uses of the value to uses of the reload. - for (Value::use_iterator UI = Reloads[out]->use_begin(), - UE = Reloads[out]->use_end(); UI != UE; ++UI) { - PHINode *P = dyn_cast(*UI); - if (!P || P->getParent() != OldTarget) continue; - - BasicBlock* pred = P->getIncomingBlock(UI); - if (DT->dominates(DefBlock, pred)) { - DominatesDef = true; - break; - } - } + BasicBlock* pred = FindPhiPredForUseInBlock(Reloads[out], + OldTarget); + if (pred && DT && DT->dominates(DefBlock, pred)) + DominatesDef = true; } if (DominatesDef) { From resistor at mac.com Tue Aug 25 12:35:37 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 25 Aug 2009 17:35:37 -0000 Subject: [llvm-commits] [llvm] r80007 - /llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Message-ID: <200908251735.n7PHZbGM017275@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 25 12:35:37 2009 New Revision: 80007 URL: http://llvm.org/viewvc/llvm-project?rev=80007&view=rev Log: Switch to SmallVector. Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=80007&r1=80006&r2=80007&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Tue Aug 25 12:35:37 2009 @@ -189,14 +189,14 @@ // Old dominates New. New node domiantes all other nodes dominated //by Old. DomTreeNode *OldNode = DT->getNode(*I); - std::vector Children; + SmallVector Children; for (DomTreeNode::iterator DI = OldNode->begin(), DE = OldNode->end(); DI != DE; ++DI) Children.push_back(*DI); DomTreeNode *NewNode = DT->addNewBlock(New, *I); - for (std::vector::iterator I = Children.begin(), + for (SmallVector::iterator I = Children.begin(), E = Children.end(); I != E; ++I) DT->changeImmediateDominator(*I, NewNode); } From clattner at apple.com Tue Aug 25 12:36:42 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 25 Aug 2009 10:36:42 -0700 Subject: [llvm-commits] [llvm] r80006 - /llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp In-Reply-To: <200908251726.n7PHQW6n016016@zion.cs.uiuc.edu> References: <200908251726.n7PHQW6n016016@zion.cs.uiuc.edu> Message-ID: <0BEF52BC-8B89-406D-9700-E49E4385D093@apple.com> On Aug 25, 2009, at 10:26 AM, Owen Anderson wrote: > Author: resistor > Date: Tue Aug 25 12:26:32 2009 > New Revision: 80006 > > URL: http://llvm.org/viewvc/llvm-project?rev=80006&view=rev > Log: > Pull out this predicate loop into a helper function. Great, now the other loop too? How about some doxygen comments? :) Thanks Owen, -Chris > > Modified: > llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp > > Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=80006&r1=80005&r2=80006&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Tue Aug 25 > 12:26:32 2009 > @@ -361,6 +361,17 @@ > return newFunction; > } > > +static BasicBlock* FindPhiPredForUseInBlock(Value* Used, > BasicBlock* BB) { > + for (Value::use_iterator UI = Used->use_begin(), > + UE = Used->use_end(); UI != UE; ++UI) { > + PHINode *P = dyn_cast(*UI); > + if (P && P->getParent() == BB) > + return P->getIncomingBlock(UI); > + } > + > + return 0; > +} > + > /// emitCallAndSwitchStatement - This method sets up the caller side > by adding > /// the call instruction, splitting any PHI nodes in the header > block as > /// necessary. > @@ -540,17 +551,10 @@ > // then we need to test for dominance of the phi's > predecessor > // instead. Unfortunately, this a little complicated > since we > // have already rewritten uses of the value to uses of > the reload. > - for (Value::use_iterator UI = Reloads[out]->use_begin > (), > - UE = Reloads[out]->use_end(); UI != UE; ++UI) { > - PHINode *P = dyn_cast(*UI); > - if (!P || P->getParent() != OldTarget) continue; > - > - BasicBlock* pred = P->getIncomingBlock(UI); > - if (DT->dominates(DefBlock, pred)) { > - DominatesDef = true; > - break; > - } > - } > + BasicBlock* pred = FindPhiPredForUseInBlock(Reloads > [out], > + OldTarget); > + if (pred && DT && DT->dominates(DefBlock, pred)) > + DominatesDef = true; > } > > if (DominatesDef) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From daniel at zuster.org Tue Aug 25 12:41:20 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 25 Aug 2009 10:41:20 -0700 Subject: [llvm-commits] [llvm] r79615 - in /llvm/trunk/test/Analysis/Profiling: ./ 2009-08-21-irregular-loop.ll 2009-08-21-only-one-block.ll 2009-08-21-several-blocks.ll dg.exp In-Reply-To: <4A93E042.60707@student.tuwien.ac.at> References: <200908210936.n7L9aScH013127@zion.cs.uiuc.edu> <76A6DF93-A31D-470D-8504-A9FB859FD2B8@apple.com> <4A8EBD43.60501@gmx.at> <6a8523d60908241238v435742bbxbf7df11512a598c7@mail.gmail.com> <4A93E042.60707@student.tuwien.ac.at> Message-ID: <6a8523d60908251041s5eeb86a0o877457f5d958c3d6@mail.gmail.com> On Tue, Aug 25, 2009 at 5:59 AM, Andreas Neustifter wrote: >> We should solve the problem that this requires the JIT, though. A >> simple first option is to disable the test if there is no JIT support. >> A slightly better one would be to run it using the .bca version of the >> profiling information, but that of course requires that the user >> configure with llvm-gcc support. > > What is the easiest way to check if JIT is supported on a give platform > during the tests? Unfortunately I don't think we have one. Someone should step in and correct me if I am wrong! It should be straightforward albeit annoying to this to the XFAIL/XTARGET mechanisms we use, for example (implemented by test/lib/llvm.exp, in conjunction with the Makefile setting fields in the site.exp). - Daniel From resistor at mac.com Tue Aug 25 12:42:07 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 25 Aug 2009 17:42:07 -0000 Subject: [llvm-commits] [llvm] r80009 - /llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Message-ID: <200908251742.n7PHg77P018137@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 25 12:42:07 2009 New Revision: 80009 URL: http://llvm.org/viewvc/llvm-project?rev=80009&view=rev Log: Comment-ify. Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=80009&r1=80008&r2=80009&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Tue Aug 25 12:42:07 2009 @@ -361,6 +361,9 @@ return newFunction; } +/// FindPhiPredForUseInBlock - Given a value and a basic block, find a PHI +/// that uses the value within the basic block, and return the predecessor +/// block associated with that use, or return 0 if none is found. static BasicBlock* FindPhiPredForUseInBlock(Value* Used, BasicBlock* BB) { for (Value::use_iterator UI = Used->use_begin(), UE = Used->use_end(); UI != UE; ++UI) { From gohman at apple.com Tue Aug 25 12:42:10 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 17:42:10 -0000 Subject: [llvm-commits] [llvm] r80010 - in /llvm/trunk: lib/Transforms/Scalar/IndVarSimplify.cpp test/Transforms/IndVarSimplify/sink-alloca.ll Message-ID: <200908251742.n7PHgAKn018157@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 12:42:10 2009 New Revision: 80010 URL: http://llvm.org/viewvc/llvm-project?rev=80010&view=rev Log: Special-case static allocas in IndVarSimplify's loop invariant sinking code, since they are special. If the loop preheader happens to be the entry block of a function, don't sink static allocas out of it. This fixes PR4775. Added: llvm/trunk/test/Transforms/IndVarSimplify/sink-alloca.ll Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=80010&r1=80009&r2=80010&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Tue Aug 25 12:42:10 2009 @@ -553,6 +553,11 @@ // dominates the exit block. if (I->mayHaveSideEffects() || I->mayReadFromMemory()) continue; + // Don't sink static AllocaInsts out of the entry block, which would + // turn them into dynamic allocas! + if (AllocaInst *AI = dyn_cast(I)) + if (AI->isStaticAlloca()) + continue; // Determine if there is a use in or before the loop (direct or // otherwise). bool UsedInLoop = false; Added: llvm/trunk/test/Transforms/IndVarSimplify/sink-alloca.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/sink-alloca.ll?rev=80010&view=auto ============================================================================== --- llvm/trunk/test/Transforms/IndVarSimplify/sink-alloca.ll (added) +++ llvm/trunk/test/Transforms/IndVarSimplify/sink-alloca.ll Tue Aug 25 12:42:10 2009 @@ -0,0 +1,31 @@ +; RUN: llvm-as < %s | opt -indvars | llvm-dis | FileCheck %s +; PR4775 + +; Indvars shouldn't sink the alloca out of the entry block, even though +; it's not used until after the loop. + +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-darwin10.0" + + at llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @main to i8*)], +section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] + +define i32 @main() nounwind { +; CHECK: entry: +; CHECK-NEXT: %result.i = alloca i32, align 4 +entry: + %result.i = alloca i32, align 4 ; [#uses=2] + br label %while.cond + +while.cond: ; preds = %while.cond, %entry + %call = call i32 @bar() nounwind ; [#uses=1] + %tobool = icmp eq i32 %call, 0 ; [#uses=1] + br i1 %tobool, label %while.end, label %while.cond + +while.end: ; preds = %while.cond + volatile store i32 0, i32* %result.i + %tmp.i = volatile load i32* %result.i ; [#uses=0] + ret i32 0 +} + +declare i32 @bar() From bob.wilson at apple.com Tue Aug 25 12:46:06 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 25 Aug 2009 17:46:06 -0000 Subject: [llvm-commits] [llvm] r80011 - in /llvm/trunk/lib/Target/ARM: ARMInstrFormats.td ARMInstrNEON.td Message-ID: <200908251746.n7PHk6FB018706@zion.cs.uiuc.edu> Author: bwilson Date: Tue Aug 25 12:46:06 2009 New Revision: 80011 URL: http://llvm.org/viewvc/llvm-project?rev=80011&view=rev Log: Expose the instruction contraint string as an argument to the NLdSt class. Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=80011&r1=80010&r2=80011&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Tue Aug 25 12:46:06 2009 @@ -1212,8 +1212,8 @@ } class NLdSt pattern> - : NeonI { + string asm, string cstr, list pattern> + : NeonI { let Inst{31-24} = 0b11110100; } Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=80011&r1=80010&r2=80011&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Tue Aug 25 12:46:06 2009 @@ -183,14 +183,12 @@ // VLD1 : Vector Load (multiple single elements) class VLD1D - : NLdSt<(outs DPR:$dst), (ins addrmode6:$addr), - NoItinerary, - !strconcat(OpcodeStr, "\t\\{$dst\\}, $addr"), + : NLdSt<(outs DPR:$dst), (ins addrmode6:$addr), NoItinerary, + !strconcat(OpcodeStr, "\t\\{$dst\\}, $addr"), "", [(set DPR:$dst, (Ty (IntOp addrmode6:$addr)))]>; class VLD1Q - : NLdSt<(outs QPR:$dst), (ins addrmode6:$addr), - NoItinerary, - !strconcat(OpcodeStr, "\t${dst:dregpair}, $addr"), + : NLdSt<(outs QPR:$dst), (ins addrmode6:$addr), NoItinerary, + !strconcat(OpcodeStr, "\t${dst:dregpair}, $addr"), "", [(set QPR:$dst, (Ty (IntOp addrmode6:$addr)))]>; def VLD1d8 : VLD1D<"vld1.8", v8i8, int_arm_neon_vld1>; @@ -209,9 +207,8 @@ // VLD2 : Vector Load (multiple 2-element structures) class VLD2D - : NLdSt<(outs DPR:$dst1, DPR:$dst2), (ins addrmode6:$addr), - NoItinerary, - !strconcat(OpcodeStr, "\t\\{$dst1,$dst2\\}, $addr"), []>; + : NLdSt<(outs DPR:$dst1, DPR:$dst2), (ins addrmode6:$addr), NoItinerary, + !strconcat(OpcodeStr, "\t\\{$dst1,$dst2\\}, $addr"), "", []>; def VLD2d8 : VLD2D<"vld2.8">; def VLD2d16 : VLD2D<"vld2.16">; @@ -221,7 +218,7 @@ class VLD3D : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3), (ins addrmode6:$addr), NoItinerary, - !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3\\}, $addr"), []>; + !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3\\}, $addr"), "", []>; def VLD3d8 : VLD3D<"vld3.8">; def VLD3d16 : VLD3D<"vld3.16">; @@ -230,9 +227,9 @@ // VLD4 : Vector Load (multiple 4-element structures) class VLD4D : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4), - (ins addrmode6:$addr), - NoItinerary, - !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"), []>; + (ins addrmode6:$addr), NoItinerary, + !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"), + "", []>; def VLD4d8 : VLD4D<"vld4.8">; def VLD4d16 : VLD4D<"vld4.16">; @@ -241,14 +238,12 @@ // VST1 : Vector Store (multiple single elements) class VST1D - : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src), - NoItinerary, - !strconcat(OpcodeStr, "\t\\{$src\\}, $addr"), + : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src), NoItinerary, + !strconcat(OpcodeStr, "\t\\{$src\\}, $addr"), "", [(IntOp addrmode6:$addr, (Ty DPR:$src))]>; class VST1Q - : NLdSt<(outs), (ins addrmode6:$addr, QPR:$src), - NoItinerary, - !strconcat(OpcodeStr, "\t${src:dregpair}, $addr"), + : NLdSt<(outs), (ins addrmode6:$addr, QPR:$src), NoItinerary, + !strconcat(OpcodeStr, "\t${src:dregpair}, $addr"), "", [(IntOp addrmode6:$addr, (Ty QPR:$src))]>; def VST1d8 : VST1D<"vst1.8", v8i8, int_arm_neon_vst1>; @@ -268,7 +263,7 @@ // VST2 : Vector Store (multiple 2-element structures) class VST2D : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2), NoItinerary, - !strconcat(OpcodeStr, "\t\\{$src1,$src2\\}, $addr"), []>; + !strconcat(OpcodeStr, "\t\\{$src1,$src2\\}, $addr"), "", []>; def VST2d8 : VST2D<"vst2.8">; def VST2d16 : VST2D<"vst2.16">; @@ -278,7 +273,7 @@ class VST3D : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3), NoItinerary, - !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3\\}, $addr"), []>; + !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3\\}, $addr"), "", []>; def VST3d8 : VST3D<"vst3.8">; def VST3d16 : VST3D<"vst3.16">; @@ -288,7 +283,8 @@ class VST4D : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4), NoItinerary, - !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"), []>; + !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"), + "", []>; def VST4d8 : VST4D<"vst4.8">; def VST4d16 : VST4D<"vst4.16">; From gohman at apple.com Tue Aug 25 12:47:44 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 17:47:44 -0000 Subject: [llvm-commits] [llvm] r80012 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200908251747.n7PHlit8018935@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 12:47:44 2009 New Revision: 80012 URL: http://llvm.org/viewvc/llvm-project?rev=80012&view=rev Log: Use X86II::MO_NO_FLAG. Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=80012&r1=80011&r2=80012&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Aug 25 12:47:44 2009 @@ -79,7 +79,8 @@ X86ISelAddressMode() : BaseType(RegBase), Scale(1), IndexReg(), Disp(0), - Segment(), GV(0), CP(0), ES(0), JT(-1), Align(0), SymbolFlags(0) { + Segment(), GV(0), CP(0), ES(0), JT(-1), Align(0), + SymbolFlags(X86II::MO_NO_FLAG) { } bool hasSymbolicDisplacement() const { @@ -821,7 +822,7 @@ AM.BaseType == X86ISelAddressMode::RegBase && AM.Base.Reg.getNode() == 0 && AM.IndexReg.getNode() == 0 && - AM.SymbolFlags == 0 && + AM.SymbolFlags == X86II::MO_NO_FLAG && AM.hasSymbolicDisplacement()) AM.Base.Reg = CurDAG->getRegister(X86::RIP, MVT::i64); From gohman at apple.com Tue Aug 25 12:48:18 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 17:48:18 -0000 Subject: [llvm-commits] [llvm] r80013 - in /llvm/trunk/tools: llc/llc.cpp lto/LTOCodeGenerator.cpp Message-ID: <200908251748.n7PHmIFZ019010@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 12:48:17 2009 New Revision: 80013 URL: http://llvm.org/viewvc/llvm-project?rev=80013&view=rev Log: Delete some unnecessary flushes. Modified: llvm/trunk/tools/llc/llc.cpp llvm/trunk/tools/lto/LTOCodeGenerator.cpp Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=80013&r1=80012&r2=80013&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Tue Aug 25 12:48:17 2009 @@ -397,8 +397,6 @@ Passes.doFinalization(); } - Out->flush(); - // Delete the ostream if it's not a stdout stream if (Out != &fouts()) delete Out; Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=80013&r1=80012&r2=80013&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original) +++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Tue Aug 25 12:48:17 2009 @@ -469,8 +469,6 @@ codeGenPasses->doFinalization(); - out.flush(); - return false; // success } From gohman at apple.com Tue Aug 25 12:49:57 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 17:49:57 -0000 Subject: [llvm-commits] [llvm] r80014 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200908251749.n7PHnvlg019226@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 12:49:57 2009 New Revision: 80014 URL: http://llvm.org/viewvc/llvm-project?rev=80014&view=rev Log: Teach ScalarEvolution about GlobalAliases. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=80014&r1=80013&r2=80014&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Aug 25 12:49:57 2009 @@ -63,6 +63,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/GlobalVariable.h" +#include "llvm/GlobalAlias.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" #include "llvm/Operator.h" @@ -2906,6 +2907,8 @@ return getIntegerSCEV(0, V->getType()); else if (isa(V)) return getIntegerSCEV(0, V->getType()); + else if (GlobalAlias *GA = dyn_cast(V)) + return GA->mayBeOverridden() ? getUnknown(V) : getSCEV(GA->getAliasee()); else return getUnknown(V); From bob.wilson at apple.com Tue Aug 25 12:52:39 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 25 Aug 2009 17:52:39 -0000 Subject: [llvm-commits] [llvm] r80015 - /llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Message-ID: <200908251752.n7PHqdK7019589@zion.cs.uiuc.edu> Author: bwilson Date: Tue Aug 25 12:52:39 2009 New Revision: 80015 URL: http://llvm.org/viewvc/llvm-project?rev=80015&view=rev Log: Remove some unused SDNode definitions. Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=80015&r1=80014&r2=80015&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Tue Aug 25 12:52:39 2009 @@ -73,33 +73,6 @@ SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisVec<1>, SDTCisVT<2, i32>]>>; -def SDTARMVLD2 : SDTypeProfile<2, 1, [SDTCisSameAs<0, 1>, SDTCisPtrTy<2>]>; -def SDTARMVLD3 : SDTypeProfile<3, 1, [SDTCisSameAs<0, 1>, - SDTCisSameAs<0, 2>, SDTCisPtrTy<3>]>; -def SDTARMVLD4 : SDTypeProfile<4, 1, [SDTCisSameAs<0, 1>, - SDTCisSameAs<0, 2>, - SDTCisSameAs<0, 3>, SDTCisPtrTy<4>]>; -def NEONvld2d : SDNode<"ARMISD::VLD2D", SDTARMVLD2, - [SDNPHasChain, SDNPMayLoad]>; -def NEONvld3d : SDNode<"ARMISD::VLD3D", SDTARMVLD3, - [SDNPHasChain, SDNPMayLoad]>; -def NEONvld4d : SDNode<"ARMISD::VLD4D", SDTARMVLD4, - [SDNPHasChain, SDNPMayLoad]>; - -def SDTARMVST2 : SDTypeProfile<0, 3, [SDTCisPtrTy<0>, SDTCisSameAs<1, 2>]>; -def SDTARMVST3 : SDTypeProfile<0, 4, [SDTCisPtrTy<0>, SDTCisSameAs<1, 2>, - SDTCisSameAs<1, 3>]>; -def SDTARMVST4 : SDTypeProfile<0, 5, [SDTCisPtrTy<0>, SDTCisSameAs<1, 2>, - SDTCisSameAs<1, 3>, - SDTCisSameAs<1, 4>]>; - -def NEONvst2d : SDNode<"ARMISD::VST2D", SDTARMVST2, - [SDNPHasChain, SDNPMayStore]>; -def NEONvst3d : SDNode<"ARMISD::VST3D", SDTARMVST3, - [SDNPHasChain, SDNPMayStore]>; -def NEONvst4d : SDNode<"ARMISD::VST4D", SDTARMVST4, - [SDNPHasChain, SDNPMayStore]>; - def SDTARMVEXT : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>; def NEONvext : SDNode<"ARMISD::VEXT", SDTARMVEXT>; From clattner at apple.com Tue Aug 25 12:56:10 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 25 Aug 2009 10:56:10 -0700 Subject: [llvm-commits] [llvm] r79615 - in /llvm/trunk/test/Analysis/Profiling: ./ 2009-08-21-irregular-loop.ll 2009-08-21-only-one-block.ll 2009-08-21-several-blocks.ll dg.exp In-Reply-To: <6a8523d60908251041s5eeb86a0o877457f5d958c3d6@mail.gmail.com> References: <200908210936.n7L9aScH013127@zion.cs.uiuc.edu> <76A6DF93-A31D-470D-8504-A9FB859FD2B8@apple.com> <4A8EBD43.60501@gmx.at> <6a8523d60908241238v435742bbxbf7df11512a598c7@mail.gmail.com> <4A93E042.60707@student.tuwien.ac.at> <6a8523d60908251041s5eeb86a0o877457f5d958c3d6@mail.gmail.com> Message-ID: On Aug 25, 2009, at 10:41 AM, Daniel Dunbar wrote: > On Tue, Aug 25, 2009 at 5:59 AM, Andreas > Neustifter wrote: >>> We should solve the problem that this requires the JIT, though. A >>> simple first option is to disable the test if there is no JIT >>> support. >>> A slightly better one would be to run it using the .bca version of >>> the >>> profiling information, but that of course requires that the user >>> configure with llvm-gcc support. >> >> What is the easiest way to check if JIT is supported on a give >> platform >> during the tests? > > Unfortunately I don't think we have one. Someone should step in and > correct me if I am wrong! > > It should be straightforward albeit annoying to this to the > XFAIL/XTARGET mechanisms we use, for example (implemented by > test/lib/llvm.exp, in conjunction with the Makefile setting fields in > the site.exp). I think that llvm-config either knows or could know: my $TARGET_HAS_JIT = q{1}; Maybe it should get a new command line option? -Chris From gohman at apple.com Tue Aug 25 12:56:58 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 17:56:58 -0000 Subject: [llvm-commits] [llvm] r80017 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200908251756.n7PHuwX1020163@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 12:56:57 2009 New Revision: 80017 URL: http://llvm.org/viewvc/llvm-project?rev=80017&view=rev Log: Don't assume that two identical instructions that read from memory will always return the same value. This isn't currently necessary, since this code doesn't currently ever get called under circumstances where it would matter, but it may some day. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=80017&r1=80016&r2=80017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Aug 25 12:56:57 2009 @@ -4349,7 +4349,7 @@ if (const SCEVUnknown *BU = dyn_cast(B)) if (const Instruction *AI = dyn_cast(AU->getValue())) if (const Instruction *BI = dyn_cast(BU->getValue())) - if (AI->isIdenticalTo(BI)) + if (AI->isIdenticalTo(BI) && !AI->mayReadFromMemory()) return true; // Otherwise assume they may have a different value. From stoklund at 2pi.dk Tue Aug 25 13:00:38 2009 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 25 Aug 2009 20:00:38 +0200 Subject: [llvm-commits] [llvm] r80002 - in /llvm/trunk: lib/CodeGen/PostRASchedulerList.cpp test/CodeGen/ARM/2009-08-21-PostRAKill.ll test/CodeGen/ARM/2009-08-21-PostRAKill2.ll test/CodeGen/ARM/2009-08-21-PostRAKill3.ll In-Reply-To: <200908251703.n7PH368Z012822@zion.cs.uiuc.edu> References: <200908251703.n7PH368Z012822@zion.cs.uiuc.edu> Message-ID: On 25/08/2009, at 19.03, David Goodwin wrote: > + if (!GenerateLivenessForKills) { > + // Consider callee-saved registers as live-out, since we're > running after > + // prologue/epilogue insertion so there's no way to add > additional > + // saved registers. > + // > + // TODO: If the callee saves and restores these, then we can > potentially > + // use them between the save and the restore. To do that, we > could scan > + // the exit blocks to see which of these registers are defined. > + // Alternatively, callee-saved registers that aren't saved and > restored > + // could be marked live-in in every block. > + for (const unsigned *I = TRI->getCalleeSavedRegs(); *I; ++I) { Note that there is a new method MachineFrameInfo::getPristineRegs(MBB). It gives you a list of CSRs that have not been saved when entering the MBB. The remaining CSRs have been saved and can be treated like call clobbered registers. Marking pristine regs as live-in should take care of your TODO. That is how the register scavenger does it. /jakob From daniel at zuster.org Tue Aug 25 13:20:53 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 25 Aug 2009 11:20:53 -0700 Subject: [llvm-commits] [llvm] r79615 - in /llvm/trunk/test/Analysis/Profiling: ./ 2009-08-21-irregular-loop.ll 2009-08-21-only-one-block.ll 2009-08-21-several-blocks.ll dg.exp In-Reply-To: References: <200908210936.n7L9aScH013127@zion.cs.uiuc.edu> <76A6DF93-A31D-470D-8504-A9FB859FD2B8@apple.com> <4A8EBD43.60501@gmx.at> <6a8523d60908241238v435742bbxbf7df11512a598c7@mail.gmail.com> <4A93E042.60707@student.tuwien.ac.at> <6a8523d60908251041s5eeb86a0o877457f5d958c3d6@mail.gmail.com> Message-ID: <6a8523d60908251120q53ed9159i79679a1230174894@mail.gmail.com> On Tue, Aug 25, 2009 at 10:56 AM, Chris Lattner wrote: > > On Aug 25, 2009, at 10:41 AM, Daniel Dunbar wrote: > >> On Tue, Aug 25, 2009 at 5:59 AM, Andreas >> Neustifter wrote: >>>> >>>> We should solve the problem that this requires the JIT, though. A >>>> simple first option is to disable the test if there is no JIT support. >>>> A slightly better one would be to run it using the .bca version of the >>>> profiling information, but that of course requires that the user >>>> configure with llvm-gcc support. >>> >>> What is the easiest way to check if JIT is supported on a give platform >>> during the tests? >> >> Unfortunately I don't think we have one. Someone should step in and >> correct me if I am wrong! >> >> It should be straightforward albeit annoying to this to the >> XFAIL/XTARGET mechanisms we use, for example (implemented by >> test/lib/llvm.exp, in conjunction with the Makefile setting fields in >> the site.exp). > > I think that llvm-config either knows or could know: > > my $TARGET_HAS_JIT ? ? ?= q{1}; > > Maybe it should get a new command line option? There is still some work to suck this into DejaGNU so it knows not to run the test if the JIT isn't present. Or did you have something else in mind? - Daniel From daniel at zuster.org Tue Aug 25 13:45:03 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 25 Aug 2009 18:45:03 -0000 Subject: [llvm-commits] [llvm] r80019 - /llvm/trunk/test/CodeGen/X86/abi-isel.ll Message-ID: <200908251845.n7PIj42L026279@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 13:45:03 2009 New Revision: 80019 URL: http://llvm.org/viewvc/llvm-project?rev=80019&view=rev Log: Switch abi-isel.ll to FileCheck; it's not much faster, but it now tests a lot more and is much nicer to the OS. - Dan, please check. If there are parts of the test you think I should strip out so it doesn't cause random failures let me know (there are still some PIC label numbers in it, for example). Modified: llvm/trunk/test/CodeGen/X86/abi-isel.ll Modified: llvm/trunk/test/CodeGen/X86/abi-isel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/abi-isel.ll?rev=80019&r1=80018&r2=80019&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/abi-isel.ll (original) +++ llvm/trunk/test/CodeGen/X86/abi-isel.ll Tue Aug 25 13:45:03 2009 @@ -1,169 +1,16 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-unknown-linux-gnu -march=x86 -relocation-model=static -code-model=small > %t -; RUN: grep leal %t | count 33 -; RUN: grep movl %t | count 239 -; RUN: grep addl %t | count 20 -; RUN: grep subl %t | count 14 -; RUN: not grep leaq %t -; RUN: not grep movq %t -; RUN: not grep addq %t -; RUN: not grep subq %t -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: not grep _GLOBAL_OFFSET_TABLE_ %t -; RUN: not grep @GOT %t -; RUN: not grep @GOTOFF %t -; RUN: not grep @GOTPCREL %t -; RUN: not grep @GOTPLT %t -; RUN: not grep @PLT %t -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: not grep %rip %t -; RUN: llvm-as < %s | llc -mtriple=i686-unknown-linux-gnu -march=x86 -relocation-model=pic -code-model=small > %t -; RUN: grep leal %t | count 43 -; RUN: grep movl %t | count 377 -; RUN: grep addl %t | count 179 -; RUN: grep subl %t | count 6 -; RUN: not grep leaq %t -; RUN: not grep movq %t -; RUN: not grep addq %t -; RUN: not grep subq %t -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: grep _GLOBAL_OFFSET_TABLE_ %t | count 148 -; RUN: grep @GOT %t | count 207 -; RUN: grep @GOTOFF %t | count 58 -; RUN: not grep @GOTPCREL %t -; RUN: not grep @GOTPLT %t -; RUN: grep @PLT %t | count 20 -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: not grep {%rip} %t - -; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu -march=x86-64 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=LINUX-64-STATIC - -; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu -march=x86-64 -relocation-model=pic -code-model=small > %t -; RUN: not grep leal %t -; RUN: grep movl %t | count 98 -; RUN: not grep addl %t -; RUN: not grep subl %t -; RUN: grep leaq %t | count 59 -; RUN: grep movq %t | count 195 -; RUN: grep addq %t | count 36 -; RUN: grep subq %t | count 11 -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: not grep _GLOBAL_OFFSET_TABLE_ %t -; RUN: grep @GOT %t | count 149 -; RUN: not grep @GOTOFF %t -; RUN: grep @GOTPCREL %t | count 149 -; RUN: not grep @GOTPLT %t -; RUN: grep @PLT %t | count 20 -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: grep {%rip} %t | count 207 - - - -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -march=x86 -relocation-model=static -code-model=small > %t -; RUN: grep leal %t | count 33 -; RUN: grep movl %t | count 239 -; RUN: grep addl %t | count 20 -; RUN: grep subl %t | count 14 -; RUN: not grep leaq %t -; RUN: not grep movq %t -; RUN: not grep addq %t -; RUN: not grep subq %t -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: not grep _GLOBAL_OFFSET_TABLE_ %t -; RUN: not grep @GOT %t -; RUN: not grep @GOTOFF %t -; RUN: not grep @GOTPCREL %t -; RUN: not grep @GOTPLT %t -; RUN: not grep @PLT %t -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: not grep %rip %t -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -march=x86 -relocation-model=dynamic-no-pic -code-model=small > %t -; RUN: grep leal %t | count 31 -; RUN: grep movl %t | count 312 -; RUN: grep addl %t | count 32 -; RUN: grep subl %t | count 14 -; RUN: not grep leaq %t -; RUN: not grep movq %t -; RUN: not grep addq %t -; RUN: not grep subq %t -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: not grep _GLOBAL_OFFSET_TABLE_ %t -; RUN: not grep @GOT %t -; RUN: not grep @GOTOFF %t -; RUN: not grep @GOTPCREL %t -; RUN: not grep @GOTPLT %t -; RUN: not grep @PLT %t -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: not grep {%rip} %t -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -march=x86 -relocation-model=pic -code-model=small > %t -; RUN: grep leal %t | count 57 -; RUN: grep movl %t | count 292 -; RUN: grep addl %t | count 32 -; RUN: grep subl %t | count 14 -; RUN: not grep leaq %t -; RUN: not grep movq %t -; RUN: not grep addq %t -; RUN: not grep subq %t -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: not grep _GLOBAL_OFFSET_TABLE_ %t -; RUN: not grep @GOT %t -; RUN: not grep @GOTOFF %t -; RUN: not grep @GOTPCREL %t -; RUN: not grep @GOTPLT %t -; RUN: not grep @PLT %t -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: not grep {%rip} %t -; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=dynamic-no-pic -code-model=small > %t -; RUN: not grep leal %t -; RUN: grep movl %t | count 95 -; RUN: not grep addl %t -; RUN: not grep subl %t -; RUN: grep leaq %t | count 89 -; RUN: grep movq %t | count 142 -; RUN: grep addq %t | count 30 -; RUN: grep subq %t | count 12 -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: not grep _GLOBAL_OFFSET_TABLE_ %t -; RUN: grep @GOT %t | count 92 -; RUN: not grep @GOTOFF %t -; RUN: grep @GOTPCREL %t | count 92 -; RUN: not grep @GOTPLT %t -; RUN: not grep @PLT %t -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: grep {%rip} %t | count 208 -; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=pic -code-model=small > %t -; RUN: not grep leal %t -; RUN: grep movl %t | count 95 -; RUN: not grep addl %t -; RUN: not grep subl %t -; RUN: grep leaq %t | count 89 -; RUN: grep movq %t | count 142 -; RUN: grep addq %t | count 30 -; RUN: grep subq %t | count 12 -; RUN: not grep movabs %t -; RUN: not grep largecomm %t -; RUN: not grep _GLOBAL_OFFSET_TABLE_ %t -; RUN: grep @GOT %t | count 92 -; RUN: not grep @GOTOFF %t -; RUN: grep @GOTPCREL %t | count 92 -; RUN: not grep @GOTPLT %t -; RUN: not grep @PLT %t -; RUN: not grep @PLTOFF %t -; RUN: grep {call \\\*} %t | count 10 -; RUN: grep {%rip} %t | count 208 +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=i686-unknown-linux-gnu -march=x86 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=LINUX-32-STATIC +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=i686-unknown-linux-gnu -march=x86 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=LINUX-32-PIC + +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=x86_64-unknown-linux-gnu -march=x86-64 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=LINUX-64-STATIC +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=x86_64-unknown-linux-gnu -march=x86-64 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=LINUX-64-PIC + +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=i686-apple-darwin -march=x86 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=DARWIN-32-STATIC +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=i686-apple-darwin -march=x86 -relocation-model=dynamic-no-pic -code-model=small | FileCheck %s -check-prefix=DARWIN-32-DYNAMIC +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=i686-apple-darwin -march=x86 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=DARWIN-32-PIC + +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=DARWIN-64-STATIC +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=dynamic-no-pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-DYNAMIC +; RUN: llvm-as < %s | llc -asm-verbose=0 -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-PIC @src = external global [131072 x i32] @dst = external global [131072 x i32] @@ -194,6 +41,66 @@ ; LINUX-64-STATIC: movl src(%rip), %eax ; LINUX-64-STATIC: movl %eax, dst ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo00: +; LINUX-32-STATIC: movl src, %eax +; LINUX-32-STATIC-NEXT: movl %eax, dst +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo00: +; LINUX-32-PIC: movl src, %eax +; LINUX-32-PIC-NEXT: movl %eax, dst +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax), %eax +; LINUX-64-PIC-NEXT: movq dst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo00: +; DARWIN-32-STATIC: movl _src, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _dst +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo00: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo00: +; DARWIN-32-PIC: call "L1$pb" +; DARWIN-32-PIC-NEXT: "L1$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L1$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L1$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax), %eax +; DARWIN-64-PIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @fxo00() nounwind { @@ -206,6 +113,66 @@ ; LINUX-64-STATIC: movl xsrc(%rip), %eax ; LINUX-64-STATIC: movl %eax, xdst ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: fxo00: +; LINUX-32-STATIC: movl xsrc, %eax +; LINUX-32-STATIC-NEXT: movl %eax, xdst +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: fxo00: +; LINUX-32-PIC: movl xsrc, %eax +; LINUX-32-PIC-NEXT: movl %eax, xdst +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: fxo00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax), %eax +; LINUX-64-PIC-NEXT: movq xdst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _fxo00: +; DARWIN-32-STATIC: movl _xsrc, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _xdst +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _fxo00: +; DARWIN-32-DYNAMIC: movl L_xsrc$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _fxo00: +; DARWIN-32-PIC: call "L2$pb" +; DARWIN-32-PIC-NEXT: "L2$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L2$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L2$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _fxo00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _fxo00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _fxo00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax), %eax +; DARWIN-64-PIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @foo01() nounwind { @@ -215,6 +182,57 @@ ; LINUX-64-STATIC: foo01: ; LINUX-64-STATIC: movq $dst, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo01: +; LINUX-32-STATIC: movl $dst, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo01: +; LINUX-32-PIC: movl $dst, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo01: +; DARWIN-32-STATIC: movl $_dst, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo01: +; DARWIN-32-DYNAMIC: movl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo01: +; DARWIN-32-PIC: call "L3$pb" +; DARWIN-32-PIC-NEXT: "L3$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L3$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L3$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @fxo01() nounwind { @@ -224,6 +242,57 @@ ; LINUX-64-STATIC: fxo01: ; LINUX-64-STATIC: movq $xdst, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: fxo01: +; LINUX-32-STATIC: movl $xdst, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: fxo01: +; LINUX-32-PIC: movl $xdst, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: fxo01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _fxo01: +; DARWIN-32-STATIC: movl $_xdst, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _fxo01: +; DARWIN-32-DYNAMIC: movl L_xdst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _fxo01: +; DARWIN-32-PIC: call "L4$pb" +; DARWIN-32-PIC-NEXT: "L4$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L4$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L4$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _fxo01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _fxo01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _fxo01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @foo02() nounwind { @@ -237,6 +306,75 @@ ; LINUX-64-STATIC: movq ptr(%rip), % ; LINUX-64-STATIC: movl ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo02: +; LINUX-32-STATIC: movl src, %eax +; LINUX-32-STATIC-NEXT: movl ptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, (%ecx) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo02: +; LINUX-32-PIC: movl src, %eax +; LINUX-32-PIC-NEXT: movl ptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, (%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo02: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo02: +; DARWIN-32-STATIC: movl _src, %eax +; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo02: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo02: +; DARWIN-32-PIC: call "L5$pb" +; DARWIN-32-PIC-NEXT: "L5$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L5$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L5$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo02: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo02: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo02: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @fxo02() nounwind { @@ -249,7 +387,76 @@ ; LINUX-64-STATIC: movq ptr(%rip), % ; LINUX-64-STATIC: movl ; LINUX-64-STATIC: ret - ret void + +; LINUX-32-STATIC: fxo02: +; LINUX-32-STATIC: movl xsrc, %eax +; LINUX-32-STATIC-NEXT: movl ptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, (%ecx) +; LINUX-32-STATIC-NEXT: ret + ret void + +; LINUX-32-PIC: fxo02: +; LINUX-32-PIC: movl xsrc, %eax +; LINUX-32-PIC-NEXT: movl ptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, (%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: fxo02: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _fxo02: +; DARWIN-32-STATIC: movl _xsrc, %eax +; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _fxo02: +; DARWIN-32-DYNAMIC: movl L_xsrc$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _fxo02: +; DARWIN-32-PIC: call "L6$pb" +; DARWIN-32-PIC-NEXT: "L6$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L6$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L6$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _fxo02: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _fxo02: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _fxo02: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @foo03() nounwind { @@ -261,6 +468,56 @@ ; LINUX-64-STATIC: movl dsrc(%rip), %eax ; LINUX-64-STATIC: movl %eax, ddst ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo03: +; LINUX-32-STATIC: movl dsrc, %eax +; LINUX-32-STATIC-NEXT: movl %eax, ddst +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo03: +; LINUX-32-PIC: movl dsrc, %eax +; LINUX-32-PIC-NEXT: movl %eax, ddst +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax), %eax +; LINUX-64-PIC-NEXT: movq ddst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo03: +; DARWIN-32-STATIC: movl _dsrc, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ddst +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo03: +; DARWIN-32-DYNAMIC: movl _dsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ddst +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo03: +; DARWIN-32-PIC: call "L7$pb" +; DARWIN-32-PIC-NEXT: "L7$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dsrc-"L7$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _ddst-"L7$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo03: +; DARWIN-64-STATIC: movl _dsrc(%rip), %eax +; DARWIN-64-STATIC-NEXT: movl %eax, _ddst(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo03: +; DARWIN-64-DYNAMIC: movl _dsrc(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ddst(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo03: +; DARWIN-64-PIC: movl _dsrc(%rip), %eax +; DARWIN-64-PIC-NEXT: movl %eax, _ddst(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @foo04() nounwind { @@ -270,6 +527,51 @@ ; LINUX-64-STATIC: foo04: ; LINUX-64-STATIC: movq $ddst, dptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo04: +; LINUX-32-STATIC: movl $ddst, dptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo04: +; LINUX-32-PIC: movl $ddst, dptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo04: +; DARWIN-32-STATIC: movl $_ddst, _dptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo04: +; DARWIN-32-DYNAMIC: movl $_ddst, _dptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo04: +; DARWIN-32-PIC: call "L8$pb" +; DARWIN-32-PIC-NEXT: "L8$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ddst-"L8$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-"L8$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @foo05() nounwind { @@ -283,6 +585,65 @@ ; LINUX-64-STATIC: movq dptr(%rip), % ; LINUX-64-STATIC: movl ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo05: +; LINUX-32-STATIC: movl dsrc, %eax +; LINUX-32-STATIC-NEXT: movl dptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, (%ecx) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo05: +; LINUX-32-PIC: movl dsrc, %eax +; LINUX-32-PIC-NEXT: movl dptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, (%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo05: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax), %eax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo05: +; DARWIN-32-STATIC: movl _dsrc, %eax +; DARWIN-32-STATIC-NEXT: movl _dptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo05: +; DARWIN-32-DYNAMIC: movl _dsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo05: +; DARWIN-32-PIC: call "L9$pb" +; DARWIN-32-PIC-NEXT: "L9$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dsrc-"L9$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl _dptr-"L9$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo05: +; DARWIN-64-STATIC: movl _dsrc(%rip), %eax +; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo05: +; DARWIN-64-DYNAMIC: movl _dsrc(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo05: +; DARWIN-64-PIC: movl _dsrc(%rip), %eax +; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @foo06() nounwind { @@ -294,6 +655,54 @@ ; LINUX-64-STATIC: movl lsrc(%rip), %eax ; LINUX-64-STATIC: movl %eax, ldst(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo06: +; LINUX-32-STATIC: movl lsrc, %eax +; LINUX-32-STATIC-NEXT: movl %eax, ldst +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo06: +; LINUX-32-PIC: movl lsrc, %eax +; LINUX-32-PIC-NEXT: movl %eax, ldst +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo06: +; LINUX-64-PIC: movl lsrc(%rip), %eax +; LINUX-64-PIC-NEXT: movl %eax, ldst(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo06: +; DARWIN-32-STATIC: movl _lsrc, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ldst +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo06: +; DARWIN-32-DYNAMIC: movl _lsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ldst +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo06: +; DARWIN-32-PIC: call "L10$pb" +; DARWIN-32-PIC-NEXT: "L10$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lsrc-"L10$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _ldst-"L10$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo06: +; DARWIN-64-STATIC: movl _lsrc(%rip), %eax +; DARWIN-64-STATIC-NEXT: movl %eax, _ldst(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo06: +; DARWIN-64-DYNAMIC: movl _lsrc(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ldst(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo06: +; DARWIN-64-PIC: movl _lsrc(%rip), %eax +; DARWIN-64-PIC-NEXT: movl %eax, _ldst(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @foo07() nounwind { @@ -303,6 +712,50 @@ ; LINUX-64-STATIC: foo07: ; LINUX-64-STATIC: movq $ldst, lptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo07: +; LINUX-32-STATIC: movl $ldst, lptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo07: +; LINUX-32-PIC: movl $ldst, lptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo07: +; DARWIN-32-STATIC: movl $_ldst, _lptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo07: +; DARWIN-32-DYNAMIC: movl $_ldst, _lptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo07: +; DARWIN-32-PIC: call "L11$pb" +; DARWIN-32-PIC-NEXT: "L11$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ldst-"L11$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-"L11$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @foo08() nounwind { @@ -316,6 +769,63 @@ ; LINUX-64-STATIC: movq lptr(%rip), % ; LINUX-64-STATIC: movl ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: foo08: +; LINUX-32-STATIC: movl lsrc, %eax +; LINUX-32-STATIC-NEXT: movl lptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, (%ecx) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: foo08: +; LINUX-32-PIC: movl lsrc, %eax +; LINUX-32-PIC-NEXT: movl lptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, (%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: foo08: +; LINUX-64-PIC: movl lsrc(%rip), %eax +; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _foo08: +; DARWIN-32-STATIC: movl _lsrc, %eax +; DARWIN-32-STATIC-NEXT: movl _lptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _foo08: +; DARWIN-32-DYNAMIC: movl _lsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _foo08: +; DARWIN-32-PIC: call "L12$pb" +; DARWIN-32-PIC-NEXT: "L12$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lsrc-"L12$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl _lptr-"L12$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _foo08: +; DARWIN-64-STATIC: movl _lsrc(%rip), %eax +; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _foo08: +; DARWIN-64-DYNAMIC: movl _lsrc(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _foo08: +; DARWIN-64-PIC: movl _lsrc(%rip), %eax +; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qux00() nounwind { @@ -327,6 +837,66 @@ ; LINUX-64-STATIC: movl src+64(%rip), %eax ; LINUX-64-STATIC: movl %eax, dst+64(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qux00: +; LINUX-32-STATIC: movl src+64, %eax +; LINUX-32-STATIC-NEXT: movl %eax, dst+64 +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qux00: +; LINUX-32-PIC: movl src+64, %eax +; LINUX-32-PIC-NEXT: movl %eax, dst+64 +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax), %eax +; LINUX-64-PIC-NEXT: movq dst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux00: +; DARWIN-32-STATIC: movl _src+64, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _dst+64 +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux00: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux00: +; DARWIN-32-PIC: call "L13$pb" +; DARWIN-32-PIC-NEXT: "L13$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L13$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L13$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-PIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qxx00() nounwind { @@ -338,6 +908,66 @@ ; LINUX-64-STATIC: movl xsrc+64(%rip), %eax ; LINUX-64-STATIC: movl %eax, xdst+64(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qxx00: +; LINUX-32-STATIC: movl xsrc+64, %eax +; LINUX-32-STATIC-NEXT: movl %eax, xdst+64 +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qxx00: +; LINUX-32-PIC: movl xsrc+64, %eax +; LINUX-32-PIC-NEXT: movl %eax, xdst+64 +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qxx00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax), %eax +; LINUX-64-PIC-NEXT: movq xdst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qxx00: +; DARWIN-32-STATIC: movl _xsrc+64, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _xdst+64 +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qxx00: +; DARWIN-32-DYNAMIC: movl L_xsrc$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qxx00: +; DARWIN-32-PIC: call "L14$pb" +; DARWIN-32-PIC-NEXT: "L14$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L14$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L14$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qxx00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qxx00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qxx00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-PIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qux01() nounwind { @@ -347,6 +977,63 @@ ; LINUX-64-STATIC: qux01: ; LINUX-64-STATIC: movq $dst+64, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qux01: +; LINUX-32-STATIC: movl $dst+64, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qux01: +; LINUX-32-PIC: movl $dst+64, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux01: +; DARWIN-32-STATIC: movl $_dst+64, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux01: +; DARWIN-32-DYNAMIC: movl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux01: +; DARWIN-32-PIC: call "L15$pb" +; DARWIN-32-PIC-NEXT: "L15$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L15$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: addl $64, %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L15$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qxx01() nounwind { @@ -356,6 +1043,63 @@ ; LINUX-64-STATIC: qxx01: ; LINUX-64-STATIC: movq $xdst+64, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qxx01: +; LINUX-32-STATIC: movl $xdst+64, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qxx01: +; LINUX-32-PIC: movl $xdst+64, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qxx01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qxx01: +; DARWIN-32-STATIC: movl $_xdst+64, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qxx01: +; DARWIN-32-DYNAMIC: movl L_xdst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qxx01: +; DARWIN-32-PIC: call "L16$pb" +; DARWIN-32-PIC-NEXT: "L16$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L16$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: addl $64, %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L16$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qxx01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qxx01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qxx01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qux02() nounwind { @@ -369,7 +1113,76 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx) ; LINUX-64-STATIC: ret - ret void + +; LINUX-32-STATIC: qux02: +; LINUX-32-STATIC: movl src+64, %eax +; LINUX-32-STATIC-NEXT: movl ptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-STATIC-NEXT: ret + ret void + +; LINUX-32-PIC: qux02: +; LINUX-32-PIC: movl src+64, %eax +; LINUX-32-PIC-NEXT: movl ptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux02: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux02: +; DARWIN-32-STATIC: movl _src+64, %eax +; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux02: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux02: +; DARWIN-32-PIC: call "L17$pb" +; DARWIN-32-PIC-NEXT: "L17$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L17$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L17$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux02: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux02: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux02: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qxx02() nounwind { @@ -383,7 +1196,76 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx) ; LINUX-64-STATIC: ret - ret void + +; LINUX-32-STATIC: qxx02: +; LINUX-32-STATIC: movl xsrc+64, %eax +; LINUX-32-STATIC-NEXT: movl ptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-STATIC-NEXT: ret + ret void + +; LINUX-32-PIC: qxx02: +; LINUX-32-PIC: movl xsrc+64, %eax +; LINUX-32-PIC-NEXT: movl ptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qxx02: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qxx02: +; DARWIN-32-STATIC: movl _xsrc+64, %eax +; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qxx02: +; DARWIN-32-DYNAMIC: movl L_xsrc$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl 64(%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qxx02: +; DARWIN-32-PIC: call "L18$pb" +; DARWIN-32-PIC-NEXT: "L18$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L18$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl 64(%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L18$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qxx02: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qxx02: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qxx02: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qux03() nounwind { @@ -395,6 +1277,56 @@ ; LINUX-64-STATIC: movl dsrc+64(%rip), %eax ; LINUX-64-STATIC: movl %eax, ddst+64(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qux03: +; LINUX-32-STATIC: movl dsrc+64, %eax +; LINUX-32-STATIC-NEXT: movl %eax, ddst+64 +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qux03: +; LINUX-32-PIC: movl dsrc+64, %eax +; LINUX-32-PIC-NEXT: movl %eax, ddst+64 +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax), %eax +; LINUX-64-PIC-NEXT: movq ddst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux03: +; DARWIN-32-STATIC: movl _dsrc+64, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ddst+64 +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux03: +; DARWIN-32-DYNAMIC: movl _dsrc+64, %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ddst+64 +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux03: +; DARWIN-32-PIC: call "L19$pb" +; DARWIN-32-PIC-NEXT: "L19$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dsrc+64-"L19$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _ddst+64-"L19$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux03: +; DARWIN-64-STATIC: movl _dsrc+64(%rip), %eax +; DARWIN-64-STATIC-NEXT: movl %eax, _ddst+64(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux03: +; DARWIN-64-DYNAMIC: movl _dsrc+64(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ddst+64(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux03: +; DARWIN-64-PIC: movl _dsrc+64(%rip), %eax +; DARWIN-64-PIC-NEXT: movl %eax, _ddst+64(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @qux04() nounwind { @@ -404,6 +1336,52 @@ ; LINUX-64-STATIC: qux04: ; LINUX-64-STATIC: movq $ddst+64, dptr(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qux04: +; LINUX-32-STATIC: movl $ddst+64, dptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qux04: +; LINUX-32-PIC: movl $ddst+64, dptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux04: +; DARWIN-32-STATIC: movl $_ddst+64, _dptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux04: +; DARWIN-32-DYNAMIC: movl $_ddst+64, _dptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux04: +; DARWIN-32-PIC: call "L20$pb" +; DARWIN-32-PIC-NEXT: "L20$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ddst+64-"L20$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-"L20$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux04: +; DARWIN-64-STATIC: leaq _ddst+64(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux04: +; DARWIN-64-DYNAMIC: leaq _ddst+64(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux04: +; DARWIN-64-PIC: leaq _ddst+64(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @qux05() nounwind { @@ -417,7 +1395,66 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx) ; LINUX-64-STATIC: ret - ret void + +; LINUX-32-STATIC: qux05: +; LINUX-32-STATIC: movl dsrc+64, %eax +; LINUX-32-STATIC-NEXT: movl dptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-STATIC-NEXT: ret + ret void + +; LINUX-32-PIC: qux05: +; LINUX-32-PIC: movl dsrc+64, %eax +; LINUX-32-PIC-NEXT: movl dptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux05: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax), %eax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux05: +; DARWIN-32-STATIC: movl _dsrc+64, %eax +; DARWIN-32-STATIC-NEXT: movl _dptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux05: +; DARWIN-32-DYNAMIC: movl _dsrc+64, %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux05: +; DARWIN-32-PIC: call "L21$pb" +; DARWIN-32-PIC-NEXT: "L21$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dsrc+64-"L21$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl _dptr-"L21$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux05: +; DARWIN-64-STATIC: movl _dsrc+64(%rip), %eax +; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux05: +; DARWIN-64-DYNAMIC: movl _dsrc+64(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux05: +; DARWIN-64-PIC: movl _dsrc+64(%rip), %eax +; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @qux06() nounwind { @@ -429,6 +1466,54 @@ ; LINUX-64-STATIC: movl lsrc+64(%rip), %eax ; LINUX-64-STATIC: movl %eax, ldst+64 ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qux06: +; LINUX-32-STATIC: movl lsrc+64, %eax +; LINUX-32-STATIC-NEXT: movl %eax, ldst+64 +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qux06: +; LINUX-32-PIC: movl lsrc+64, %eax +; LINUX-32-PIC-NEXT: movl %eax, ldst+64 +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux06: +; LINUX-64-PIC: movl lsrc+64(%rip), %eax +; LINUX-64-PIC-NEXT: movl %eax, ldst+64(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux06: +; DARWIN-32-STATIC: movl _lsrc+64, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ldst+64 +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux06: +; DARWIN-32-DYNAMIC: movl _lsrc+64, %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ldst+64 +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux06: +; DARWIN-32-PIC: call "L22$pb" +; DARWIN-32-PIC-NEXT: "L22$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lsrc+64-"L22$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _ldst+64-"L22$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux06: +; DARWIN-64-STATIC: movl _lsrc+64(%rip), %eax +; DARWIN-64-STATIC-NEXT: movl %eax, _ldst+64(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux06: +; DARWIN-64-DYNAMIC: movl _lsrc+64(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ldst+64(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux06: +; DARWIN-64-PIC: movl _lsrc+64(%rip), %eax +; DARWIN-64-PIC-NEXT: movl %eax, _ldst+64(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @qux07() nounwind { @@ -438,6 +1523,50 @@ ; LINUX-64-STATIC: qux07: ; LINUX-64-STATIC: movq $ldst+64, lptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: qux07: +; LINUX-32-STATIC: movl $ldst+64, lptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: qux07: +; LINUX-32-PIC: movl $ldst+64, lptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux07: +; LINUX-64-PIC: leaq ldst+64(%rip), %rax +; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux07: +; DARWIN-32-STATIC: movl $_ldst+64, _lptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux07: +; DARWIN-32-DYNAMIC: movl $_ldst+64, _lptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux07: +; DARWIN-32-PIC: call "L23$pb" +; DARWIN-32-PIC-NEXT: "L23$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ldst+64-"L23$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-"L23$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux07: +; DARWIN-64-STATIC: leaq _ldst+64(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux07: +; DARWIN-64-DYNAMIC: leaq _ldst+64(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux07: +; DARWIN-64-PIC: leaq _ldst+64(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @qux08() nounwind { @@ -451,7 +1580,64 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx) ; LINUX-64-STATIC: ret - ret void + +; LINUX-32-STATIC: qux08: +; LINUX-32-STATIC: movl lsrc+64, %eax +; LINUX-32-STATIC-NEXT: movl lptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-STATIC-NEXT: ret + ret void + +; LINUX-32-PIC: qux08: +; LINUX-32-PIC: movl lsrc+64, %eax +; LINUX-32-PIC-NEXT: movl lptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, 64(%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: qux08: +; LINUX-64-PIC: movl lsrc+64(%rip), %eax +; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _qux08: +; DARWIN-32-STATIC: movl _lsrc+64, %eax +; DARWIN-32-STATIC-NEXT: movl _lptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _qux08: +; DARWIN-32-DYNAMIC: movl _lsrc+64, %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 64(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _qux08: +; DARWIN-32-PIC: call "L24$pb" +; DARWIN-32-PIC-NEXT: "L24$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lsrc+64-"L24$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl _lptr-"L24$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 64(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _qux08: +; DARWIN-64-STATIC: movl _lsrc+64(%rip), %eax +; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _qux08: +; DARWIN-64-DYNAMIC: movl _lsrc+64(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _qux08: +; DARWIN-64-PIC: movl _lsrc+64(%rip), %eax +; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @ind00(i64 %i) nounwind { @@ -465,6 +1651,71 @@ ; LINUX-64-STATIC: movl src(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, dst(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl src(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, dst(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl src(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, dst(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq dst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _src(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _dst(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind00: +; DARWIN-32-PIC: call "L25$pb" +; DARWIN-32-PIC-NEXT: "L25$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L25$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L25$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @ixd00(i64 %i) nounwind { @@ -478,6 +1729,71 @@ ; LINUX-64-STATIC: movl xsrc(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, xdst(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ixd00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl xsrc(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, xdst(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ixd00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl xsrc(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, xdst(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ixd00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq xdst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ixd00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _xsrc(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _xdst(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ixd00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ixd00: +; DARWIN-32-PIC: call "L26$pb" +; DARWIN-32-PIC-NEXT: "L26$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L26$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L26$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ixd00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ixd00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ixd00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @ind01(i64 %i) nounwind { @@ -489,6 +1805,71 @@ ; LINUX-64-STATIC: leaq dst(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal dst(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal dst(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind01: +; LINUX-64-PIC: shlq $2, %rdi +; LINUX-64-PIC-NEXT: addq dst at GOTPCREL(%rip), %rdi +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq %rdi, (%rax) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _dst(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: shll $2, %eax +; DARWIN-32-DYNAMIC-NEXT: addl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind01: +; DARWIN-32-PIC: call "L27$pb" +; DARWIN-32-PIC-NEXT: "L27$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: shll $2, %ecx +; DARWIN-32-PIC-NEXT: addl L_dst$non_lazy_ptr-"L27$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L27$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind01: +; DARWIN-64-STATIC: shlq $2, %rdi +; DARWIN-64-STATIC-NEXT: addq _dst at GOTPCREL(%rip), %rdi +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rdi, (%rax) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind01: +; DARWIN-64-DYNAMIC: shlq $2, %rdi +; DARWIN-64-DYNAMIC-NEXT: addq _dst at GOTPCREL(%rip), %rdi +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rdi, (%rax) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind01: +; DARWIN-64-PIC: shlq $2, %rdi +; DARWIN-64-PIC-NEXT: addq _dst at GOTPCREL(%rip), %rdi +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rdi, (%rax) +; DARWIN-64-PIC-NEXT: ret } define void @ixd01(i64 %i) nounwind { @@ -500,6 +1881,71 @@ ; LINUX-64-STATIC: leaq xdst(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ixd01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal xdst(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ixd01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal xdst(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ixd01: +; LINUX-64-PIC: shlq $2, %rdi +; LINUX-64-PIC-NEXT: addq xdst at GOTPCREL(%rip), %rdi +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq %rdi, (%rax) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ixd01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _xdst(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ixd01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: shll $2, %eax +; DARWIN-32-DYNAMIC-NEXT: addl L_xdst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ixd01: +; DARWIN-32-PIC: call "L28$pb" +; DARWIN-32-PIC-NEXT: "L28$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: shll $2, %ecx +; DARWIN-32-PIC-NEXT: addl L_xdst$non_lazy_ptr-"L28$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L28$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ixd01: +; DARWIN-64-STATIC: shlq $2, %rdi +; DARWIN-64-STATIC-NEXT: addq _xdst at GOTPCREL(%rip), %rdi +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rdi, (%rax) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ixd01: +; DARWIN-64-DYNAMIC: shlq $2, %rdi +; DARWIN-64-DYNAMIC-NEXT: addq _xdst at GOTPCREL(%rip), %rdi +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rdi, (%rax) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ixd01: +; DARWIN-64-PIC: shlq $2, %rdi +; DARWIN-64-PIC-NEXT: addq _xdst at GOTPCREL(%rip), %rdi +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rdi, (%rax) +; DARWIN-64-PIC-NEXT: ret } define void @ind02(i64 %i) nounwind { @@ -515,6 +1961,80 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, (%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind02: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl src(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl ptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind02: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl src(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl ptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind02: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind02: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _src(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _ptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind02: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl (%edx), %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind02: +; DARWIN-32-PIC: call "L29$pb" +; DARWIN-32-PIC-NEXT: "L29$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L29$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L29$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind02: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind02: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind02: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @ixd02(i64 %i) nounwind { @@ -530,6 +2050,80 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, (%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ixd02: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl xsrc(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl ptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ixd02: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl xsrc(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl ptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ixd02: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ixd02: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _xsrc(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _ptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ixd02: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl (%edx), %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ixd02: +; DARWIN-32-PIC: call "L30$pb" +; DARWIN-32-PIC-NEXT: "L30$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L30$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl (%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L30$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ixd02: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ixd02: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ixd02: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @ind03(i64 %i) nounwind { @@ -543,6 +2137,67 @@ ; LINUX-64-STATIC: movl dsrc(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, ddst(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind03: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dsrc(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, ddst(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind03: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dsrc(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, ddst(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ddst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind03: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dsrc(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _ddst(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind03: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dsrc(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ddst(,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind03: +; DARWIN-32-PIC: call "L31$pb" +; DARWIN-32-PIC-NEXT: "L31$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dsrc-"L31$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl %edx, _ddst-"L31$pb"(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind03: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind03: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind03: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @ind04(i64 %i) nounwind { @@ -554,6 +2209,64 @@ ; LINUX-64-STATIC: leaq ddst(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, dptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind04: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ddst(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, dptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind04: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ddst(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, dptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind04: +; LINUX-64-PIC: shlq $2, %rdi +; LINUX-64-PIC-NEXT: addq ddst at GOTPCREL(%rip), %rdi +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq %rdi, (%rax) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind04: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ddst(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _dptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind04: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ddst(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _dptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind04: +; DARWIN-32-PIC: call "L32$pb" +; DARWIN-32-PIC-NEXT: "L32$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ddst-"L32$pb"(%eax,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-"L32$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq (%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq (%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq (%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @ind05(i64 %i) nounwind { @@ -569,6 +2282,73 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, (%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind05: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dsrc(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl dptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind05: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dsrc(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl dptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind05: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind05: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dsrc(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _dptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind05: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dsrc(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind05: +; DARWIN-32-PIC: call "L33$pb" +; DARWIN-32-PIC-NEXT: "L33$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dsrc-"L33$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl _dptr-"L33$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind05: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind05: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind05: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @ind06(i64 %i) nounwind { @@ -582,6 +2362,67 @@ ; LINUX-64-STATIC: movl lsrc(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, ldst(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind06: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lsrc(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, ldst(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind06: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lsrc(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, ldst(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind06: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: leaq ldst(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind06: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lsrc(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _ldst(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind06: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lsrc(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ldst(,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind06: +; DARWIN-32-PIC: call "L34$pb" +; DARWIN-32-PIC-NEXT: "L34$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lsrc-"L34$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl %edx, _ldst-"L34$pb"(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind06: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind06: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind06: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @ind07(i64 %i) nounwind { @@ -593,6 +2434,63 @@ ; LINUX-64-STATIC: leaq ldst(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, lptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind07: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ldst(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, lptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind07: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ldst(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, lptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: leaq (%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind07: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ldst(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _lptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind07: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ldst(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _lptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind07: +; DARWIN-32-PIC: call "L35$pb" +; DARWIN-32-PIC-NEXT: "L35$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ldst-"L35$pb"(%eax,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-"L35$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq (%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq (%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq (%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @ind08(i64 %i) nounwind { @@ -608,6 +2506,72 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, (%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ind08: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lsrc(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl lptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ind08: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lsrc(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl lptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, (%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ind08: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ind08: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lsrc(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _lptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ind08: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lsrc(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, (%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ind08: +; DARWIN-32-PIC: call "L36$pb" +; DARWIN-32-PIC-NEXT: "L36$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lsrc-"L36$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl _lptr-"L36$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, (%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ind08: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ind08: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ind08: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl (%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, (%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @off00(i64 %i) nounwind { @@ -622,6 +2586,71 @@ ; LINUX-64-STATIC: movl src+64(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, dst+64(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl src+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, dst+64(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl src+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, dst+64(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq dst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _src+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _dst+64(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl 64(%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off00: +; DARWIN-32-PIC: call "L37$pb" +; DARWIN-32-PIC-NEXT: "L37$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L37$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl 64(%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L37$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @oxf00(i64 %i) nounwind { @@ -636,6 +2665,71 @@ ; LINUX-64-STATIC: movl xsrc+64(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, xdst+64(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: oxf00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl xsrc+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, xdst+64(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: oxf00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl xsrc+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, xdst+64(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: oxf00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq xdst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _oxf00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _xsrc+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _xdst+64(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _oxf00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl 64(%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _oxf00: +; DARWIN-32-PIC: call "L38$pb" +; DARWIN-32-PIC-NEXT: "L38$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L38$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl 64(%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L38$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _oxf00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _oxf00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _oxf00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _xdst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @off01(i64 %i) nounwind { @@ -648,6 +2742,71 @@ ; LINUX-64-STATIC: leaq dst+64(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal dst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal dst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _dst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off01: +; DARWIN-32-PIC: call "L39$pb" +; DARWIN-32-PIC-NEXT: "L39$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L39$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: leal 64(%edx,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L39$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @oxf01(i64 %i) nounwind { @@ -660,6 +2819,71 @@ ; LINUX-64-STATIC: leaq xdst+64(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, ptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: oxf01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal xdst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: oxf01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal xdst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: oxf01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _oxf01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _xdst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _oxf01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _oxf01: +; DARWIN-32-PIC: call "L40$pb" +; DARWIN-32-PIC-NEXT: "L40$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L40$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: leal 64(%edx,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L40$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _oxf01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _oxf01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _oxf01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @off02(i64 %i) nounwind { @@ -676,6 +2900,80 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off02: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl src+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl ptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off02: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl src+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl ptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off02: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off02: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _src+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _ptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off02: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl 64(%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl (%edx), %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off02: +; DARWIN-32-PIC: call "L41$pb" +; DARWIN-32-PIC-NEXT: "L41$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L41$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl 64(%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L41$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off02: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off02: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off02: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @oxf02(i64 %i) nounwind { @@ -692,6 +2990,80 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: oxf02: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl xsrc+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl ptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: oxf02: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl xsrc+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl ptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: oxf02: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _oxf02: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _xsrc+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _ptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _oxf02: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl 64(%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl (%edx), %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _oxf02: +; DARWIN-32-PIC: call "L42$pb" +; DARWIN-32-PIC-NEXT: "L42$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L42$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl 64(%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L42$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _oxf02: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _oxf02: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _oxf02: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @off03(i64 %i) nounwind { @@ -706,6 +3078,67 @@ ; LINUX-64-STATIC: movl dsrc+64(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, ddst+64(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off03: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dsrc+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, ddst+64(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off03: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dsrc+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, ddst+64(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ddst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off03: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dsrc+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _ddst+64(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off03: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dsrc+64(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ddst+64(,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off03: +; DARWIN-32-PIC: call "L43$pb" +; DARWIN-32-PIC-NEXT: "L43$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dsrc+64-"L43$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl %edx, _ddst+64-"L43$pb"(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off03: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off03: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off03: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @off04(i64 %i) nounwind { @@ -718,6 +3151,64 @@ ; LINUX-64-STATIC: leaq ddst+64(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, dptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off04: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ddst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, dptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off04: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ddst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, dptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off04: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ddst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _dptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off04: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ddst+64(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _dptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off04: +; DARWIN-32-PIC: call "L44$pb" +; DARWIN-32-PIC-NEXT: "L44$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ddst+64-"L44$pb"(%eax,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-"L44$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @off05(i64 %i) nounwind { @@ -734,6 +3225,73 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off05: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dsrc+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl dptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off05: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dsrc+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl dptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off05: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off05: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dsrc+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _dptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off05: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dsrc+64(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off05: +; DARWIN-32-PIC: call "L45$pb" +; DARWIN-32-PIC-NEXT: "L45$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dsrc+64-"L45$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl _dptr-"L45$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off05: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off05: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off05: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @off06(i64 %i) nounwind { @@ -748,6 +3306,67 @@ ; LINUX-64-STATIC: movl lsrc+64(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, ldst+64(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off06: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lsrc+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, ldst+64(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off06: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lsrc+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, ldst+64(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off06: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: leaq ldst(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off06: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lsrc+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _ldst+64(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off06: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lsrc+64(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ldst+64(,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off06: +; DARWIN-32-PIC: call "L46$pb" +; DARWIN-32-PIC-NEXT: "L46$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lsrc+64-"L46$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl %edx, _ldst+64-"L46$pb"(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off06: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off06: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off06: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @off07(i64 %i) nounwind { @@ -760,6 +3379,63 @@ ; LINUX-64-STATIC: leaq ldst+64(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, lptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off07: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ldst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, lptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off07: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ldst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, lptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off07: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ldst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _lptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off07: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ldst+64(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _lptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off07: +; DARWIN-32-PIC: call "L47$pb" +; DARWIN-32-PIC-NEXT: "L47$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ldst+64-"L47$pb"(%eax,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-"L47$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @off08(i64 %i) nounwind { @@ -776,6 +3452,72 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 64(%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: off08: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lsrc+64(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl lptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: off08: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lsrc+64(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl lptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: off08: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _off08: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lsrc+64(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _lptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _off08: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lsrc+64(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 64(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _off08: +; DARWIN-32-PIC: call "L48$pb" +; DARWIN-32-PIC-NEXT: "L48$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lsrc+64-"L48$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl _lptr-"L48$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 64(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _off08: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _off08: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _off08: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 64(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 64(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @moo00(i64 %i) nounwind { @@ -787,6 +3529,66 @@ ; LINUX-64-STATIC: movl src+262144(%rip), %eax ; LINUX-64-STATIC: movl %eax, dst+262144(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo00: +; LINUX-32-STATIC: movl src+262144, %eax +; LINUX-32-STATIC-NEXT: movl %eax, dst+262144 +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo00: +; LINUX-32-PIC: movl src+262144, %eax +; LINUX-32-PIC-NEXT: movl %eax, dst+262144 +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax), %eax +; LINUX-64-PIC-NEXT: movq dst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo00: +; DARWIN-32-STATIC: movl _src+262144, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _dst+262144 +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo00: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl 262144(%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 262144(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo00: +; DARWIN-32-PIC: call "L49$pb" +; DARWIN-32-PIC-NEXT: "L49$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L49$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl 262144(%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L49$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 262144(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax), %eax +; DARWIN-64-PIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @moo01(i64 %i) nounwind { @@ -796,6 +3598,63 @@ ; LINUX-64-STATIC: moo01: ; LINUX-64-STATIC: movq $dst+262144, ptr(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo01: +; LINUX-32-STATIC: movl $dst+262144, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo01: +; LINUX-32-PIC: movl $dst+262144, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo01: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo01: +; DARWIN-32-STATIC: movl $_dst+262144, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo01: +; DARWIN-32-DYNAMIC: movl $262144, %eax +; DARWIN-32-DYNAMIC-NEXT: addl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo01: +; DARWIN-32-PIC: call "L50$pb" +; DARWIN-32-PIC-NEXT: "L50$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl $262144, %ecx +; DARWIN-32-PIC-NEXT: addl L_dst$non_lazy_ptr-"L50$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L50$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo01: +; DARWIN-64-STATIC: movl $262144, %eax +; DARWIN-64-STATIC-NEXT: addq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo01: +; DARWIN-64-DYNAMIC: movl $262144, %eax +; DARWIN-64-DYNAMIC-NEXT: addq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo01: +; DARWIN-64-PIC: movl $262144, %eax +; DARWIN-64-PIC-NEXT: addq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @moo02(i64 %i) nounwind { @@ -810,6 +3669,75 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 262144(%rcx) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo02: +; LINUX-32-STATIC: movl src+262144, %eax +; LINUX-32-STATIC-NEXT: movl ptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, 262144(%ecx) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo02: +; LINUX-32-PIC: movl src+262144, %eax +; LINUX-32-PIC-NEXT: movl ptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, 262144(%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo02: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo02: +; DARWIN-32-STATIC: movl _src+262144, %eax +; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, 262144(%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo02: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl 262144(%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl (%ecx), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 262144(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo02: +; DARWIN-32-PIC: call "L51$pb" +; DARWIN-32-PIC-NEXT: "L51$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L51$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl 262144(%ecx), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L51$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 262144(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo02: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo02: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo02: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @moo03(i64 %i) nounwind { @@ -821,6 +3749,56 @@ ; LINUX-64-STATIC: movl dsrc+262144(%rip), %eax ; LINUX-64-STATIC: movl %eax, ddst+262144(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo03: +; LINUX-32-STATIC: movl dsrc+262144, %eax +; LINUX-32-STATIC-NEXT: movl %eax, ddst+262144 +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo03: +; LINUX-32-PIC: movl dsrc+262144, %eax +; LINUX-32-PIC-NEXT: movl %eax, ddst+262144 +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax), %eax +; LINUX-64-PIC-NEXT: movq ddst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo03: +; DARWIN-32-STATIC: movl _dsrc+262144, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ddst+262144 +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo03: +; DARWIN-32-DYNAMIC: movl _dsrc+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ddst+262144 +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo03: +; DARWIN-32-PIC: call "L52$pb" +; DARWIN-32-PIC-NEXT: "L52$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dsrc+262144-"L52$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _ddst+262144-"L52$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo03: +; DARWIN-64-STATIC: movl _dsrc+262144(%rip), %eax +; DARWIN-64-STATIC-NEXT: movl %eax, _ddst+262144(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo03: +; DARWIN-64-DYNAMIC: movl _dsrc+262144(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ddst+262144(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo03: +; DARWIN-64-PIC: movl _dsrc+262144(%rip), %eax +; DARWIN-64-PIC-NEXT: movl %eax, _ddst+262144(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @moo04(i64 %i) nounwind { @@ -830,6 +3808,52 @@ ; LINUX-64-STATIC: moo04: ; LINUX-64-STATIC: movq $ddst+262144, dptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo04: +; LINUX-32-STATIC: movl $ddst+262144, dptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo04: +; LINUX-32-PIC: movl $ddst+262144, dptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo04: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo04: +; DARWIN-32-STATIC: movl $_ddst+262144, _dptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo04: +; DARWIN-32-DYNAMIC: movl $_ddst+262144, _dptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo04: +; DARWIN-32-PIC: call "L53$pb" +; DARWIN-32-PIC-NEXT: "L53$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ddst+262144-"L53$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-"L53$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo04: +; DARWIN-64-STATIC: leaq _ddst+262144(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo04: +; DARWIN-64-DYNAMIC: leaq _ddst+262144(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo04: +; DARWIN-64-PIC: leaq _ddst+262144(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @moo05(i64 %i) nounwind { @@ -844,6 +3868,65 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 262144(%rcx) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo05: +; LINUX-32-STATIC: movl dsrc+262144, %eax +; LINUX-32-STATIC-NEXT: movl dptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, 262144(%ecx) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo05: +; LINUX-32-PIC: movl dsrc+262144, %eax +; LINUX-32-PIC-NEXT: movl dptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, 262144(%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo05: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax), %eax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo05: +; DARWIN-32-STATIC: movl _dsrc+262144, %eax +; DARWIN-32-STATIC-NEXT: movl _dptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, 262144(%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo05: +; DARWIN-32-DYNAMIC: movl _dsrc+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 262144(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo05: +; DARWIN-32-PIC: call "L54$pb" +; DARWIN-32-PIC-NEXT: "L54$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dsrc+262144-"L54$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl _dptr-"L54$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 262144(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo05: +; DARWIN-64-STATIC: movl _dsrc+262144(%rip), %eax +; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo05: +; DARWIN-64-DYNAMIC: movl _dsrc+262144(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo05: +; DARWIN-64-PIC: movl _dsrc+262144(%rip), %eax +; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @moo06(i64 %i) nounwind { @@ -855,6 +3938,54 @@ ; LINUX-64-STATIC: movl lsrc+262144(%rip), %eax ; LINUX-64-STATIC: movl %eax, ldst+262144(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo06: +; LINUX-32-STATIC: movl lsrc+262144, %eax +; LINUX-32-STATIC-NEXT: movl %eax, ldst+262144 +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo06: +; LINUX-32-PIC: movl lsrc+262144, %eax +; LINUX-32-PIC-NEXT: movl %eax, ldst+262144 +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo06: +; LINUX-64-PIC: movl lsrc+262144(%rip), %eax +; LINUX-64-PIC-NEXT: movl %eax, ldst+262144(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo06: +; DARWIN-32-STATIC: movl _lsrc+262144, %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ldst+262144 +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo06: +; DARWIN-32-DYNAMIC: movl _lsrc+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _ldst+262144 +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo06: +; DARWIN-32-PIC: call "L55$pb" +; DARWIN-32-PIC-NEXT: "L55$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lsrc+262144-"L55$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _ldst+262144-"L55$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo06: +; DARWIN-64-STATIC: movl _lsrc+262144(%rip), %eax +; DARWIN-64-STATIC-NEXT: movl %eax, _ldst+262144(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo06: +; DARWIN-64-DYNAMIC: movl _lsrc+262144(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movl %eax, _ldst+262144(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo06: +; DARWIN-64-PIC: movl _lsrc+262144(%rip), %eax +; DARWIN-64-PIC-NEXT: movl %eax, _ldst+262144(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @moo07(i64 %i) nounwind { @@ -864,6 +3995,50 @@ ; LINUX-64-STATIC: moo07: ; LINUX-64-STATIC: movq $ldst+262144, lptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo07: +; LINUX-32-STATIC: movl $ldst+262144, lptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo07: +; LINUX-32-PIC: movl $ldst+262144, lptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo07: +; LINUX-64-PIC: leaq ldst+262144(%rip), %rax +; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo07: +; DARWIN-32-STATIC: movl $_ldst+262144, _lptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo07: +; DARWIN-32-DYNAMIC: movl $_ldst+262144, _lptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo07: +; DARWIN-32-PIC: call "L56$pb" +; DARWIN-32-PIC-NEXT: "L56$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ldst+262144-"L56$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-"L56$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo07: +; DARWIN-64-STATIC: leaq _ldst+262144(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo07: +; DARWIN-64-DYNAMIC: leaq _ldst+262144(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo07: +; DARWIN-64-PIC: leaq _ldst+262144(%rip), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @moo08(i64 %i) nounwind { @@ -878,6 +4053,63 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 262144(%rcx) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: moo08: +; LINUX-32-STATIC: movl lsrc+262144, %eax +; LINUX-32-STATIC-NEXT: movl lptr, %ecx +; LINUX-32-STATIC-NEXT: movl %eax, 262144(%ecx) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: moo08: +; LINUX-32-PIC: movl lsrc+262144, %eax +; LINUX-32-PIC-NEXT: movl lptr, %ecx +; LINUX-32-PIC-NEXT: movl %eax, 262144(%ecx) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: moo08: +; LINUX-64-PIC: movl lsrc+262144(%rip), %eax +; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _moo08: +; DARWIN-32-STATIC: movl _lsrc+262144, %eax +; DARWIN-32-STATIC-NEXT: movl _lptr, %ecx +; DARWIN-32-STATIC-NEXT: movl %eax, 262144(%ecx) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _moo08: +; DARWIN-32-DYNAMIC: movl _lsrc+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, 262144(%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _moo08: +; DARWIN-32-PIC: call "L57$pb" +; DARWIN-32-PIC-NEXT: "L57$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lsrc+262144-"L57$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl _lptr-"L57$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, 262144(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _moo08: +; DARWIN-64-STATIC: movl _lsrc+262144(%rip), %eax +; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _moo08: +; DARWIN-64-DYNAMIC: movl _lsrc+262144(%rip), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _moo08: +; DARWIN-64-PIC: movl _lsrc+262144(%rip), %eax +; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @big00(i64 %i) nounwind { @@ -892,6 +4124,71 @@ ; LINUX-64-STATIC: movl src+262144(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, dst+262144(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl src+262144(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, dst+262144(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl src+262144(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, dst+262144(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq dst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _src+262144(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _dst+262144(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl 262144(%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big00: +; DARWIN-32-PIC: call "L58$pb" +; DARWIN-32-PIC-NEXT: "L58$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L58$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl 262144(%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L58$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 262144(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _dst at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @big01(i64 %i) nounwind { @@ -904,6 +4201,71 @@ ; LINUX-64-STATIC: leaq dst+262144(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, ptr(%rip) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal dst+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, ptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal dst+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, ptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _dst+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _ptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %eax, (%ecx) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big01: +; DARWIN-32-PIC: call "L59$pb" +; DARWIN-32-PIC-NEXT: "L59$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L59$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: leal 262144(%edx,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L59$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %ecx, (%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq %rax, (%rcx) +; DARWIN-64-PIC-NEXT: ret } define void @big02(i64 %i) nounwind { @@ -920,6 +4282,80 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 262144(%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big02: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl src+262144(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl ptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big02: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl src+262144(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl ptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big02: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big02: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _src+262144(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _ptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big02: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl 262144(%ecx,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl L_ptr$non_lazy_ptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl (%edx), %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big02: +; DARWIN-32-PIC: call "L60$pb" +; DARWIN-32-PIC-NEXT: "L60$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L60$pb"(%eax), %edx +; DARWIN-32-PIC-NEXT: movl 262144(%edx,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L60$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 262144(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big02: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big02: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big02: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movq (%rcx), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @big03(i64 %i) nounwind { @@ -934,6 +4370,67 @@ ; LINUX-64-STATIC: movl dsrc+262144(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, ddst+262144(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big03: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dsrc+262144(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, ddst+262144(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big03: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dsrc+262144(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, ddst+262144(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq ddst at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big03: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dsrc+262144(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _ddst+262144(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big03: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dsrc+262144(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ddst+262144(,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big03: +; DARWIN-32-PIC: call "L61$pb" +; DARWIN-32-PIC-NEXT: "L61$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dsrc+262144-"L61$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl %edx, _ddst+262144-"L61$pb"(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big03: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big03: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big03: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: leaq _ddst(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @big04(i64 %i) nounwind { @@ -946,6 +4443,64 @@ ; LINUX-64-STATIC: leaq ddst+262144(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, dptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big04: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ddst+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, dptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big04: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ddst+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, dptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq %rax, (%rcx) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big04: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ddst+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _dptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big04: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ddst+262144(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _dptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big04: +; DARWIN-32-PIC: call "L62$pb" +; DARWIN-32-PIC-NEXT: "L62$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ddst+262144-"L62$pb"(%eax,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _dptr-"L62$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _dptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @big05(i64 %i) nounwind { @@ -962,6 +4517,73 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 262144(%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big05: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dsrc+262144(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl dptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big05: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dsrc+262144(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl dptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big05: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movq (%rcx), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big05: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dsrc+262144(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _dptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big05: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dsrc+262144(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big05: +; DARWIN-32-PIC: call "L63$pb" +; DARWIN-32-PIC-NEXT: "L63$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dsrc+262144-"L63$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl _dptr-"L63$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 262144(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big05: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big05: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big05: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _dptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @big06(i64 %i) nounwind { @@ -976,6 +4598,67 @@ ; LINUX-64-STATIC: movl lsrc+262144(,%rdi,4), %eax ; LINUX-64-STATIC: movl %eax, ldst+262144(,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big06: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lsrc+262144(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl %ecx, ldst+262144(,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big06: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lsrc+262144(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl %ecx, ldst+262144(,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big06: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: leaq ldst(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big06: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lsrc+262144(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl %ecx, _ldst+262144(,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big06: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lsrc+262144(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, _ldst+262144(,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big06: +; DARWIN-32-PIC: call "L64$pb" +; DARWIN-32-PIC-NEXT: "L64$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lsrc+262144-"L64$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl %edx, _ldst+262144-"L64$pb"(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big06: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big06: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big06: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: leaq _ldst(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define void @big07(i64 %i) nounwind { @@ -988,6 +4671,63 @@ ; LINUX-64-STATIC: leaq ldst+262144(,%rdi,4), %rax ; LINUX-64-STATIC: movq %rax, lptr ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big07: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ldst+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: movl %eax, lptr +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big07: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ldst+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: movl %eax, lptr +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: movq %rax, lptr(%rip) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big07: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ldst+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: movl %eax, _lptr +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big07: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ldst+262144(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: movl %eax, _lptr +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big07: +; DARWIN-32-PIC: call "L65$pb" +; DARWIN-32-PIC-NEXT: "L65$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ldst+262144-"L65$pb"(%eax,%ecx,4), %ecx +; DARWIN-32-PIC-NEXT: movl %ecx, _lptr-"L65$pb"(%eax) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: movq %rax, _lptr(%rip) +; DARWIN-64-PIC-NEXT: ret } define void @big08(i64 %i) nounwind { @@ -1004,6 +4744,72 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rcx ; LINUX-64-STATIC: movl %eax, 262144(%rcx,%rdi,4) ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: big08: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lsrc+262144(,%eax,4), %ecx +; LINUX-32-STATIC-NEXT: movl lptr, %edx +; LINUX-32-STATIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: big08: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lsrc+262144(,%eax,4), %ecx +; LINUX-32-PIC-NEXT: movl lptr, %edx +; LINUX-32-PIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: big08: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; LINUX-64-PIC-NEXT: movq lptr(%rip), %rcx +; LINUX-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _big08: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lsrc+262144(,%eax,4), %ecx +; DARWIN-32-STATIC-NEXT: movl _lptr, %edx +; DARWIN-32-STATIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _big08: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lsrc+262144(,%eax,4), %ecx +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %edx +; DARWIN-32-DYNAMIC-NEXT: movl %ecx, 262144(%edx,%eax,4) +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _big08: +; DARWIN-32-PIC: call "L66$pb" +; DARWIN-32-PIC-NEXT: "L66$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lsrc+262144-"L66$pb"(%eax,%ecx,4), %edx +; DARWIN-32-PIC-NEXT: movl _lptr-"L66$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl %edx, 262144(%eax,%ecx,4) +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _big08: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-STATIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _big08: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-DYNAMIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _big08: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: movl 262144(%rax,%rdi,4), %eax +; DARWIN-64-PIC-NEXT: movq _lptr(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl %eax, 262144(%rcx,%rdi,4) +; DARWIN-64-PIC-NEXT: ret } define i8* @bar00() nounwind { @@ -1012,6 +4818,45 @@ ; LINUX-64-STATIC: bar00: ; LINUX-64-STATIC: movl $src, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar00: +; LINUX-32-STATIC: movl $src, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar00: +; LINUX-32-PIC: movl $src, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar00: +; DARWIN-32-STATIC: movl $_src, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar00: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar00: +; DARWIN-32-PIC: call "L67$pb" +; DARWIN-32-PIC-NEXT: "L67$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L67$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bxr00() nounwind { @@ -1020,6 +4865,45 @@ ; LINUX-64-STATIC: bxr00: ; LINUX-64-STATIC: movl $xsrc, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bxr00: +; LINUX-32-STATIC: movl $xsrc, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bxr00: +; LINUX-32-PIC: movl $xsrc, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bxr00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bxr00: +; DARWIN-32-STATIC: movl $_xsrc, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bxr00: +; DARWIN-32-DYNAMIC: movl L_xsrc$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bxr00: +; DARWIN-32-PIC: call "L68$pb" +; DARWIN-32-PIC-NEXT: "L68$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L68$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bxr00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bxr00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bxr00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar01() nounwind { @@ -1028,6 +4912,45 @@ ; LINUX-64-STATIC: bar01: ; LINUX-64-STATIC: movl $dst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar01: +; LINUX-32-STATIC: movl $dst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar01: +; LINUX-32-PIC: movl $dst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar01: +; DARWIN-32-STATIC: movl $_dst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar01: +; DARWIN-32-DYNAMIC: movl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar01: +; DARWIN-32-PIC: call "L69$pb" +; DARWIN-32-PIC-NEXT: "L69$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L69$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bxr01() nounwind { @@ -1036,6 +4959,45 @@ ; LINUX-64-STATIC: bxr01: ; LINUX-64-STATIC: movl $xdst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bxr01: +; LINUX-32-STATIC: movl $xdst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bxr01: +; LINUX-32-PIC: movl $xdst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bxr01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bxr01: +; DARWIN-32-STATIC: movl $_xdst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bxr01: +; DARWIN-32-DYNAMIC: movl L_xdst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bxr01: +; DARWIN-32-PIC: call "L70$pb" +; DARWIN-32-PIC-NEXT: "L70$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L70$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bxr01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bxr01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bxr01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar02() nounwind { @@ -1044,6 +5006,45 @@ ; LINUX-64-STATIC: bar02: ; LINUX-64-STATIC: movl $ptr, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar02: +; LINUX-32-STATIC: movl $ptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar02: +; LINUX-32-PIC: movl $ptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar02: +; LINUX-64-PIC: movq ptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar02: +; DARWIN-32-STATIC: movl $_ptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar02: +; DARWIN-32-DYNAMIC: movl L_ptr$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar02: +; DARWIN-32-PIC: call "L71$pb" +; DARWIN-32-PIC-NEXT: "L71$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L71$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar02: +; DARWIN-64-STATIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar02: +; DARWIN-64-DYNAMIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar02: +; DARWIN-64-PIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar03() nounwind { @@ -1052,6 +5053,45 @@ ; LINUX-64-STATIC: bar03: ; LINUX-64-STATIC: movl $dsrc, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar03: +; LINUX-32-STATIC: movl $dsrc, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar03: +; LINUX-32-PIC: movl $dsrc, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar03: +; DARWIN-32-STATIC: movl $_dsrc, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar03: +; DARWIN-32-DYNAMIC: movl $_dsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar03: +; DARWIN-32-PIC: call "L72$pb" +; DARWIN-32-PIC-NEXT: "L72$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _dsrc-"L72$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar03: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar03: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar03: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar04() nounwind { @@ -1060,6 +5100,45 @@ ; LINUX-64-STATIC: bar04: ; LINUX-64-STATIC: movl $ddst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar04: +; LINUX-32-STATIC: movl $ddst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar04: +; LINUX-32-PIC: movl $ddst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar04: +; DARWIN-32-STATIC: movl $_ddst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar04: +; DARWIN-32-DYNAMIC: movl $_ddst, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar04: +; DARWIN-32-PIC: call "L73$pb" +; DARWIN-32-PIC-NEXT: "L73$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ddst-"L73$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar05() nounwind { @@ -1068,6 +5147,45 @@ ; LINUX-64-STATIC: bar05: ; LINUX-64-STATIC: movl $dptr, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar05: +; LINUX-32-STATIC: movl $dptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar05: +; LINUX-32-PIC: movl $dptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar05: +; LINUX-64-PIC: movq dptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar05: +; DARWIN-32-STATIC: movl $_dptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar05: +; DARWIN-32-DYNAMIC: movl $_dptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar05: +; DARWIN-32-PIC: call "L74$pb" +; DARWIN-32-PIC-NEXT: "L74$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _dptr-"L74$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar05: +; DARWIN-64-STATIC: leaq _dptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar05: +; DARWIN-64-DYNAMIC: leaq _dptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar05: +; DARWIN-64-PIC: leaq _dptr(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar06() nounwind { @@ -1076,6 +5194,45 @@ ; LINUX-64-STATIC: bar06: ; LINUX-64-STATIC: movl $lsrc, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar06: +; LINUX-32-STATIC: movl $lsrc, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar06: +; LINUX-32-PIC: movl $lsrc, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar06: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar06: +; DARWIN-32-STATIC: movl $_lsrc, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar06: +; DARWIN-32-DYNAMIC: movl $_lsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar06: +; DARWIN-32-PIC: call "L75$pb" +; DARWIN-32-PIC-NEXT: "L75$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _lsrc-"L75$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar06: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar06: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar06: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar07() nounwind { @@ -1084,6 +5241,45 @@ ; LINUX-64-STATIC: bar07: ; LINUX-64-STATIC: movl $ldst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar07: +; LINUX-32-STATIC: movl $ldst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar07: +; LINUX-32-PIC: movl $ldst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar07: +; DARWIN-32-STATIC: movl $_ldst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar07: +; DARWIN-32-DYNAMIC: movl $_ldst, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar07: +; DARWIN-32-PIC: call "L76$pb" +; DARWIN-32-PIC-NEXT: "L76$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ldst-"L76$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bar08() nounwind { @@ -1092,6 +5288,45 @@ ; LINUX-64-STATIC: bar08: ; LINUX-64-STATIC: movl $lptr, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bar08: +; LINUX-32-STATIC: movl $lptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bar08: +; LINUX-32-PIC: movl $lptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bar08: +; LINUX-64-PIC: leaq lptr(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bar08: +; DARWIN-32-STATIC: movl $_lptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bar08: +; DARWIN-32-DYNAMIC: movl $_lptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bar08: +; DARWIN-32-PIC: call "L77$pb" +; DARWIN-32-PIC-NEXT: "L77$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _lptr-"L77$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bar08: +; DARWIN-64-STATIC: leaq _lptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bar08: +; DARWIN-64-DYNAMIC: leaq _lptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bar08: +; DARWIN-64-PIC: leaq _lptr(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har00() nounwind { @@ -1100,6 +5335,45 @@ ; LINUX-64-STATIC: har00: ; LINUX-64-STATIC: movl $src, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har00: +; LINUX-32-STATIC: movl $src, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har00: +; LINUX-32-PIC: movl $src, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har00: +; DARWIN-32-STATIC: movl $_src, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har00: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har00: +; DARWIN-32-PIC: call "L78$pb" +; DARWIN-32-PIC-NEXT: "L78$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L78$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @hxr00() nounwind { @@ -1108,6 +5382,45 @@ ; LINUX-64-STATIC: hxr00: ; LINUX-64-STATIC: movl $xsrc, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: hxr00: +; LINUX-32-STATIC: movl $xsrc, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: hxr00: +; LINUX-32-PIC: movl $xsrc, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: hxr00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _hxr00: +; DARWIN-32-STATIC: movl $_xsrc, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _hxr00: +; DARWIN-32-DYNAMIC: movl L_xsrc$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _hxr00: +; DARWIN-32-PIC: call "L79$pb" +; DARWIN-32-PIC-NEXT: "L79$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L79$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _hxr00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _hxr00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _hxr00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har01() nounwind { @@ -1116,6 +5429,45 @@ ; LINUX-64-STATIC: har01: ; LINUX-64-STATIC: movl $dst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har01: +; LINUX-32-STATIC: movl $dst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har01: +; LINUX-32-PIC: movl $dst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har01: +; DARWIN-32-STATIC: movl $_dst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har01: +; DARWIN-32-DYNAMIC: movl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har01: +; DARWIN-32-PIC: call "L80$pb" +; DARWIN-32-PIC-NEXT: "L80$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L80$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @hxr01() nounwind { @@ -1124,6 +5476,45 @@ ; LINUX-64-STATIC: hxr01: ; LINUX-64-STATIC: movl $xdst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: hxr01: +; LINUX-32-STATIC: movl $xdst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: hxr01: +; LINUX-32-PIC: movl $xdst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: hxr01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _hxr01: +; DARWIN-32-STATIC: movl $_xdst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _hxr01: +; DARWIN-32-DYNAMIC: movl L_xdst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _hxr01: +; DARWIN-32-PIC: call "L81$pb" +; DARWIN-32-PIC-NEXT: "L81$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L81$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _hxr01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _hxr01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _hxr01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har02() nounwind { @@ -1134,6 +5525,51 @@ ; LINUX-64-STATIC: har02: ; LINUX-64-STATIC: movq ptr(%rip), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har02: +; LINUX-32-STATIC: movl ptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har02: +; LINUX-32-PIC: movl ptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har02: +; LINUX-64-PIC: movq ptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har02: +; DARWIN-32-STATIC: movl _ptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har02: +; DARWIN-32-DYNAMIC: movl L_ptr$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har02: +; DARWIN-32-PIC: call "L82$pb" +; DARWIN-32-PIC-NEXT: "L82$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L82$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har02: +; DARWIN-64-STATIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq (%rax), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har02: +; DARWIN-64-DYNAMIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq (%rax), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har02: +; DARWIN-64-PIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq (%rax), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har03() nounwind { @@ -1142,6 +5578,45 @@ ; LINUX-64-STATIC: har03: ; LINUX-64-STATIC: movl $dsrc, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har03: +; LINUX-32-STATIC: movl $dsrc, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har03: +; LINUX-32-PIC: movl $dsrc, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har03: +; DARWIN-32-STATIC: movl $_dsrc, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har03: +; DARWIN-32-DYNAMIC: movl $_dsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har03: +; DARWIN-32-PIC: call "L83$pb" +; DARWIN-32-PIC-NEXT: "L83$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _dsrc-"L83$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har03: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har03: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har03: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har04() nounwind { @@ -1150,6 +5625,45 @@ ; LINUX-64-STATIC: har04: ; LINUX-64-STATIC: movl $ddst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har04: +; LINUX-32-STATIC: movl $ddst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har04: +; LINUX-32-PIC: movl $ddst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har04: +; DARWIN-32-STATIC: movl $_ddst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har04: +; DARWIN-32-DYNAMIC: movl $_ddst, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har04: +; DARWIN-32-PIC: call "L84$pb" +; DARWIN-32-PIC-NEXT: "L84$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ddst-"L84$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har05() nounwind { @@ -1160,6 +5674,46 @@ ; LINUX-64-STATIC: har05: ; LINUX-64-STATIC: movq dptr(%rip), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har05: +; LINUX-32-STATIC: movl dptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har05: +; LINUX-32-PIC: movl dptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har05: +; LINUX-64-PIC: movq dptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har05: +; DARWIN-32-STATIC: movl _dptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har05: +; DARWIN-32-DYNAMIC: movl _dptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har05: +; DARWIN-32-PIC: call "L85$pb" +; DARWIN-32-PIC-NEXT: "L85$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dptr-"L85$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har05: +; DARWIN-64-STATIC: movq _dptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har05: +; DARWIN-64-DYNAMIC: movq _dptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har05: +; DARWIN-64-PIC: movq _dptr(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har06() nounwind { @@ -1168,6 +5722,45 @@ ; LINUX-64-STATIC: har06: ; LINUX-64-STATIC: movl $lsrc, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har06: +; LINUX-32-STATIC: movl $lsrc, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har06: +; LINUX-32-PIC: movl $lsrc, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har06: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har06: +; DARWIN-32-STATIC: movl $_lsrc, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har06: +; DARWIN-32-DYNAMIC: movl $_lsrc, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har06: +; DARWIN-32-PIC: call "L86$pb" +; DARWIN-32-PIC-NEXT: "L86$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _lsrc-"L86$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har06: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har06: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har06: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har07() nounwind { @@ -1176,6 +5769,45 @@ ; LINUX-64-STATIC: har07: ; LINUX-64-STATIC: movl $ldst, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har07: +; LINUX-32-STATIC: movl $ldst, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har07: +; LINUX-32-PIC: movl $ldst, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har07: +; DARWIN-32-STATIC: movl $_ldst, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har07: +; DARWIN-32-DYNAMIC: movl $_ldst, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har07: +; DARWIN-32-PIC: call "L87$pb" +; DARWIN-32-PIC-NEXT: "L87$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ldst-"L87$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @har08() nounwind { @@ -1186,6 +5818,45 @@ ; LINUX-64-STATIC: har08: ; LINUX-64-STATIC: movq lptr(%rip), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: har08: +; LINUX-32-STATIC: movl lptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: har08: +; LINUX-32-PIC: movl lptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: har08: +; LINUX-64-PIC: movq lptr(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _har08: +; DARWIN-32-STATIC: movl _lptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _har08: +; DARWIN-32-DYNAMIC: movl _lptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _har08: +; DARWIN-32-PIC: call "L88$pb" +; DARWIN-32-PIC-NEXT: "L88$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lptr-"L88$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _har08: +; DARWIN-64-STATIC: movq _lptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _har08: +; DARWIN-64-DYNAMIC: movq _lptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _har08: +; DARWIN-64-PIC: movq _lptr(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat00() nounwind { @@ -1194,6 +5865,51 @@ ; LINUX-64-STATIC: bat00: ; LINUX-64-STATIC: movl $src+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat00: +; LINUX-32-STATIC: movl $src+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat00: +; LINUX-32-PIC: movl $src+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat00: +; DARWIN-32-STATIC: movl $_src+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat00: +; DARWIN-32-DYNAMIC: movl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat00: +; DARWIN-32-PIC: call "L89$pb" +; DARWIN-32-PIC-NEXT: "L89$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L89$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: addl $64, %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bxt00() nounwind { @@ -1202,6 +5918,51 @@ ; LINUX-64-STATIC: bxt00: ; LINUX-64-STATIC: movl $xsrc+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bxt00: +; LINUX-32-STATIC: movl $xsrc+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bxt00: +; LINUX-32-PIC: movl $xsrc+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bxt00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bxt00: +; DARWIN-32-STATIC: movl $_xsrc+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bxt00: +; DARWIN-32-DYNAMIC: movl L_xsrc$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bxt00: +; DARWIN-32-PIC: call "L90$pb" +; DARWIN-32-PIC-NEXT: "L90$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L90$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: addl $64, %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bxt00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bxt00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bxt00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat01() nounwind { @@ -1210,6 +5971,51 @@ ; LINUX-64-STATIC: bat01: ; LINUX-64-STATIC: movl $dst+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat01: +; LINUX-32-STATIC: movl $dst+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat01: +; LINUX-32-PIC: movl $dst+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat01: +; DARWIN-32-STATIC: movl $_dst+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat01: +; DARWIN-32-DYNAMIC: movl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat01: +; DARWIN-32-PIC: call "L91$pb" +; DARWIN-32-PIC-NEXT: "L91$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L91$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: addl $64, %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bxt01() nounwind { @@ -1218,6 +6024,51 @@ ; LINUX-64-STATIC: bxt01: ; LINUX-64-STATIC: movl $xdst+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bxt01: +; LINUX-32-STATIC: movl $xdst+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bxt01: +; LINUX-32-PIC: movl $xdst+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bxt01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bxt01: +; DARWIN-32-STATIC: movl $_xdst+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bxt01: +; DARWIN-32-DYNAMIC: movl L_xdst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bxt01: +; DARWIN-32-PIC: call "L92$pb" +; DARWIN-32-PIC-NEXT: "L92$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L92$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: addl $64, %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bxt01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bxt01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bxt01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat02() nounwind { @@ -1230,6 +6081,60 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rax ; LINUX-64-STATIC: addq $64, %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat02: +; LINUX-32-STATIC: movl ptr, %eax +; LINUX-32-STATIC-NEXT: addl $64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat02: +; LINUX-32-PIC: movl ptr, %eax +; LINUX-32-PIC-NEXT: addl $64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat02: +; LINUX-64-PIC: movq ptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat02: +; DARWIN-32-STATIC: movl _ptr, %eax +; DARWIN-32-STATIC-NEXT: addl $64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat02: +; DARWIN-32-DYNAMIC: movl L_ptr$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat02: +; DARWIN-32-PIC: call "L93$pb" +; DARWIN-32-PIC-NEXT: "L93$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L93$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: addl $64, %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat02: +; DARWIN-64-STATIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq (%rax), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat02: +; DARWIN-64-DYNAMIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq (%rax), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat02: +; DARWIN-64-PIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq (%rax), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat03() nounwind { @@ -1238,6 +6143,46 @@ ; LINUX-64-STATIC: bat03: ; LINUX-64-STATIC: movl $dsrc+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat03: +; LINUX-32-STATIC: movl $dsrc+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat03: +; LINUX-32-PIC: movl $dsrc+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat03: +; DARWIN-32-STATIC: movl $_dsrc+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat03: +; DARWIN-32-DYNAMIC: movl $_dsrc+64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat03: +; DARWIN-32-PIC: call "L94$pb" +; DARWIN-32-PIC-NEXT: "L94$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _dsrc+64-"L94$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat03: +; DARWIN-64-STATIC: leaq _dsrc+64(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat03: +; DARWIN-64-DYNAMIC: leaq _dsrc+64(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat03: +; DARWIN-64-PIC: leaq _dsrc+64(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat04() nounwind { @@ -1246,6 +6191,46 @@ ; LINUX-64-STATIC: bat04: ; LINUX-64-STATIC: movl $ddst+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat04: +; LINUX-32-STATIC: movl $ddst+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat04: +; LINUX-32-PIC: movl $ddst+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat04: +; DARWIN-32-STATIC: movl $_ddst+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat04: +; DARWIN-32-DYNAMIC: movl $_ddst+64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat04: +; DARWIN-32-PIC: call "L95$pb" +; DARWIN-32-PIC-NEXT: "L95$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ddst+64-"L95$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat04: +; DARWIN-64-STATIC: leaq _ddst+64(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat04: +; DARWIN-64-DYNAMIC: leaq _ddst+64(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat04: +; DARWIN-64-PIC: leaq _ddst+64(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat05() nounwind { @@ -1258,6 +6243,55 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rax ; LINUX-64-STATIC: addq $64, %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat05: +; LINUX-32-STATIC: movl dptr, %eax +; LINUX-32-STATIC-NEXT: addl $64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat05: +; LINUX-32-PIC: movl dptr, %eax +; LINUX-32-PIC-NEXT: addl $64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat05: +; LINUX-64-PIC: movq dptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat05: +; DARWIN-32-STATIC: movl _dptr, %eax +; DARWIN-32-STATIC-NEXT: addl $64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat05: +; DARWIN-32-DYNAMIC: movl _dptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat05: +; DARWIN-32-PIC: call "L96$pb" +; DARWIN-32-PIC-NEXT: "L96$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _dptr-"L96$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: addl $64, %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat05: +; DARWIN-64-STATIC: movq _dptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat05: +; DARWIN-64-DYNAMIC: movq _dptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat05: +; DARWIN-64-PIC: movq _dptr(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat06() nounwind { @@ -1266,6 +6300,45 @@ ; LINUX-64-STATIC: bat06: ; LINUX-64-STATIC: movl $lsrc+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat06: +; LINUX-32-STATIC: movl $lsrc+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat06: +; LINUX-32-PIC: movl $lsrc+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat06: +; LINUX-64-PIC: leaq lsrc+64(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat06: +; DARWIN-32-STATIC: movl $_lsrc+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat06: +; DARWIN-32-DYNAMIC: movl $_lsrc+64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat06: +; DARWIN-32-PIC: call "L97$pb" +; DARWIN-32-PIC-NEXT: "L97$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _lsrc+64-"L97$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat06: +; DARWIN-64-STATIC: leaq _lsrc+64(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat06: +; DARWIN-64-DYNAMIC: leaq _lsrc+64(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat06: +; DARWIN-64-PIC: leaq _lsrc+64(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat07() nounwind { @@ -1274,6 +6347,45 @@ ; LINUX-64-STATIC: bat07: ; LINUX-64-STATIC: movl $ldst+64, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat07: +; LINUX-32-STATIC: movl $ldst+64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat07: +; LINUX-32-PIC: movl $ldst+64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat07: +; LINUX-64-PIC: leaq ldst+64(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat07: +; DARWIN-32-STATIC: movl $_ldst+64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat07: +; DARWIN-32-DYNAMIC: movl $_ldst+64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat07: +; DARWIN-32-PIC: call "L98$pb" +; DARWIN-32-PIC-NEXT: "L98$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ldst+64-"L98$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat07: +; DARWIN-64-STATIC: leaq _ldst+64(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat07: +; DARWIN-64-DYNAMIC: leaq _ldst+64(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat07: +; DARWIN-64-PIC: leaq _ldst+64(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bat08() nounwind { @@ -1286,6 +6398,54 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rax ; LINUX-64-STATIC: addq $64, %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bat08: +; LINUX-32-STATIC: movl lptr, %eax +; LINUX-32-STATIC-NEXT: addl $64, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bat08: +; LINUX-32-PIC: movl lptr, %eax +; LINUX-32-PIC-NEXT: addl $64, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bat08: +; LINUX-64-PIC: movq lptr(%rip), %rax +; LINUX-64-PIC-NEXT: addq $64, %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bat08: +; DARWIN-32-STATIC: movl _lptr, %eax +; DARWIN-32-STATIC-NEXT: addl $64, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bat08: +; DARWIN-32-DYNAMIC: movl _lptr, %eax +; DARWIN-32-DYNAMIC-NEXT: addl $64, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bat08: +; DARWIN-32-PIC: call "L99$pb" +; DARWIN-32-PIC-NEXT: "L99$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl _lptr-"L99$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: addl $64, %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bat08: +; DARWIN-64-STATIC: movq _lptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: addq $64, %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bat08: +; DARWIN-64-DYNAMIC: movq _lptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: addq $64, %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bat08: +; DARWIN-64-PIC: movq _lptr(%rip), %rax +; DARWIN-64-PIC-NEXT: addq $64, %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam00() nounwind { @@ -1294,6 +6454,51 @@ ; LINUX-64-STATIC: bam00: ; LINUX-64-STATIC: movl $src+262144, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam00: +; LINUX-32-STATIC: movl $src+262144, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam00: +; LINUX-32-PIC: movl $src+262144, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam00: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam00: +; DARWIN-32-STATIC: movl $_src+262144, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam00: +; DARWIN-32-DYNAMIC: movl $262144, %eax +; DARWIN-32-DYNAMIC-NEXT: addl L_src$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam00: +; DARWIN-32-PIC: call "L100$pb" +; DARWIN-32-PIC-NEXT: "L100$pb": +; DARWIN-32-PIC-NEXT: popl %ecx +; DARWIN-32-PIC-NEXT: movl $262144, %eax +; DARWIN-32-PIC-NEXT: addl L_src$non_lazy_ptr-"L100$pb"(%ecx), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam00: +; DARWIN-64-STATIC: movl $262144, %eax +; DARWIN-64-STATIC-NEXT: addq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam00: +; DARWIN-64-DYNAMIC: movl $262144, %eax +; DARWIN-64-DYNAMIC-NEXT: addq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam00: +; DARWIN-64-PIC: movl $262144, %eax +; DARWIN-64-PIC-NEXT: addq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam01() nounwind { @@ -1302,6 +6507,51 @@ ; LINUX-64-STATIC: bam01: ; LINUX-64-STATIC: movl $dst+262144, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam01: +; LINUX-32-STATIC: movl $dst+262144, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam01: +; LINUX-32-PIC: movl $dst+262144, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam01: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam01: +; DARWIN-32-STATIC: movl $_dst+262144, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam01: +; DARWIN-32-DYNAMIC: movl $262144, %eax +; DARWIN-32-DYNAMIC-NEXT: addl L_dst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam01: +; DARWIN-32-PIC: call "L101$pb" +; DARWIN-32-PIC-NEXT: "L101$pb": +; DARWIN-32-PIC-NEXT: popl %ecx +; DARWIN-32-PIC-NEXT: movl $262144, %eax +; DARWIN-32-PIC-NEXT: addl L_dst$non_lazy_ptr-"L101$pb"(%ecx), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam01: +; DARWIN-64-STATIC: movl $262144, %eax +; DARWIN-64-STATIC-NEXT: addq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam01: +; DARWIN-64-DYNAMIC: movl $262144, %eax +; DARWIN-64-DYNAMIC-NEXT: addq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam01: +; DARWIN-64-PIC: movl $262144, %eax +; DARWIN-64-PIC-NEXT: addq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bxm01() nounwind { @@ -1310,6 +6560,51 @@ ; LINUX-64-STATIC: bxm01: ; LINUX-64-STATIC: movl $xdst+262144, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bxm01: +; LINUX-32-STATIC: movl $xdst+262144, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bxm01: +; LINUX-32-PIC: movl $xdst+262144, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bxm01: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bxm01: +; DARWIN-32-STATIC: movl $_xdst+262144, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bxm01: +; DARWIN-32-DYNAMIC: movl $262144, %eax +; DARWIN-32-DYNAMIC-NEXT: addl L_xdst$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bxm01: +; DARWIN-32-PIC: call "L102$pb" +; DARWIN-32-PIC-NEXT: "L102$pb": +; DARWIN-32-PIC-NEXT: popl %ecx +; DARWIN-32-PIC-NEXT: movl $262144, %eax +; DARWIN-32-PIC-NEXT: addl L_xdst$non_lazy_ptr-"L102$pb"(%ecx), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bxm01: +; DARWIN-64-STATIC: movl $262144, %eax +; DARWIN-64-STATIC-NEXT: addq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bxm01: +; DARWIN-64-DYNAMIC: movl $262144, %eax +; DARWIN-64-DYNAMIC-NEXT: addq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bxm01: +; DARWIN-64-PIC: movl $262144, %eax +; DARWIN-64-PIC-NEXT: addq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam02() nounwind { @@ -1322,6 +6617,60 @@ ; LINUX-64-STATIC: movl $262144, %eax ; LINUX-64-STATIC: addq ptr(%rip), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam02: +; LINUX-32-STATIC: movl $262144, %eax +; LINUX-32-STATIC-NEXT: addl ptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam02: +; LINUX-32-PIC: movl $262144, %eax +; LINUX-32-PIC-NEXT: addl ptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam02: +; LINUX-64-PIC: movq ptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq (%rcx), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam02: +; DARWIN-32-STATIC: movl $262144, %eax +; DARWIN-32-STATIC-NEXT: addl _ptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam02: +; DARWIN-32-DYNAMIC: movl L_ptr$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: movl $262144, %eax +; DARWIN-32-DYNAMIC-NEXT: addl (%ecx), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam02: +; DARWIN-32-PIC: call "L103$pb" +; DARWIN-32-PIC-NEXT: "L103$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L103$pb"(%eax), %ecx +; DARWIN-32-PIC-NEXT: movl $262144, %eax +; DARWIN-32-PIC-NEXT: addl (%ecx), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam02: +; DARWIN-64-STATIC: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-STATIC-NEXT: movl $262144, %eax +; DARWIN-64-STATIC-NEXT: addq (%rcx), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam02: +; DARWIN-64-DYNAMIC: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-DYNAMIC-NEXT: movl $262144, %eax +; DARWIN-64-DYNAMIC-NEXT: addq (%rcx), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam02: +; DARWIN-64-PIC: movq _ptr at GOTPCREL(%rip), %rcx +; DARWIN-64-PIC-NEXT: movl $262144, %eax +; DARWIN-64-PIC-NEXT: addq (%rcx), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam03() nounwind { @@ -1330,6 +6679,46 @@ ; LINUX-64-STATIC: bam03: ; LINUX-64-STATIC: movl $dsrc+262144, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam03: +; LINUX-32-STATIC: movl $dsrc+262144, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam03: +; LINUX-32-PIC: movl $dsrc+262144, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam03: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam03: +; DARWIN-32-STATIC: movl $_dsrc+262144, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam03: +; DARWIN-32-DYNAMIC: movl $_dsrc+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam03: +; DARWIN-32-PIC: call "L104$pb" +; DARWIN-32-PIC-NEXT: "L104$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _dsrc+262144-"L104$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam03: +; DARWIN-64-STATIC: leaq _dsrc+262144(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam03: +; DARWIN-64-DYNAMIC: leaq _dsrc+262144(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam03: +; DARWIN-64-PIC: leaq _dsrc+262144(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam04() nounwind { @@ -1338,6 +6727,46 @@ ; LINUX-64-STATIC: bam04: ; LINUX-64-STATIC: movl $ddst+262144, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam04: +; LINUX-32-STATIC: movl $ddst+262144, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam04: +; LINUX-32-PIC: movl $ddst+262144, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam04: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam04: +; DARWIN-32-STATIC: movl $_ddst+262144, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam04: +; DARWIN-32-DYNAMIC: movl $_ddst+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam04: +; DARWIN-32-PIC: call "L105$pb" +; DARWIN-32-PIC-NEXT: "L105$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ddst+262144-"L105$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam04: +; DARWIN-64-STATIC: leaq _ddst+262144(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam04: +; DARWIN-64-DYNAMIC: leaq _ddst+262144(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam04: +; DARWIN-64-PIC: leaq _ddst+262144(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam05() nounwind { @@ -1350,6 +6779,55 @@ ; LINUX-64-STATIC: movl $262144, %eax ; LINUX-64-STATIC: addq dptr(%rip), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam05: +; LINUX-32-STATIC: movl $262144, %eax +; LINUX-32-STATIC-NEXT: addl dptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam05: +; LINUX-32-PIC: movl $262144, %eax +; LINUX-32-PIC-NEXT: addl dptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam05: +; LINUX-64-PIC: movq dptr at GOTPCREL(%rip), %rcx +; LINUX-64-PIC-NEXT: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq (%rcx), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam05: +; DARWIN-32-STATIC: movl $262144, %eax +; DARWIN-32-STATIC-NEXT: addl _dptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam05: +; DARWIN-32-DYNAMIC: movl $262144, %eax +; DARWIN-32-DYNAMIC-NEXT: addl _dptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam05: +; DARWIN-32-PIC: call "L106$pb" +; DARWIN-32-PIC-NEXT: "L106$pb": +; DARWIN-32-PIC-NEXT: popl %ecx +; DARWIN-32-PIC-NEXT: movl $262144, %eax +; DARWIN-32-PIC-NEXT: addl _dptr-"L106$pb"(%ecx), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam05: +; DARWIN-64-STATIC: movl $262144, %eax +; DARWIN-64-STATIC-NEXT: addq _dptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam05: +; DARWIN-64-DYNAMIC: movl $262144, %eax +; DARWIN-64-DYNAMIC-NEXT: addq _dptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam05: +; DARWIN-64-PIC: movl $262144, %eax +; DARWIN-64-PIC-NEXT: addq _dptr(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam06() nounwind { @@ -1358,6 +6836,45 @@ ; LINUX-64-STATIC: bam06: ; LINUX-64-STATIC: movl $lsrc+262144, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam06: +; LINUX-32-STATIC: movl $lsrc+262144, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam06: +; LINUX-32-PIC: movl $lsrc+262144, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam06: +; LINUX-64-PIC: leaq lsrc+262144(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam06: +; DARWIN-32-STATIC: movl $_lsrc+262144, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam06: +; DARWIN-32-DYNAMIC: movl $_lsrc+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam06: +; DARWIN-32-PIC: call "L107$pb" +; DARWIN-32-PIC-NEXT: "L107$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _lsrc+262144-"L107$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam06: +; DARWIN-64-STATIC: leaq _lsrc+262144(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam06: +; DARWIN-64-DYNAMIC: leaq _lsrc+262144(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam06: +; DARWIN-64-PIC: leaq _lsrc+262144(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam07() nounwind { @@ -1366,6 +6883,45 @@ ; LINUX-64-STATIC: bam07: ; LINUX-64-STATIC: movl $ldst+262144, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam07: +; LINUX-32-STATIC: movl $ldst+262144, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam07: +; LINUX-32-PIC: movl $ldst+262144, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam07: +; LINUX-64-PIC: leaq ldst+262144(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam07: +; DARWIN-32-STATIC: movl $_ldst+262144, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam07: +; DARWIN-32-DYNAMIC: movl $_ldst+262144, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam07: +; DARWIN-32-PIC: call "L108$pb" +; DARWIN-32-PIC-NEXT: "L108$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _ldst+262144-"L108$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam07: +; DARWIN-64-STATIC: leaq _ldst+262144(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam07: +; DARWIN-64-DYNAMIC: leaq _ldst+262144(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam07: +; DARWIN-64-PIC: leaq _ldst+262144(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @bam08() nounwind { @@ -1378,6 +6934,54 @@ ; LINUX-64-STATIC: movl $262144, %eax ; LINUX-64-STATIC: addq lptr(%rip), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: bam08: +; LINUX-32-STATIC: movl $262144, %eax +; LINUX-32-STATIC-NEXT: addl lptr, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: bam08: +; LINUX-32-PIC: movl $262144, %eax +; LINUX-32-PIC-NEXT: addl lptr, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: bam08: +; LINUX-64-PIC: movl $262144, %eax +; LINUX-64-PIC-NEXT: addq lptr(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _bam08: +; DARWIN-32-STATIC: movl $262144, %eax +; DARWIN-32-STATIC-NEXT: addl _lptr, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _bam08: +; DARWIN-32-DYNAMIC: movl $262144, %eax +; DARWIN-32-DYNAMIC-NEXT: addl _lptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _bam08: +; DARWIN-32-PIC: call "L109$pb" +; DARWIN-32-PIC-NEXT: "L109$pb": +; DARWIN-32-PIC-NEXT: popl %ecx +; DARWIN-32-PIC-NEXT: movl $262144, %eax +; DARWIN-32-PIC-NEXT: addl _lptr-"L109$pb"(%ecx), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _bam08: +; DARWIN-64-STATIC: movl $262144, %eax +; DARWIN-64-STATIC-NEXT: addq _lptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _bam08: +; DARWIN-64-DYNAMIC: movl $262144, %eax +; DARWIN-64-DYNAMIC-NEXT: addq _lptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _bam08: +; DARWIN-64-PIC: movl $262144, %eax +; DARWIN-64-PIC-NEXT: addq _lptr(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat00(i64 %i) nounwind { @@ -1389,6 +6993,56 @@ ; LINUX-64-STATIC: cat00: ; LINUX-64-STATIC: leaq src+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal src+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal src+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _src+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat00: +; DARWIN-32-PIC: call "L110$pb" +; DARWIN-32-PIC-NEXT: "L110$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L110$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cxt00(i64 %i) nounwind { @@ -1400,6 +7054,56 @@ ; LINUX-64-STATIC: cxt00: ; LINUX-64-STATIC: leaq xsrc+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cxt00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal xsrc+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cxt00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal xsrc+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cxt00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cxt00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _xsrc+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cxt00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cxt00: +; DARWIN-32-PIC: call "L111$pb" +; DARWIN-32-PIC-NEXT: "L111$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L111$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cxt00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cxt00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cxt00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat01(i64 %i) nounwind { @@ -1411,6 +7115,56 @@ ; LINUX-64-STATIC: cat01: ; LINUX-64-STATIC: leaq dst+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal dst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal dst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _dst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat01: +; DARWIN-32-PIC: call "L112$pb" +; DARWIN-32-PIC-NEXT: "L112$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L112$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cxt01(i64 %i) nounwind { @@ -1422,6 +7176,56 @@ ; LINUX-64-STATIC: cxt01: ; LINUX-64-STATIC: leaq xdst+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cxt01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal xdst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cxt01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal xdst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cxt01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cxt01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _xdst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cxt01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cxt01: +; DARWIN-32-PIC: call "L113$pb" +; DARWIN-32-PIC-NEXT: "L113$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L113$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cxt01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cxt01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cxt01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat02(i64 %i) nounwind { @@ -1435,6 +7239,65 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rax ; LINUX-64-STATIC: leaq 64(%rax,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat02: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl ptr, %ecx +; LINUX-32-STATIC-NEXT: leal 64(%ecx,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat02: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl ptr, %ecx +; LINUX-32-PIC-NEXT: leal 64(%ecx,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat02: +; LINUX-64-PIC: movq ptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat02: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx +; DARWIN-32-STATIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat02: +; DARWIN-32-DYNAMIC: movl L_ptr$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat02: +; DARWIN-32-PIC: call "L114$pb" +; DARWIN-32-PIC-NEXT: "L114$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L114$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat02: +; DARWIN-64-STATIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq (%rax), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat02: +; DARWIN-64-DYNAMIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq (%rax), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat02: +; DARWIN-64-PIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq (%rax), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat03(i64 %i) nounwind { @@ -1446,6 +7309,54 @@ ; LINUX-64-STATIC: cat03: ; LINUX-64-STATIC: leaq dsrc+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat03: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal dsrc+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat03: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal dsrc+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat03: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _dsrc+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat03: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _dsrc+64(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat03: +; DARWIN-32-PIC: call "L115$pb" +; DARWIN-32-PIC-NEXT: "L115$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _dsrc+64-"L115$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat03: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat03: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat03: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat04(i64 %i) nounwind { @@ -1457,6 +7368,54 @@ ; LINUX-64-STATIC: cat04: ; LINUX-64-STATIC: leaq ddst+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat04: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ddst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat04: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ddst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat04: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ddst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat04: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ddst+64(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat04: +; DARWIN-32-PIC: call "L116$pb" +; DARWIN-32-PIC-NEXT: "L116$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ddst+64-"L116$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat05(i64 %i) nounwind { @@ -1470,6 +7429,60 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rax ; LINUX-64-STATIC: leaq 64(%rax,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat05: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dptr, %ecx +; LINUX-32-STATIC-NEXT: leal 64(%ecx,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat05: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dptr, %ecx +; LINUX-32-PIC-NEXT: leal 64(%ecx,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat05: +; LINUX-64-PIC: movq dptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat05: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dptr, %ecx +; DARWIN-32-STATIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat05: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat05: +; DARWIN-32-PIC: call "L117$pb" +; DARWIN-32-PIC-NEXT: "L117$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dptr-"L117$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat05: +; DARWIN-64-STATIC: movq _dptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat05: +; DARWIN-64-DYNAMIC: movq _dptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat05: +; DARWIN-64-PIC: movq _dptr(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat06(i64 %i) nounwind { @@ -1481,6 +7494,54 @@ ; LINUX-64-STATIC: cat06: ; LINUX-64-STATIC: leaq lsrc+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat06: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal lsrc+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat06: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal lsrc+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat06: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat06: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _lsrc+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat06: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _lsrc+64(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat06: +; DARWIN-32-PIC: call "L118$pb" +; DARWIN-32-PIC-NEXT: "L118$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _lsrc+64-"L118$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat06: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat06: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat06: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat07(i64 %i) nounwind { @@ -1492,6 +7553,54 @@ ; LINUX-64-STATIC: cat07: ; LINUX-64-STATIC: leaq ldst+64(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat07: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ldst+64(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat07: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ldst+64(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat07: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ldst+64(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat07: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ldst+64(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat07: +; DARWIN-32-PIC: call "L119$pb" +; DARWIN-32-PIC-NEXT: "L119$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ldst+64-"L119$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cat08(i64 %i) nounwind { @@ -1505,6 +7614,59 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rax ; LINUX-64-STATIC: leaq 64(%rax,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cat08: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lptr, %ecx +; LINUX-32-STATIC-NEXT: leal 64(%ecx,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cat08: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lptr, %ecx +; LINUX-32-PIC-NEXT: leal 64(%ecx,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cat08: +; LINUX-64-PIC: movq lptr(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cat08: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lptr, %ecx +; DARWIN-32-STATIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cat08: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 64(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cat08: +; DARWIN-32-PIC: call "L120$pb" +; DARWIN-32-PIC-NEXT: "L120$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lptr-"L120$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 64(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cat08: +; DARWIN-64-STATIC: movq _lptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cat08: +; DARWIN-64-DYNAMIC: movq _lptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cat08: +; DARWIN-64-PIC: movq _lptr(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 64(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam00(i64 %i) nounwind { @@ -1516,6 +7678,56 @@ ; LINUX-64-STATIC: cam00: ; LINUX-64-STATIC: leaq src+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal src+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal src+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam00: +; LINUX-64-PIC: movq src at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _src+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_src$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam00: +; DARWIN-32-PIC: call "L121$pb" +; DARWIN-32-PIC-NEXT: "L121$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_src$non_lazy_ptr-"L121$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam00: +; DARWIN-64-STATIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam00: +; DARWIN-64-DYNAMIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam00: +; DARWIN-64-PIC: movq _src at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cxm00(i64 %i) nounwind { @@ -1527,6 +7739,56 @@ ; LINUX-64-STATIC: cxm00: ; LINUX-64-STATIC: leaq xsrc+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cxm00: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal xsrc+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cxm00: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal xsrc+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cxm00: +; LINUX-64-PIC: movq xsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cxm00: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _xsrc+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cxm00: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xsrc$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cxm00: +; DARWIN-32-PIC: call "L122$pb" +; DARWIN-32-PIC-NEXT: "L122$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xsrc$non_lazy_ptr-"L122$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cxm00: +; DARWIN-64-STATIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cxm00: +; DARWIN-64-DYNAMIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cxm00: +; DARWIN-64-PIC: movq _xsrc at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam01(i64 %i) nounwind { @@ -1538,6 +7800,56 @@ ; LINUX-64-STATIC: cam01: ; LINUX-64-STATIC: leaq dst+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal dst+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal dst+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam01: +; LINUX-64-PIC: movq dst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _dst+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_dst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam01: +; DARWIN-32-PIC: call "L123$pb" +; DARWIN-32-PIC-NEXT: "L123$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_dst$non_lazy_ptr-"L123$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam01: +; DARWIN-64-STATIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam01: +; DARWIN-64-DYNAMIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam01: +; DARWIN-64-PIC: movq _dst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cxm01(i64 %i) nounwind { @@ -1549,6 +7861,56 @@ ; LINUX-64-STATIC: cxm01: ; LINUX-64-STATIC: leaq xdst+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cxm01: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal xdst+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cxm01: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal xdst+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cxm01: +; LINUX-64-PIC: movq xdst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cxm01: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _xdst+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cxm01: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl L_xdst$non_lazy_ptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cxm01: +; DARWIN-32-PIC: call "L124$pb" +; DARWIN-32-PIC-NEXT: "L124$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl L_xdst$non_lazy_ptr-"L124$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cxm01: +; DARWIN-64-STATIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cxm01: +; DARWIN-64-DYNAMIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cxm01: +; DARWIN-64-PIC: movq _xdst at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam02(i64 %i) nounwind { @@ -1562,6 +7924,65 @@ ; LINUX-64-STATIC: movq ptr(%rip), %rax ; LINUX-64-STATIC: leaq 262144(%rax,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam02: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl ptr, %ecx +; LINUX-32-STATIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam02: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl ptr, %ecx +; LINUX-32-PIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam02: +; LINUX-64-PIC: movq ptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam02: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _ptr, %ecx +; DARWIN-32-STATIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam02: +; DARWIN-32-DYNAMIC: movl L_ptr$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: movl (%eax), %eax +; DARWIN-32-DYNAMIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam02: +; DARWIN-32-PIC: call "L125$pb" +; DARWIN-32-PIC-NEXT: "L125$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ptr$non_lazy_ptr-"L125$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: movl (%eax), %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam02: +; DARWIN-64-STATIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: movq (%rax), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam02: +; DARWIN-64-DYNAMIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: movq (%rax), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam02: +; DARWIN-64-PIC: movq _ptr at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: movq (%rax), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam03(i64 %i) nounwind { @@ -1573,6 +7994,54 @@ ; LINUX-64-STATIC: cam03: ; LINUX-64-STATIC: leaq dsrc+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam03: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal dsrc+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam03: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal dsrc+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam03: +; LINUX-64-PIC: movq dsrc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam03: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _dsrc+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam03: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _dsrc+262144(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam03: +; DARWIN-32-PIC: call "L126$pb" +; DARWIN-32-PIC-NEXT: "L126$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _dsrc+262144-"L126$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam03: +; DARWIN-64-STATIC: leaq _dsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam03: +; DARWIN-64-DYNAMIC: leaq _dsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam03: +; DARWIN-64-PIC: leaq _dsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam04(i64 %i) nounwind { @@ -1584,6 +8053,54 @@ ; LINUX-64-STATIC: cam04: ; LINUX-64-STATIC: leaq ddst+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam04: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ddst+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam04: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ddst+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam04: +; LINUX-64-PIC: movq ddst at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam04: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ddst+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam04: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ddst+262144(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam04: +; DARWIN-32-PIC: call "L127$pb" +; DARWIN-32-PIC-NEXT: "L127$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ddst+262144-"L127$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam04: +; DARWIN-64-STATIC: leaq _ddst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam04: +; DARWIN-64-DYNAMIC: leaq _ddst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam04: +; DARWIN-64-PIC: leaq _ddst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam05(i64 %i) nounwind { @@ -1597,6 +8114,60 @@ ; LINUX-64-STATIC: movq dptr(%rip), %rax ; LINUX-64-STATIC: leaq 262144(%rax,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam05: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl dptr, %ecx +; LINUX-32-STATIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam05: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl dptr, %ecx +; LINUX-32-PIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam05: +; LINUX-64-PIC: movq dptr at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: movq (%rax), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam05: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _dptr, %ecx +; DARWIN-32-STATIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam05: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _dptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam05: +; DARWIN-32-PIC: call "L128$pb" +; DARWIN-32-PIC-NEXT: "L128$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _dptr-"L128$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam05: +; DARWIN-64-STATIC: movq _dptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam05: +; DARWIN-64-DYNAMIC: movq _dptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam05: +; DARWIN-64-PIC: movq _dptr(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam06(i64 %i) nounwind { @@ -1608,6 +8179,54 @@ ; LINUX-64-STATIC: cam06: ; LINUX-64-STATIC: leaq lsrc+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam06: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal lsrc+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam06: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal lsrc+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam06: +; LINUX-64-PIC: leaq lsrc(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam06: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _lsrc+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam06: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _lsrc+262144(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam06: +; DARWIN-32-PIC: call "L129$pb" +; DARWIN-32-PIC-NEXT: "L129$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _lsrc+262144-"L129$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam06: +; DARWIN-64-STATIC: leaq _lsrc(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam06: +; DARWIN-64-DYNAMIC: leaq _lsrc(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam06: +; DARWIN-64-PIC: leaq _lsrc(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam07(i64 %i) nounwind { @@ -1619,6 +8238,54 @@ ; LINUX-64-STATIC: cam07: ; LINUX-64-STATIC: leaq ldst+262144(,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam07: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: leal ldst+262144(,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam07: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: leal ldst+262144(,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam07: +; LINUX-64-PIC: leaq ldst(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam07: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: leal _ldst+262144(,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam07: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: leal _ldst+262144(,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam07: +; DARWIN-32-PIC: call "L130$pb" +; DARWIN-32-PIC-NEXT: "L130$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: leal _ldst+262144-"L130$pb"(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam07: +; DARWIN-64-STATIC: leaq _ldst(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam07: +; DARWIN-64-DYNAMIC: leaq _ldst(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam07: +; DARWIN-64-PIC: leaq _ldst(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define i8* @cam08(i64 %i) nounwind { @@ -1632,6 +8299,59 @@ ; LINUX-64-STATIC: movq lptr(%rip), %rax ; LINUX-64-STATIC: leaq 262144(%rax,%rdi,4), %rax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: cam08: +; LINUX-32-STATIC: movl 4(%esp), %eax +; LINUX-32-STATIC-NEXT: movl lptr, %ecx +; LINUX-32-STATIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: cam08: +; LINUX-32-PIC: movl 4(%esp), %eax +; LINUX-32-PIC-NEXT: movl lptr, %ecx +; LINUX-32-PIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: cam08: +; LINUX-64-PIC: movq lptr(%rip), %rax +; LINUX-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _cam08: +; DARWIN-32-STATIC: movl 4(%esp), %eax +; DARWIN-32-STATIC-NEXT: movl _lptr, %ecx +; DARWIN-32-STATIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _cam08: +; DARWIN-32-DYNAMIC: movl 4(%esp), %eax +; DARWIN-32-DYNAMIC-NEXT: movl _lptr, %ecx +; DARWIN-32-DYNAMIC-NEXT: leal 262144(%ecx,%eax,4), %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _cam08: +; DARWIN-32-PIC: call "L131$pb" +; DARWIN-32-PIC-NEXT: "L131$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl 4(%esp), %ecx +; DARWIN-32-PIC-NEXT: movl _lptr-"L131$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: leal 262144(%eax,%ecx,4), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _cam08: +; DARWIN-64-STATIC: movq _lptr(%rip), %rax +; DARWIN-64-STATIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _cam08: +; DARWIN-64-DYNAMIC: movq _lptr(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _cam08: +; DARWIN-64-PIC: movq _lptr(%rip), %rax +; DARWIN-64-PIC-NEXT: leaq 262144(%rax,%rdi,4), %rax +; DARWIN-64-PIC-NEXT: ret } define void @lcallee() nounwind { @@ -1653,6 +8373,114 @@ ; LINUX-64-STATIC: call x ; LINUX-64-STATIC: call x ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: lcallee: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call x +; LINUX-32-STATIC-NEXT: call x +; LINUX-32-STATIC-NEXT: call x +; LINUX-32-STATIC-NEXT: call x +; LINUX-32-STATIC-NEXT: call x +; LINUX-32-STATIC-NEXT: call x +; LINUX-32-STATIC-NEXT: call x +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: lcallee: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call x +; LINUX-32-PIC-NEXT: call x +; LINUX-32-PIC-NEXT: call x +; LINUX-32-PIC-NEXT: call x +; LINUX-32-PIC-NEXT: call x +; LINUX-32-PIC-NEXT: call x +; LINUX-32-PIC-NEXT: call x +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: lcallee: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call x at PLT +; LINUX-64-PIC-NEXT: call x at PLT +; LINUX-64-PIC-NEXT: call x at PLT +; LINUX-64-PIC-NEXT: call x at PLT +; LINUX-64-PIC-NEXT: call x at PLT +; LINUX-64-PIC-NEXT: call x at PLT +; LINUX-64-PIC-NEXT: call x at PLT +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _lcallee: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _x +; DARWIN-32-STATIC-NEXT: call _x +; DARWIN-32-STATIC-NEXT: call _x +; DARWIN-32-STATIC-NEXT: call _x +; DARWIN-32-STATIC-NEXT: call _x +; DARWIN-32-STATIC-NEXT: call _x +; DARWIN-32-STATIC-NEXT: call _x +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _lcallee: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call L_x$stub +; DARWIN-32-DYNAMIC-NEXT: call L_x$stub +; DARWIN-32-DYNAMIC-NEXT: call L_x$stub +; DARWIN-32-DYNAMIC-NEXT: call L_x$stub +; DARWIN-32-DYNAMIC-NEXT: call L_x$stub +; DARWIN-32-DYNAMIC-NEXT: call L_x$stub +; DARWIN-32-DYNAMIC-NEXT: call L_x$stub +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _lcallee: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call L_x$stub +; DARWIN-32-PIC-NEXT: call L_x$stub +; DARWIN-32-PIC-NEXT: call L_x$stub +; DARWIN-32-PIC-NEXT: call L_x$stub +; DARWIN-32-PIC-NEXT: call L_x$stub +; DARWIN-32-PIC-NEXT: call L_x$stub +; DARWIN-32-PIC-NEXT: call L_x$stub +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _lcallee: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _x +; DARWIN-64-STATIC-NEXT: call _x +; DARWIN-64-STATIC-NEXT: call _x +; DARWIN-64-STATIC-NEXT: call _x +; DARWIN-64-STATIC-NEXT: call _x +; DARWIN-64-STATIC-NEXT: call _x +; DARWIN-64-STATIC-NEXT: call _x +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _lcallee: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _x +; DARWIN-64-DYNAMIC-NEXT: call _x +; DARWIN-64-DYNAMIC-NEXT: call _x +; DARWIN-64-DYNAMIC-NEXT: call _x +; DARWIN-64-DYNAMIC-NEXT: call _x +; DARWIN-64-DYNAMIC-NEXT: call _x +; DARWIN-64-DYNAMIC-NEXT: call _x +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _lcallee: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _x +; DARWIN-64-PIC-NEXT: call _x +; DARWIN-64-PIC-NEXT: call _x +; DARWIN-64-PIC-NEXT: call _x +; DARWIN-64-PIC-NEXT: call _x +; DARWIN-64-PIC-NEXT: call _x +; DARWIN-64-PIC-NEXT: call _x +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } declare void @x() @@ -1676,6 +8504,114 @@ ; LINUX-64-STATIC: call y ; LINUX-64-STATIC: call y ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: dcallee: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call y +; LINUX-32-STATIC-NEXT: call y +; LINUX-32-STATIC-NEXT: call y +; LINUX-32-STATIC-NEXT: call y +; LINUX-32-STATIC-NEXT: call y +; LINUX-32-STATIC-NEXT: call y +; LINUX-32-STATIC-NEXT: call y +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: dcallee: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call y +; LINUX-32-PIC-NEXT: call y +; LINUX-32-PIC-NEXT: call y +; LINUX-32-PIC-NEXT: call y +; LINUX-32-PIC-NEXT: call y +; LINUX-32-PIC-NEXT: call y +; LINUX-32-PIC-NEXT: call y +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: dcallee: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call y at PLT +; LINUX-64-PIC-NEXT: call y at PLT +; LINUX-64-PIC-NEXT: call y at PLT +; LINUX-64-PIC-NEXT: call y at PLT +; LINUX-64-PIC-NEXT: call y at PLT +; LINUX-64-PIC-NEXT: call y at PLT +; LINUX-64-PIC-NEXT: call y at PLT +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _dcallee: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _y +; DARWIN-32-STATIC-NEXT: call _y +; DARWIN-32-STATIC-NEXT: call _y +; DARWIN-32-STATIC-NEXT: call _y +; DARWIN-32-STATIC-NEXT: call _y +; DARWIN-32-STATIC-NEXT: call _y +; DARWIN-32-STATIC-NEXT: call _y +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _dcallee: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call L_y$stub +; DARWIN-32-DYNAMIC-NEXT: call L_y$stub +; DARWIN-32-DYNAMIC-NEXT: call L_y$stub +; DARWIN-32-DYNAMIC-NEXT: call L_y$stub +; DARWIN-32-DYNAMIC-NEXT: call L_y$stub +; DARWIN-32-DYNAMIC-NEXT: call L_y$stub +; DARWIN-32-DYNAMIC-NEXT: call L_y$stub +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _dcallee: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call L_y$stub +; DARWIN-32-PIC-NEXT: call L_y$stub +; DARWIN-32-PIC-NEXT: call L_y$stub +; DARWIN-32-PIC-NEXT: call L_y$stub +; DARWIN-32-PIC-NEXT: call L_y$stub +; DARWIN-32-PIC-NEXT: call L_y$stub +; DARWIN-32-PIC-NEXT: call L_y$stub +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _dcallee: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _y +; DARWIN-64-STATIC-NEXT: call _y +; DARWIN-64-STATIC-NEXT: call _y +; DARWIN-64-STATIC-NEXT: call _y +; DARWIN-64-STATIC-NEXT: call _y +; DARWIN-64-STATIC-NEXT: call _y +; DARWIN-64-STATIC-NEXT: call _y +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _dcallee: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _y +; DARWIN-64-DYNAMIC-NEXT: call _y +; DARWIN-64-DYNAMIC-NEXT: call _y +; DARWIN-64-DYNAMIC-NEXT: call _y +; DARWIN-64-DYNAMIC-NEXT: call _y +; DARWIN-64-DYNAMIC-NEXT: call _y +; DARWIN-64-DYNAMIC-NEXT: call _y +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _dcallee: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _y +; DARWIN-64-PIC-NEXT: call _y +; DARWIN-64-PIC-NEXT: call _y +; DARWIN-64-PIC-NEXT: call _y +; DARWIN-64-PIC-NEXT: call _y +; DARWIN-64-PIC-NEXT: call _y +; DARWIN-64-PIC-NEXT: call _y +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } declare void @y() @@ -1686,6 +8622,45 @@ ; LINUX-64-STATIC: address: ; LINUX-64-STATIC: movl $callee, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: address: +; LINUX-32-STATIC: movl $callee, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: address: +; LINUX-32-PIC: movl $callee, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: address: +; LINUX-64-PIC: movq callee at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _address: +; DARWIN-32-STATIC: movl $_callee, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _address: +; DARWIN-32-DYNAMIC: movl L_callee$non_lazy_ptr, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _address: +; DARWIN-32-PIC: call "L134$pb" +; DARWIN-32-PIC-NEXT: "L134$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_callee$non_lazy_ptr-"L134$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _address: +; DARWIN-64-STATIC: movq _callee at GOTPCREL(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _address: +; DARWIN-64-DYNAMIC: movq _callee at GOTPCREL(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _address: +; DARWIN-64-PIC: movq _callee at GOTPCREL(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } declare void @callee() @@ -1696,6 +8671,45 @@ ; LINUX-64-STATIC: laddress: ; LINUX-64-STATIC: movl $lcallee, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: laddress: +; LINUX-32-STATIC: movl $lcallee, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: laddress: +; LINUX-32-PIC: movl $lcallee, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: laddress: +; LINUX-64-PIC: movq lcallee at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _laddress: +; DARWIN-32-STATIC: movl $_lcallee, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _laddress: +; DARWIN-32-DYNAMIC: movl $_lcallee, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _laddress: +; DARWIN-32-PIC: call "L135$pb" +; DARWIN-32-PIC-NEXT: "L135$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _lcallee-"L135$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _laddress: +; DARWIN-64-STATIC: leaq _lcallee(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _laddress: +; DARWIN-64-DYNAMIC: leaq _lcallee(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _laddress: +; DARWIN-64-PIC: leaq _lcallee(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define void ()* @daddress() nounwind { @@ -1704,6 +8718,45 @@ ; LINUX-64-STATIC: daddress: ; LINUX-64-STATIC: movl $dcallee, %eax ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: daddress: +; LINUX-32-STATIC: movl $dcallee, %eax +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: daddress: +; LINUX-32-PIC: movl $dcallee, %eax +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: daddress: +; LINUX-64-PIC: leaq dcallee(%rip), %rax +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _daddress: +; DARWIN-32-STATIC: movl $_dcallee, %eax +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _daddress: +; DARWIN-32-DYNAMIC: movl $_dcallee, %eax +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _daddress: +; DARWIN-32-PIC: call "L136$pb" +; DARWIN-32-PIC-NEXT: "L136$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: leal _dcallee-"L136$pb"(%eax), %eax +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _daddress: +; DARWIN-64-STATIC: leaq _dcallee(%rip), %rax +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _daddress: +; DARWIN-64-DYNAMIC: leaq _dcallee(%rip), %rax +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _daddress: +; DARWIN-64-PIC: leaq _dcallee(%rip), %rax +; DARWIN-64-PIC-NEXT: ret } define void @caller() nounwind { @@ -1715,6 +8768,69 @@ ; LINUX-64-STATIC: call callee ; LINUX-64-STATIC: call callee ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: caller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call callee +; LINUX-32-STATIC-NEXT: call callee +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: caller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call callee +; LINUX-32-PIC-NEXT: call callee +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: caller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call callee at PLT +; LINUX-64-PIC-NEXT: call callee at PLT +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _caller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _callee +; DARWIN-32-STATIC-NEXT: call _callee +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _caller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call L_callee$stub +; DARWIN-32-DYNAMIC-NEXT: call L_callee$stub +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _caller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call L_callee$stub +; DARWIN-32-PIC-NEXT: call L_callee$stub +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _caller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _callee +; DARWIN-64-STATIC-NEXT: call _callee +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _caller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _callee +; DARWIN-64-DYNAMIC-NEXT: call _callee +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _caller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _callee +; DARWIN-64-PIC-NEXT: call _callee +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @dcaller() nounwind { @@ -1726,6 +8842,69 @@ ; LINUX-64-STATIC: call dcallee ; LINUX-64-STATIC: call dcallee ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: dcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call dcallee +; LINUX-32-STATIC-NEXT: call dcallee +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: dcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call dcallee +; LINUX-32-PIC-NEXT: call dcallee +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: dcaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call dcallee +; LINUX-64-PIC-NEXT: call dcallee +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _dcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _dcallee +; DARWIN-32-STATIC-NEXT: call _dcallee +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _dcaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call _dcallee +; DARWIN-32-DYNAMIC-NEXT: call _dcallee +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _dcaller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call _dcallee +; DARWIN-32-PIC-NEXT: call _dcallee +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _dcaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _dcallee +; DARWIN-64-STATIC-NEXT: call _dcallee +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _dcaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _dcallee +; DARWIN-64-DYNAMIC-NEXT: call _dcallee +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _dcaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _dcallee +; DARWIN-64-PIC-NEXT: call _dcallee +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @lcaller() nounwind { @@ -1737,6 +8916,69 @@ ; LINUX-64-STATIC: call lcallee ; LINUX-64-STATIC: call lcallee ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: lcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call lcallee +; LINUX-32-STATIC-NEXT: call lcallee +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: lcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call lcallee +; LINUX-32-PIC-NEXT: call lcallee +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: lcaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call lcallee at PLT +; LINUX-64-PIC-NEXT: call lcallee at PLT +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _lcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _lcallee +; DARWIN-32-STATIC-NEXT: call _lcallee +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _lcaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call _lcallee +; DARWIN-32-DYNAMIC-NEXT: call _lcallee +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _lcaller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call _lcallee +; DARWIN-32-PIC-NEXT: call _lcallee +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _lcaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _lcallee +; DARWIN-64-STATIC-NEXT: call _lcallee +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _lcaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _lcallee +; DARWIN-64-DYNAMIC-NEXT: call _lcallee +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _lcaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _lcallee +; DARWIN-64-PIC-NEXT: call _lcallee +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @tailcaller() nounwind { @@ -1746,6 +8988,60 @@ ; LINUX-64-STATIC: tailcaller: ; LINUX-64-STATIC: call callee ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: tailcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call callee +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: tailcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call callee +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: tailcaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call callee at PLT +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _tailcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _callee +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _tailcaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call L_callee$stub +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _tailcaller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call L_callee$stub +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _tailcaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _callee +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _tailcaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _callee +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _tailcaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _callee +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @dtailcaller() nounwind { @@ -1755,6 +9051,60 @@ ; LINUX-64-STATIC: dtailcaller: ; LINUX-64-STATIC: call dcallee ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: dtailcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call dcallee +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: dtailcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call dcallee +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: dtailcaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call dcallee +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _dtailcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _dcallee +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _dtailcaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call _dcallee +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _dtailcaller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call _dcallee +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _dtailcaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _dcallee +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _dtailcaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _dcallee +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _dtailcaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _dcallee +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @ltailcaller() nounwind { @@ -1764,6 +9114,60 @@ ; LINUX-64-STATIC: ltailcaller: ; LINUX-64-STATIC: call lcallee ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ltailcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call lcallee +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ltailcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call lcallee +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ltailcaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call lcallee at PLT +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ltailcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call _lcallee +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ltailcaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call _lcallee +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ltailcaller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call _lcallee +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ltailcaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call _lcallee +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ltailcaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call _lcallee +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ltailcaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call _lcallee +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @icaller() nounwind { @@ -1777,6 +9181,82 @@ ; LINUX-64-STATIC: call *ifunc ; LINUX-64-STATIC: call *ifunc ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: icaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call *ifunc +; LINUX-32-STATIC-NEXT: call *ifunc +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: icaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call *ifunc +; LINUX-32-PIC-NEXT: call *ifunc +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: icaller: +; LINUX-64-PIC: pushq %rbx +; LINUX-64-PIC-NEXT: movq ifunc at GOTPCREL(%rip), %rbx +; LINUX-64-PIC-NEXT: call *(%rbx) +; LINUX-64-PIC-NEXT: call *(%rbx) +; LINUX-64-PIC-NEXT: popq %rbx +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _icaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call *_ifunc +; DARWIN-32-STATIC-NEXT: call *_ifunc +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _icaller: +; DARWIN-32-DYNAMIC: pushl %esi +; DARWIN-32-DYNAMIC-NEXT: subl $8, %esp +; DARWIN-32-DYNAMIC-NEXT: movl L_ifunc$non_lazy_ptr, %esi +; DARWIN-32-DYNAMIC-NEXT: call *(%esi) +; DARWIN-32-DYNAMIC-NEXT: call *(%esi) +; DARWIN-32-DYNAMIC-NEXT: addl $8, %esp +; DARWIN-32-DYNAMIC-NEXT: popl %esi +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _icaller: +; DARWIN-32-PIC: pushl %esi +; DARWIN-32-PIC-NEXT: subl $8, %esp +; DARWIN-32-PIC-NEXT: call "L143$pb" +; DARWIN-32-PIC-NEXT: "L143$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ifunc$non_lazy_ptr-"L143$pb"(%eax), %esi +; DARWIN-32-PIC-NEXT: call *(%esi) +; DARWIN-32-PIC-NEXT: call *(%esi) +; DARWIN-32-PIC-NEXT: addl $8, %esp +; DARWIN-32-PIC-NEXT: popl %esi +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _icaller: +; DARWIN-64-STATIC: pushq %rbx +; DARWIN-64-STATIC-NEXT: movq _ifunc at GOTPCREL(%rip), %rbx +; DARWIN-64-STATIC-NEXT: call *(%rbx) +; DARWIN-64-STATIC-NEXT: call *(%rbx) +; DARWIN-64-STATIC-NEXT: popq %rbx +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _icaller: +; DARWIN-64-DYNAMIC: pushq %rbx +; DARWIN-64-DYNAMIC-NEXT: movq _ifunc at GOTPCREL(%rip), %rbx +; DARWIN-64-DYNAMIC-NEXT: call *(%rbx) +; DARWIN-64-DYNAMIC-NEXT: call *(%rbx) +; DARWIN-64-DYNAMIC-NEXT: popq %rbx +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _icaller: +; DARWIN-64-PIC: pushq %rbx +; DARWIN-64-PIC-NEXT: movq _ifunc at GOTPCREL(%rip), %rbx +; DARWIN-64-PIC-NEXT: call *(%rbx) +; DARWIN-64-PIC-NEXT: call *(%rbx) +; DARWIN-64-PIC-NEXT: popq %rbx +; DARWIN-64-PIC-NEXT: ret } define void @dicaller() nounwind { @@ -1790,6 +9270,75 @@ ; LINUX-64-STATIC: call *difunc ; LINUX-64-STATIC: call *difunc ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: dicaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call *difunc +; LINUX-32-STATIC-NEXT: call *difunc +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: dicaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call *difunc +; LINUX-32-PIC-NEXT: call *difunc +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: dicaller: +; LINUX-64-PIC: pushq %rbx +; LINUX-64-PIC-NEXT: movq difunc at GOTPCREL(%rip), %rbx +; LINUX-64-PIC-NEXT: call *(%rbx) +; LINUX-64-PIC-NEXT: call *(%rbx) +; LINUX-64-PIC-NEXT: popq %rbx +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _dicaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call *_difunc +; DARWIN-32-STATIC-NEXT: call *_difunc +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _dicaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call *_difunc +; DARWIN-32-DYNAMIC-NEXT: call *_difunc +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _dicaller: +; DARWIN-32-PIC: pushl %esi +; DARWIN-32-PIC-NEXT: subl $8, %esp +; DARWIN-32-PIC-NEXT: call "L144$pb" +; DARWIN-32-PIC-NEXT: "L144$pb": +; DARWIN-32-PIC-NEXT: popl %esi +; DARWIN-32-PIC-NEXT: call *_difunc-"L144$pb"(%esi) +; DARWIN-32-PIC-NEXT: call *_difunc-"L144$pb"(%esi) +; DARWIN-32-PIC-NEXT: addl $8, %esp +; DARWIN-32-PIC-NEXT: popl %esi +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _dicaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call *_difunc(%rip) +; DARWIN-64-STATIC-NEXT: call *_difunc(%rip) +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _dicaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call *_difunc(%rip) +; DARWIN-64-DYNAMIC-NEXT: call *_difunc(%rip) +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _dicaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call *_difunc(%rip) +; DARWIN-64-PIC-NEXT: call *_difunc(%rip) +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @licaller() nounwind { @@ -1803,6 +9352,74 @@ ; LINUX-64-STATIC: call *lifunc ; LINUX-64-STATIC: call *lifunc ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: licaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call *lifunc +; LINUX-32-STATIC-NEXT: call *lifunc +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: licaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call *lifunc +; LINUX-32-PIC-NEXT: call *lifunc +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: licaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call *lifunc(%rip) +; LINUX-64-PIC-NEXT: call *lifunc(%rip) +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _licaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call *_lifunc +; DARWIN-32-STATIC-NEXT: call *_lifunc +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _licaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call *_lifunc +; DARWIN-32-DYNAMIC-NEXT: call *_lifunc +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _licaller: +; DARWIN-32-PIC: pushl %esi +; DARWIN-32-PIC-NEXT: subl $8, %esp +; DARWIN-32-PIC-NEXT: call "L145$pb" +; DARWIN-32-PIC-NEXT: "L145$pb": +; DARWIN-32-PIC-NEXT: popl %esi +; DARWIN-32-PIC-NEXT: call *_lifunc-"L145$pb"(%esi) +; DARWIN-32-PIC-NEXT: call *_lifunc-"L145$pb"(%esi) +; DARWIN-32-PIC-NEXT: addl $8, %esp +; DARWIN-32-PIC-NEXT: popl %esi +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _licaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-STATIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _licaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-DYNAMIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _licaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-PIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @itailcaller() nounwind { @@ -1816,6 +9433,82 @@ ; LINUX-64-STATIC: call *ifunc ; LINUX-64-STATIC: call *ifunc ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: itailcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call *ifunc +; LINUX-32-STATIC-NEXT: call *ifunc +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: itailcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call *ifunc +; LINUX-32-PIC-NEXT: call *ifunc +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: itailcaller: +; LINUX-64-PIC: pushq %rbx +; LINUX-64-PIC-NEXT: movq ifunc at GOTPCREL(%rip), %rbx +; LINUX-64-PIC-NEXT: call *(%rbx) +; LINUX-64-PIC-NEXT: call *(%rbx) +; LINUX-64-PIC-NEXT: popq %rbx +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _itailcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call *_ifunc +; DARWIN-32-STATIC-NEXT: call *_ifunc +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _itailcaller: +; DARWIN-32-DYNAMIC: pushl %esi +; DARWIN-32-DYNAMIC-NEXT: subl $8, %esp +; DARWIN-32-DYNAMIC-NEXT: movl L_ifunc$non_lazy_ptr, %esi +; DARWIN-32-DYNAMIC-NEXT: call *(%esi) +; DARWIN-32-DYNAMIC-NEXT: call *(%esi) +; DARWIN-32-DYNAMIC-NEXT: addl $8, %esp +; DARWIN-32-DYNAMIC-NEXT: popl %esi +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _itailcaller: +; DARWIN-32-PIC: pushl %esi +; DARWIN-32-PIC-NEXT: subl $8, %esp +; DARWIN-32-PIC-NEXT: call "L146$pb" +; DARWIN-32-PIC-NEXT: "L146$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: movl L_ifunc$non_lazy_ptr-"L146$pb"(%eax), %esi +; DARWIN-32-PIC-NEXT: call *(%esi) +; DARWIN-32-PIC-NEXT: call *(%esi) +; DARWIN-32-PIC-NEXT: addl $8, %esp +; DARWIN-32-PIC-NEXT: popl %esi +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _itailcaller: +; DARWIN-64-STATIC: pushq %rbx +; DARWIN-64-STATIC-NEXT: movq _ifunc at GOTPCREL(%rip), %rbx +; DARWIN-64-STATIC-NEXT: call *(%rbx) +; DARWIN-64-STATIC-NEXT: call *(%rbx) +; DARWIN-64-STATIC-NEXT: popq %rbx +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _itailcaller: +; DARWIN-64-DYNAMIC: pushq %rbx +; DARWIN-64-DYNAMIC-NEXT: movq _ifunc at GOTPCREL(%rip), %rbx +; DARWIN-64-DYNAMIC-NEXT: call *(%rbx) +; DARWIN-64-DYNAMIC-NEXT: call *(%rbx) +; DARWIN-64-DYNAMIC-NEXT: popq %rbx +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _itailcaller: +; DARWIN-64-PIC: pushq %rbx +; DARWIN-64-PIC-NEXT: movq _ifunc at GOTPCREL(%rip), %rbx +; DARWIN-64-PIC-NEXT: call *(%rbx) +; DARWIN-64-PIC-NEXT: call *(%rbx) +; DARWIN-64-PIC-NEXT: popq %rbx +; DARWIN-64-PIC-NEXT: ret } define void @ditailcaller() nounwind { @@ -1826,6 +9519,63 @@ ; LINUX-64-STATIC: ditailcaller: ; LINUX-64-STATIC: call *difunc ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: ditailcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call *difunc +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: ditailcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call *difunc +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: ditailcaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: movq difunc at GOTPCREL(%rip), %rax +; LINUX-64-PIC-NEXT: call *(%rax) +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _ditailcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call *_difunc +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _ditailcaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call *_difunc +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _ditailcaller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call "L147$pb" +; DARWIN-32-PIC-NEXT: "L147$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: call *_difunc-"L147$pb"(%eax) +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _ditailcaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call *_difunc(%rip) +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _ditailcaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call *_difunc(%rip) +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _ditailcaller: +; DARWIN-64-PIC: call *_difunc(%rip) +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } define void @litailcaller() nounwind { @@ -1836,4 +9586,61 @@ ; LINUX-64-STATIC: litailcaller: ; LINUX-64-STATIC: call *lifunc ; LINUX-64-STATIC: ret + +; LINUX-32-STATIC: litailcaller: +; LINUX-32-STATIC: subl $4, %esp +; LINUX-32-STATIC-NEXT: call *lifunc +; LINUX-32-STATIC-NEXT: addl $4, %esp +; LINUX-32-STATIC-NEXT: ret + +; LINUX-32-PIC: litailcaller: +; LINUX-32-PIC: subl $4, %esp +; LINUX-32-PIC-NEXT: call *lifunc +; LINUX-32-PIC-NEXT: addl $4, %esp +; LINUX-32-PIC-NEXT: ret + +; LINUX-64-PIC: litailcaller: +; LINUX-64-PIC: subq $8, %rsp +; LINUX-64-PIC-NEXT: call *lifunc(%rip) +; LINUX-64-PIC-NEXT: addq $8, %rsp +; LINUX-64-PIC-NEXT: ret + +; DARWIN-32-STATIC: _litailcaller: +; DARWIN-32-STATIC: subl $12, %esp +; DARWIN-32-STATIC-NEXT: call *_lifunc +; DARWIN-32-STATIC-NEXT: addl $12, %esp +; DARWIN-32-STATIC-NEXT: ret + +; DARWIN-32-DYNAMIC: _litailcaller: +; DARWIN-32-DYNAMIC: subl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: call *_lifunc +; DARWIN-32-DYNAMIC-NEXT: addl $12, %esp +; DARWIN-32-DYNAMIC-NEXT: ret + +; DARWIN-32-PIC: _litailcaller: +; DARWIN-32-PIC: subl $12, %esp +; DARWIN-32-PIC-NEXT: call "L148$pb" +; DARWIN-32-PIC-NEXT: "L148$pb": +; DARWIN-32-PIC-NEXT: popl %eax +; DARWIN-32-PIC-NEXT: call *_lifunc-"L148$pb"(%eax) +; DARWIN-32-PIC-NEXT: addl $12, %esp +; DARWIN-32-PIC-NEXT: ret + +; DARWIN-64-STATIC: _litailcaller: +; DARWIN-64-STATIC: subq $8, %rsp +; DARWIN-64-STATIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-STATIC-NEXT: addq $8, %rsp +; DARWIN-64-STATIC-NEXT: ret + +; DARWIN-64-DYNAMIC: _litailcaller: +; DARWIN-64-DYNAMIC: subq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-DYNAMIC-NEXT: addq $8, %rsp +; DARWIN-64-DYNAMIC-NEXT: ret + +; DARWIN-64-PIC: _litailcaller: +; DARWIN-64-PIC: subq $8, %rsp +; DARWIN-64-PIC-NEXT: call *_lifunc(%rip) +; DARWIN-64-PIC-NEXT: addq $8, %rsp +; DARWIN-64-PIC-NEXT: ret } From daniel at zuster.org Tue Aug 25 13:53:54 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 25 Aug 2009 11:53:54 -0700 Subject: [llvm-commits] [llvm] r79958 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp test/CodeGen/CellSPU/loads.ll In-Reply-To: <200908242357.n7ONvZ4d032311@zion.cs.uiuc.edu> References: <200908242357.n7ONvZ4d032311@zion.cs.uiuc.edu> Message-ID: <6a8523d60908251153o102ffa70n1c65067899975b5a@mail.gmail.com> Hi all, On Mon, Aug 24, 2009 at 4:57 PM, Scott Michel wrote: > - Start moving CellSPU's tests to prefer FileCheck. While I don't want to discourage anyone from converting old tests to use FileCheck (especially complicated old tests), I wanted to mention that it is *very* likely that I will automatically convert an entire boatload of tests to FileCheck sometime in, say, the next month. This automatic conversion probably won't be super smart, so complicated tests are worth converting anyway, but if a test is little more than llvm-as | llc followed by a sequence of greps, then I would recommend not spending unnecessary time converting things (unless you want to). New tests should still be written with FileCheck where possible, of course. - Daniel From sanjiv.gupta at microchip.com Tue Aug 25 14:39:05 2009 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Tue, 25 Aug 2009 19:39:05 -0000 Subject: [llvm-commits] [llvm] r80021 - in /llvm/trunk/lib/Target/PIC16: MCSectionPIC16.h PIC16TargetObjectFile.cpp PIC16TargetObjectFile.h Message-ID: <200908251939.n7PJd55K000844@zion.cs.uiuc.edu> Author: sgupta Date: Tue Aug 25 14:39:05 2009 New Revision: 80021 URL: http://llvm.org/viewvc/llvm-project?rev=80021&view=rev Log: Start refactoring PIC16 TargetObjectFile code. Eventually, all the stuff from PIC16Section will move to MCSectionPIC16. Modified: llvm/trunk/lib/Target/PIC16/MCSectionPIC16.h llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.h Modified: llvm/trunk/lib/Target/PIC16/MCSectionPIC16.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/MCSectionPIC16.h?rev=80021&r1=80020&r2=80021&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/MCSectionPIC16.h (original) +++ llvm/trunk/lib/Target/PIC16/MCSectionPIC16.h Tue Aug 25 14:39:05 2009 @@ -18,20 +18,65 @@ namespace llvm { + /// MCSectionPIC16 - Represents a physical section in PIC16 COFF. + /// Contains data objects. + /// class MCSectionPIC16 : public MCSection { + /// Name of the section to uniquely identify it. std::string Name; + + /// User can specify an address at which a section should be placed. + /// Negative value here means user hasn't specified any. + int Address; + + /// FIXME: Keep overlay information here. uncomment the decl below. + /// Overlay information - Sections with same color can be overlaid on + /// one another. + /// std::string Color; + + /// Conatined data objects. + std::vectorItems; + + /// Total size of all data objects contained here. + unsigned Size; - MCSectionPIC16(const StringRef &name, SectionKind K) - : MCSection(K), Name(name) { + MCSectionPIC16(const StringRef &name, SectionKind K, int addr) + : MCSection(K), Name(name), Address(addr) { } public: - + /// Return the name of the section. const std::string &getName() const { return Name; } + + /// Return the Address of the section. + int getAddress() const { return Address; } + + /// PIC16 Terminology for section kinds is as below. + /// UDATA - BSS + /// IDATA - initialized data (equiv to Metadata) + /// ROMDATA - ReadOnly. + /// UDATA_OVR - Sections that can be overlaid. Section of such type is + /// used to contain function autos an frame. We can think of + /// it as equiv to llvm ThreadBSS) + /// So, let's have some convenience functions to Map PIC16 Section types + /// to SectionKind just for the sake of better readability. + static SectionKind UDATA_Kind() { return SectionKind::getBSS(); } + static SectionKind IDATA_Kind() { return SectionKind::getMetadata(); } + static SectionKind ROMDATA_Kind() { return SectionKind::getReadOnly(); } + static SectionKind UDATA_OVR_Kind() { return SectionKind::getThreadBSS(); } + + // If we could just do getKind() == UDATA_Kind() ? + bool isUDATA_Kind() { return getKind().isBSS(); } + bool isIDATA_Kind() { return getKind().isMetadata(); } + bool isROMDATA_Kind() { return getKind().isMetadata(); } + bool isUDATA_OVR_Kind() { return getKind().isThreadBSS(); } + + /// This would be the only way to create a section. + static MCSectionPIC16 *Create(const StringRef &Name, SectionKind K, + int Address, MCContext &Ctx); - static MCSectionPIC16 *Create(const StringRef &Name, - SectionKind K, MCContext &Ctx); - + /// Override this as PIC16 has its own way of printing switching + /// to a section. virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS) const; }; Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp?rev=80021&r1=80020&r2=80021&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp Tue Aug 25 14:39:05 2009 @@ -19,9 +19,9 @@ using namespace llvm; -MCSectionPIC16 *MCSectionPIC16::Create(const StringRef &Name, - SectionKind K, MCContext &Ctx) { - return new (Ctx) MCSectionPIC16(Name, K); +MCSectionPIC16 *MCSectionPIC16::Create(const StringRef &Name, SectionKind K, + int Address, MCContext &Ctx) { + return new (Ctx) MCSectionPIC16(Name, K, Address); } @@ -38,12 +38,12 @@ } const MCSectionPIC16 *PIC16TargetObjectFile:: -getPIC16Section(const char *Name, SectionKind Kind) const { +getPIC16Section(const char *Name, SectionKind Kind, int Address) const { MCSectionPIC16 *&Entry = SectionsByName[Name]; if (Entry) return Entry; - return Entry = MCSectionPIC16::Create(Name, Kind, getContext()); + return Entry = MCSectionPIC16::Create(Name, Kind, Address, getContext()); } Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.h?rev=80021&r1=80020&r2=80021&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.h Tue Aug 25 14:39:05 2009 @@ -53,7 +53,8 @@ const TargetMachine *TM; const MCSectionPIC16 *getPIC16Section(const char *Name, - SectionKind K) const; + SectionKind K, + int Address = -1) const; public: mutable std::vector BSSSections; mutable std::vector IDATASections; From daniel at zuster.org Tue Aug 25 15:21:09 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 25 Aug 2009 20:21:09 -0000 Subject: [llvm-commits] [llvm] r80023 - in /llvm/trunk/tools: CMakeLists.txt Makefile gccas/ gccld/ Message-ID: <200908252021.n7PKL9iT006292@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 15:21:09 2009 New Revision: 80023 URL: http://llvm.org/viewvc/llvm-project?rev=80023&view=rev Log: EXIT STAGE LEFT: gccas, gccld Removed: llvm/trunk/tools/gccas/ llvm/trunk/tools/gccld/ Modified: llvm/trunk/tools/CMakeLists.txt llvm/trunk/tools/Makefile Modified: llvm/trunk/tools/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/CMakeLists.txt?rev=80023&r1=80022&r2=80023&view=diff ============================================================================== --- llvm/trunk/tools/CMakeLists.txt (original) +++ llvm/trunk/tools/CMakeLists.txt Tue Aug 25 15:21:09 2009 @@ -26,9 +26,6 @@ add_subdirectory(llvm-link) add_subdirectory(lli) -# gccas and gccld are deprecated: -# add_subdirectory(gccas) -# add_subdirectory(gccld) add_subdirectory(llvm-extract) add_subdirectory(llvm-db) Modified: llvm/trunk/tools/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/Makefile?rev=80023&r1=80022&r2=80023&view=diff ============================================================================== --- llvm/trunk/tools/Makefile (original) +++ llvm/trunk/tools/Makefile Tue Aug 25 15:21:09 2009 @@ -19,7 +19,7 @@ PARALLEL_DIRS := opt llvm-as llvm-dis \ llc llvm-ranlib llvm-ar llvm-nm \ llvm-ld llvm-prof llvm-link \ - lli gccas gccld llvm-extract llvm-db \ + lli llvm-extract llvm-db \ bugpoint llvm-bcanalyzer llvm-stub \ llvm-mc llvmc From isanbard at gmail.com Tue Aug 25 15:21:18 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 20:21:18 -0000 Subject: [llvm-commits] [llvm] r80024 - in /llvm/trunk: include/llvm/MC/MCAsmInfo.h lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp Message-ID: <200908252021.n7PKLIv9006323@zion.cs.uiuc.edu> Author: void Date: Tue Aug 25 15:21:17 2009 New Revision: 80024 URL: http://llvm.org/viewvc/llvm-project?rev=80024&view=rev Log: Add a target asm info hook to specify that particular bits of data in the FDE should be forced to 32-bits (.long) even on 64-bit architectures. Darwin wants these bits to be 64-bits (.quad). However, other platforms may disagree. This is just the info right now and is part of a work-in-progress which needs this. We'll add the actual *use* of this soon. Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h llvm/trunk/lib/MC/MCAsmInfo.cpp llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=80024&r1=80023&r2=80024&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original) +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Tue Aug 25 15:21:17 2009 @@ -254,52 +254,49 @@ //===--- Dwarf Emission Directives -----------------------------------===// /// AbsoluteDebugSectionOffsets - True if we should emit abolute section - /// offsets for debug information. Defaults to false. - bool AbsoluteDebugSectionOffsets; + /// offsets for debug information. + bool AbsoluteDebugSectionOffsets; // Defaults to false. /// AbsoluteEHSectionOffsets - True if we should emit abolute section /// offsets for EH information. Defaults to false. bool AbsoluteEHSectionOffsets; /// HasLEB128 - True if target asm supports leb128 directives. - /// - bool HasLEB128; // Defaults to false. + bool HasLEB128; // Defaults to false. /// hasDotLocAndDotFile - True if target asm supports .loc and .file /// directives for emitting debugging information. - /// - bool HasDotLocAndDotFile; // Defaults to false. + bool HasDotLocAndDotFile; // Defaults to false. /// SupportsDebugInformation - True if target supports emission of debugging /// information. - bool SupportsDebugInformation; + bool SupportsDebugInformation; // Defaults to false. - /// SupportsExceptionHandling - True if target supports - /// exception handling. - /// - // Defaults to None - ExceptionHandling::ExceptionsType ExceptionsType; + /// SupportsExceptionHandling - True if target supports exception handling. + ExceptionHandling::ExceptionsType ExceptionsType; // Defaults to None /// RequiresFrameSection - true if the Dwarf2 output needs a frame section - /// - bool DwarfRequiresFrameSection; // Defaults to true. + bool DwarfRequiresFrameSection; // Defaults to true. /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to /// encode inline subroutine information. - bool DwarfUsesInlineInfoSection; // Defaults to false. + bool DwarfUsesInlineInfoSection; // Defaults to false. /// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private so that it /// doesn't show up in the symbol table of the object file. - bool Is_EHSymbolPrivate; // Defaults to true. + bool Is_EHSymbolPrivate; // Defaults to true. + + /// ForceEncodingOfFDETo32Bits - If set, the encoding of some of the FDE + /// data is forced to 32-bit. + bool ForceEncodingOfFDETo32Bits; // Defaults to true. /// GlobalEHDirective - This is the directive used to make exception frame /// tables globally visible. - /// - const char *GlobalEHDirective; // Defaults to NULL. + const char *GlobalEHDirective; // Defaults to NULL. /// SupportsWeakEmptyEHFrame - True if target assembler and linker will /// handle a weak_definition of constant 0 for an omitted EH frame. - bool SupportsWeakOmittedEHFrame; // Defaults to true. + bool SupportsWeakOmittedEHFrame; // Defaults to true. /// DwarfSectionOffsetDirective - Special section offset directive. const char* DwarfSectionOffsetDirective; // Defaults to NULL @@ -508,6 +505,9 @@ bool is_EHSymbolPrivate() const { return Is_EHSymbolPrivate; } + bool forceEncodingOfFDETo32Bits() const { + return ForceEncodingOfFDETo32Bits; + } const char *getGlobalEHDirective() const { return GlobalEHDirective; } Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=80024&r1=80023&r2=80024&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Tue Aug 25 15:21:17 2009 @@ -78,6 +78,7 @@ DwarfRequiresFrameSection = true; DwarfUsesInlineInfoSection = false; Is_EHSymbolPrivate = true; + ForceEncodingOfFDETo32Bits = true; GlobalEHDirective = 0; SupportsWeakOmittedEHFrame = true; DwarfSectionOffsetDirective = 0; Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=80024&r1=80023&r2=80024&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Tue Aug 25 15:21:17 2009 @@ -52,6 +52,7 @@ // doesn't hurt anything. // FIXME: I need to get this from Triple. Is_EHSymbolPrivate = false; + ForceEncodingOfFDETo32Bits = false; GlobalEHDirective = "\t.globl\t"; SupportsWeakOmittedEHFrame = false; From sabre at nondot.org Tue Aug 25 15:49:04 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 25 Aug 2009 20:49:04 -0000 Subject: [llvm-commits] [llvm] r80025 - /llvm/trunk/test/CodeGen/X86/commute-cmov.ll Message-ID: <200908252049.n7PKn4bc009917@zion.cs.uiuc.edu> Author: lattner Date: Tue Aug 25 15:49:04 2009 New Revision: 80025 URL: http://llvm.org/viewvc/llvm-project?rev=80025&view=rev Log: convert to filecheck Modified: llvm/trunk/test/CodeGen/X86/commute-cmov.ll Modified: llvm/trunk/test/CodeGen/X86/commute-cmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/commute-cmov.ll?rev=80025&r1=80024&r2=80025&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/commute-cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/commute-cmov.ll Tue Aug 25 15:49:04 2009 @@ -1,22 +1,27 @@ -; RUN: llvm-as < %s | llc -march=x86 > %t -; RUN: grep btl %t | count 2 -; RUN: grep cmov %t | count 2 -; RUN: not grep test %t -; RUN: not grep set %t -; RUN: not grep j %t -; RUN: not grep cmovne %t -; RUN: not grep cmove %t +; RUN: llvm-as < %s | llc -march=x86 | FileCheck %s -define i32 @foo(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { +define i32 @test1(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { entry: +; CHECK: test1: +; CHECK: btl +; CHECK-NEXT: movl $12, %eax +; CHECK-NEXT: cmovae 16(%esp), %eax +; CHECK-NEXT: ret + %0 = lshr i32 %x, %n ; [#uses=1] %1 = and i32 %0, 1 ; [#uses=1] %toBool = icmp eq i32 %1, 0 ; [#uses=1] %.0 = select i1 %toBool, i32 %v, i32 12 ; [#uses=1] ret i32 %.0 } -define i32 @bar(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { +define i32 @test2(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { entry: +; CHECK: test2: +; CHECK: btl +; CHECK-NEXT: movl $12, %eax +; CHECK-NEXT: cmovb 16(%esp), %eax +; CHECK-NEXT: ret + %0 = lshr i32 %x, %n ; [#uses=1] %1 = and i32 %0, 1 ; [#uses=1] %toBool = icmp eq i32 %1, 0 ; [#uses=1] From kremenek at apple.com Tue Aug 25 15:51:58 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 25 Aug 2009 20:51:58 -0000 Subject: [llvm-commits] [llvm] r80027 - /llvm/tags/checker/checker-0.216/ Message-ID: <200908252051.n7PKpwjR010298@zion.cs.uiuc.edu> Author: kremenek Date: Tue Aug 25 15:51:58 2009 New Revision: 80027 URL: http://llvm.org/viewvc/llvm-project?rev=80027&view=rev Log: Tagging checker-0.216. Added: llvm/tags/checker/checker-0.216/ - copied from r80026, llvm/trunk/ From sabre at nondot.org Tue Aug 25 15:57:39 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 25 Aug 2009 20:57:39 -0000 Subject: [llvm-commits] [llvm] r80029 - /llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Message-ID: <200908252057.n7PKvd2L011014@zion.cs.uiuc.edu> Author: lattner Date: Tue Aug 25 15:57:38 2009 New Revision: 80029 URL: http://llvm.org/viewvc/llvm-project?rev=80029&view=rev Log: convert to filecheck style Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll?rev=80029&r1=80028&r2=80029&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Tue Aug 25 15:57:38 2009 @@ -1,24 +1,10 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 > %t -; RUN: not grep {stw r31, 20(r1)} %t -; RUN: grep {lis r0, -1} %t -; RUN: grep {ori r0, r0, 32704} %t -; RUN: grep {stwux r1, r1, r0} %t -; RUN: grep {lwz r1, 0(r1)} %t -; RUN: not grep {lwz r31, 20(r1)} %t -; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim > %t -; RUN: grep {stw r31, 20(r1)} %t -; RUN: grep {lis r0, -1} %t -; RUN: grep {ori r0, r0, 32704} %t -; RUN: grep {stwux r1, r1, r0} %t -; RUN: grep {lwz r1, 0(r1)} %t -; RUN: grep {lwz r31, 20(r1)} %t -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 > %t -; RUN: not grep {std r31, 40(r1)} %t -; RUN: grep {lis r0, -1} %t -; RUN: grep {ori r0, r0, 32656} %t -; RUN: grep {stdux r1, r1, r0} %t -; RUN: grep {ld r1, 0(r1)} %t -; RUN: not grep {ld r31, 40(r1)} %t +; RUN: llvm-as < %s > %t.bc +; RUN: llc < %t.bc -march=ppc32 | FileCheck %s -check-prefix=PPC32-NOFP +; RUN: llc < %t.bc -march=ppc32 -disable-fp-elim | FileCheck %s -check-prefix=PPC32-FP + +; RUN: llc < %t.bc -march=ppc64 | FileCheck %s -check-prefix=PPC64-NOFP +; RUN: llc < %t.bc -march=ppc64 -disable-fp-elim | FileCheck %s -check-prefix=PPC64-FP + ; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim > %t ; RUN: grep {std r31, 40(r1)} %t ; RUN: grep {lis r0, -1} %t @@ -27,8 +13,47 @@ ; RUN: grep {ld r1, 0(r1)} %t ; RUN: grep {ld r31, 40(r1)} %t -define i32* @f1() { +target triple = "powerpc-apple-darwin8" + +define i32* @f1() nounwind { %tmp = alloca i32, i32 8191 ; [#uses=1] ret i32* %tmp } +; PPC32-NOFP: _f1: +; PPC32-NOFP: lis r0, -1 +; PPC32-NOFP: ori r0, r0, 32704 +; PPC32-NOFP: stwux r1, r1, r0 +; PPC32-NOFP: addi r3, r1, 68 +; PPC32-NOFP: lwz r1, 0(r1) +; PPC32-NOFP: blr + +; PPC32-FP: _f1: +; PPC32-FP: stw r31, 20(r1) +; PPC32-FP: lis r0, -1 +; PPC32-FP: ori r0, r0, 32704 +; PPC32-FP: stwux r1, r1, r0 +; ... +; PPC32-FP: lwz r1, 0(r1) +; PPC32-FP: lwz r31, 20(r1) +; PPC32-FP: blr + + +; PPC64-NOFP: _f1: +; PPC64-NOFP: lis r0, -1 +; PPC64-NOFP: ori r0, r0, 32656 +; PPC64-NOFP: stdux r1, r1, r0 +; PPC64-NOFP: addi r3, r1, 116 +; PPC64-NOFP: ld r1, 0(r1) +; PPC64-NOFP: blr + + +; PPC64-FP: _f1: +; PPC64-FP: std r31, 40(r1) +; PPC64-FP: lis r0, -1 +; PPC64-FP: ori r0, r0, 32656 +; PPC64-FP: stdux r1, r1, r0 +; ... +; PPC64-FP: ld r1, 0(r1) +; PPC64-FP: ld r31, 40(r1) +; PPC64-FP: blr From isanbard at gmail.com Tue Aug 25 16:01:43 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 21:01:43 -0000 Subject: [llvm-commits] [llvm] r80030 - /llvm/trunk/include/llvm/MC/MCAsmInfo.h Message-ID: <200908252101.n7PL1hdw011535@zion.cs.uiuc.edu> Author: void Date: Tue Aug 25 16:01:42 2009 New Revision: 80030 URL: http://llvm.org/viewvc/llvm-project?rev=80030&view=rev Log: Comment formatting. Removing of unused #include and type forwarding. OCD is fun! Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=80030&r1=80029&r2=80030&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original) +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Tue Aug 25 16:01:42 2009 @@ -16,12 +16,9 @@ #ifndef LLVM_TARGET_ASM_INFO_H #define LLVM_TARGET_ASM_INFO_H -#include "llvm/Support/DataTypes.h" #include namespace llvm { - template class SmallVectorImpl; - /// MCAsmInfo - This class is intended to be used as a base class for asm /// properties and features specific to the target. namespace ExceptionHandling { enum ExceptionsType { None, Dwarf, SjLj }; } @@ -34,7 +31,7 @@ /// ZeroFillDirective - Directive for emitting a global to the ZeroFill /// section on this target. Null if this target doesn't support zerofill. - const char *ZeroFillDirective; // Default is null. + const char *ZeroFillDirective; // Default is null. /// NonexecutableStackDirective - Directive for declaring to the /// linker and beyond that the emitted code does not require stack @@ -50,77 +47,77 @@ /// .long x-y /// is relocated if the relative locations of x and y change at linktime. /// We want both these things in different places. - bool NeedsSet; // Defaults to false. + bool NeedsSet; // Defaults to false. /// MaxInstLength - This is the maximum possible length of an instruction, /// which is needed to compute the size of an inline asm. - unsigned MaxInstLength; // Defaults to 4. + unsigned MaxInstLength; // Defaults to 4. /// PCSymbol - The symbol used to represent the current PC. Used in PC /// relative expressions. - const char *PCSymbol; // Defaults to "$". + const char *PCSymbol; // Defaults to "$". /// SeparatorChar - This character, if specified, is used to separate /// instructions from each other when on the same line. This is used to /// measure inline asm instructions. - char SeparatorChar; // Defaults to ';' + char SeparatorChar; // Defaults to ';' /// CommentColumn - This indicates the comment num (zero-based) at /// which asm comments should be printed. - unsigned CommentColumn; // Defaults to 60 + unsigned CommentColumn; // Defaults to 60 /// CommentString - This indicates the comment character used by the /// assembler. - const char *CommentString; // Defaults to "#" + const char *CommentString; // Defaults to "#" /// GlobalPrefix - If this is set to a non-empty string, it is prepended /// onto all global symbols. This is often used for "_" or ".". - const char *GlobalPrefix; // Defaults to "" + const char *GlobalPrefix; // Defaults to "" /// PrivateGlobalPrefix - This prefix is used for globals like constant /// pool entries that are completely private to the .s file and should not /// have names in the .o file. This is often "." or "L". - const char *PrivateGlobalPrefix; // Defaults to "." + const char *PrivateGlobalPrefix; // Defaults to "." /// LinkerPrivateGlobalPrefix - This prefix is used for symbols that should /// be passed through the assembler but be removed by the linker. This /// is "l" on Darwin, currently used for some ObjC metadata. - const char *LinkerPrivateGlobalPrefix; // Defaults to "" + const char *LinkerPrivateGlobalPrefix; // Defaults to "" /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is /// emitted before jump tables with the specified prefix. - const char *JumpTableSpecialLabelPrefix; // Default to null. + const char *JumpTableSpecialLabelPrefix; // Default to null. /// GlobalVarAddrPrefix/Suffix - If these are nonempty, these strings /// will enclose any GlobalVariable (that isn't a function) /// - const char *GlobalVarAddrPrefix; // Defaults to "" - const char *GlobalVarAddrSuffix; // Defaults to "" + const char *GlobalVarAddrPrefix; // Defaults to "" + const char *GlobalVarAddrSuffix; // Defaults to "" /// FunctionAddrPrefix/Suffix - If these are nonempty, these strings /// will enclose any GlobalVariable that points to a function. /// - const char *FunctionAddrPrefix; // Defaults to "" - const char *FunctionAddrSuffix; // Defaults to "" + const char *FunctionAddrPrefix; // Defaults to "" + const char *FunctionAddrSuffix; // Defaults to "" /// PersonalityPrefix/Suffix - If these are nonempty, these strings will /// enclose any personality function in the common frame section. /// - const char *PersonalityPrefix; // Defaults to "" - const char *PersonalitySuffix; // Defaults to "" + const char *PersonalityPrefix; // Defaults to "" + const char *PersonalitySuffix; // Defaults to "" /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit /// for EH in Dwarf. /// - bool NeedsIndirectEncoding; // Defaults to false + bool NeedsIndirectEncoding; // Defaults to false /// InlineAsmStart/End - If these are nonempty, they contain a directive to /// emit before and after an inline assembly statement. - const char *InlineAsmStart; // Defaults to "#APP\n" - const char *InlineAsmEnd; // Defaults to "#NO_APP\n" + const char *InlineAsmStart; // Defaults to "#APP\n" + const char *InlineAsmEnd; // Defaults to "#NO_APP\n" /// AssemblerDialect - Which dialect of an assembler variant to use. - unsigned AssemblerDialect; // Defaults to 0 + unsigned AssemblerDialect; // Defaults to 0 /// AllowQuotesInName - This is true if the assembler allows for complex /// symbol names to be surrounded in quotes. This defaults to false. @@ -132,25 +129,25 @@ /// number of zero bytes emitted to the current section. Common cases are /// "\t.zero\t" and "\t.space\t". If this is set to null, the /// Data*bitsDirective's will be used to emit zero bytes. - const char *ZeroDirective; // Defaults to "\t.zero\t" - const char *ZeroDirectiveSuffix; // Defaults to "" + const char *ZeroDirective; // Defaults to "\t.zero\t" + const char *ZeroDirectiveSuffix; // Defaults to "" /// AsciiDirective - This directive allows emission of an ascii string with /// the standard C escape characters embedded into it. - const char *AsciiDirective; // Defaults to "\t.ascii\t" + const char *AsciiDirective; // Defaults to "\t.ascii\t" /// AscizDirective - If not null, this allows for special handling of /// zero terminated strings on this target. This is commonly supported as /// ".asciz". If a target doesn't support this, it can be set to null. - const char *AscizDirective; // Defaults to "\t.asciz\t" + const char *AscizDirective; // Defaults to "\t.asciz\t" /// DataDirectives - These directives are used to output some unit of /// integer data to the current section. If a data directive is set to /// null, smaller data directives will be used to emit the large sizes. - const char *Data8bitsDirective; // Defaults to "\t.byte\t" - const char *Data16bitsDirective; // Defaults to "\t.short\t" - const char *Data32bitsDirective; // Defaults to "\t.long\t" - const char *Data64bitsDirective; // Defaults to "\t.quad\t" + const char *Data8bitsDirective; // Defaults to "\t.byte\t" + const char *Data16bitsDirective; // Defaults to "\t.short\t" + const char *Data32bitsDirective; // Defaults to "\t.long\t" + const char *Data64bitsDirective; // Defaults to "\t.quad\t" /// getDataASDirective - Return the directive that should be used to emit /// data of the specified size to the specified numeric address space. @@ -162,94 +159,94 @@ /// SunStyleELFSectionSwitchSyntax - This is true if this target uses "Sun /// Style" syntax for section switching ("#alloc,#write" etc) instead of the /// normal ELF syntax (,"a,w") in .section directives. - bool SunStyleELFSectionSwitchSyntax; // Defaults to false. + bool SunStyleELFSectionSwitchSyntax; // Defaults to false. /// UsesELFSectionDirectiveForBSS - This is true if this target uses ELF /// '.section' directive before the '.bss' one. It's used for PPC/Linux /// which doesn't support the '.bss' directive only. - bool UsesELFSectionDirectiveForBSS; // Defaults to false. + bool UsesELFSectionDirectiveForBSS; // Defaults to false. //===--- Alignment Information ----------------------------------------===// /// AlignDirective - The directive used to emit round up to an alignment /// boundary. /// - const char *AlignDirective; // Defaults to "\t.align\t" + const char *AlignDirective; // Defaults to "\t.align\t" /// AlignmentIsInBytes - If this is true (the default) then the asmprinter /// emits ".align N" directives, where N is the number of bytes to align to. /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte /// boundary. - bool AlignmentIsInBytes; // Defaults to true + bool AlignmentIsInBytes; // Defaults to true /// TextAlignFillValue - If non-zero, this is used to fill the executable /// space created as the result of a alignment directive. - unsigned TextAlignFillValue; + unsigned TextAlignFillValue; // Defaults to 0 //===--- Section Switching Directives ---------------------------------===// /// JumpTableDirective - if non-null, the directive to emit before jump /// table entries. FIXME: REMOVE THIS. - const char *JumpTableDirective; - const char *PICJumpTableDirective; + const char *JumpTableDirective; // Defaults to NULL. + const char *PICJumpTableDirective; // Defaults to NULL. //===--- Global Variable Emission Directives --------------------------===// /// GlobalDirective - This is the directive used to declare a global entity. /// - const char *GlobalDirective; // Defaults to NULL. + const char *GlobalDirective; // Defaults to NULL. /// ExternDirective - This is the directive used to declare external /// globals. /// - const char *ExternDirective; // Defaults to NULL. + const char *ExternDirective; // Defaults to NULL. /// SetDirective - This is the name of a directive that can be used to tell /// the assembler to set the value of a variable to some expression. - const char *SetDirective; // Defaults to null. + const char *SetDirective; // Defaults to null. /// LCOMMDirective - This is the name of a directive (if supported) that can /// be used to efficiently declare a local (internal) block of zero /// initialized data in the .bss/.data section. The syntax expected is: /// @verbatim SYMBOLNAME LENGTHINBYTES, ALIGNMENT /// @endverbatim - const char *LCOMMDirective; // Defaults to null. + const char *LCOMMDirective; // Defaults to null. - const char *COMMDirective; // Defaults to "\t.comm\t". + const char *COMMDirective; // Defaults to "\t.comm\t". /// COMMDirectiveTakesAlignment - True if COMMDirective take a third /// argument that specifies the alignment of the declaration. - bool COMMDirectiveTakesAlignment; // Defaults to true. + bool COMMDirectiveTakesAlignment; // Defaults to true. /// HasDotTypeDotSizeDirective - True if the target has .type and .size /// directives, this is true for most ELF targets. - bool HasDotTypeDotSizeDirective; // Defaults to true. + bool HasDotTypeDotSizeDirective; // Defaults to true. /// HasSingleParameterDotFile - True if the target has a single parameter /// .file directive, this is true for ELF targets. - bool HasSingleParameterDotFile; // Defaults to true. + bool HasSingleParameterDotFile; // Defaults to true. /// UsedDirective - This directive, if non-null, is used to declare a global /// as being used somehow that the assembler can't see. This prevents dead /// code elimination on some targets. - const char *UsedDirective; // Defaults to null. + const char *UsedDirective; // Defaults to NULL. /// WeakRefDirective - This directive, if non-null, is used to declare a /// global as being a weak undefined symbol. - const char *WeakRefDirective; // Defaults to null. + const char *WeakRefDirective; // Defaults to NULL. /// WeakDefDirective - This directive, if non-null, is used to declare a /// global as being a weak defined symbol. - const char *WeakDefDirective; // Defaults to null. + const char *WeakDefDirective; // Defaults to NULL. /// HiddenDirective - This directive, if non-null, is used to declare a /// global or function as having hidden visibility. - const char *HiddenDirective; // Defaults to "\t.hidden\t". + const char *HiddenDirective; // Defaults to "\t.hidden\t". /// ProtectedDirective - This directive, if non-null, is used to declare a /// global or function as having protected visibility. - const char *ProtectedDirective; // Defaults to "\t.protected\t". + const char *ProtectedDirective; // Defaults to "\t.protected\t". //===--- Dwarf Emission Directives -----------------------------------===// @@ -303,7 +300,7 @@ //===--- CBE Asm Translation Table -----------------------------------===// - const char *const *AsmTransCBE; // Defaults to empty + const char *const *AsmTransCBE; // Defaults to empty public: explicit MCAsmInfo(); From sabre at nondot.org Tue Aug 25 16:01:56 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 25 Aug 2009 21:01:56 -0000 Subject: [llvm-commits] [llvm] r80031 - /llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Message-ID: <200908252101.n7PL1uiV011573@zion.cs.uiuc.edu> Author: lattner Date: Tue Aug 25 16:01:56 2009 New Revision: 80031 URL: http://llvm.org/viewvc/llvm-project?rev=80031&view=rev Log: remove some dead lines. Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Modified: llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll?rev=80031&r1=80030&r2=80031&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/Frames-large.ll Tue Aug 25 16:01:56 2009 @@ -5,13 +5,6 @@ ; RUN: llc < %t.bc -march=ppc64 | FileCheck %s -check-prefix=PPC64-NOFP ; RUN: llc < %t.bc -march=ppc64 -disable-fp-elim | FileCheck %s -check-prefix=PPC64-FP -; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim > %t -; RUN: grep {std r31, 40(r1)} %t -; RUN: grep {lis r0, -1} %t -; RUN: grep {ori r0, r0, 32656} %t -; RUN: grep {stdux r1, r1, r0} %t -; RUN: grep {ld r1, 0(r1)} %t -; RUN: grep {ld r31, 40(r1)} %t target triple = "powerpc-apple-darwin8" From isanbard at gmail.com Tue Aug 25 16:09:51 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 21:09:51 -0000 Subject: [llvm-commits] [llvm] r80032 - /llvm/trunk/lib/MC/MCAsmInfo.cpp Message-ID: <200908252109.n7PL9pUq012525@zion.cs.uiuc.edu> Author: void Date: Tue Aug 25 16:09:50 2009 New Revision: 80032 URL: http://llvm.org/viewvc/llvm-project?rev=80032&view=rev Log: Add the #include here. Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=80032&r1=80031&r2=80032&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Tue Aug 25 16:09:50 2009 @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/MC/MCAsmInfo.h" +#include "llvm/Support/DataTypes.h" #include #include using namespace llvm; From daniel at zuster.org Tue Aug 25 16:10:45 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 25 Aug 2009 21:10:45 -0000 Subject: [llvm-commits] [llvm] r80033 - /llvm/trunk/lib/MC/MCAssembler.cpp Message-ID: <200908252110.n7PLAjTN012654@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 16:10:45 2009 New Revision: 80033 URL: http://llvm.org/viewvc/llvm-project?rev=80033&view=rev Log: llvm-mc: Add statistic for number of fragments emitted by the assembler. Modified: llvm/trunk/lib/MC/MCAssembler.cpp Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=80033&r1=80032&r2=80033&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Tue Aug 25 16:10:45 2009 @@ -7,11 +7,13 @@ // //===----------------------------------------------------------------------===// +#define DEBUG_TYPE "assembler" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/Target/TargetMachOWriterInfo.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallString.h" +#include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/ErrorHandling.h" @@ -21,6 +23,8 @@ class MachObjectWriter; +STATISTIC(EmittedFragments, "Number of emitted assembler fragments"); + static void WriteFileData(raw_ostream &OS, const MCSectionData &SD, MachObjectWriter &MOW); @@ -692,6 +696,8 @@ uint64_t Start = OS.tell(); (void) Start; + ++EmittedFragments; + // FIXME: Embed in fragments instead? switch (F.getKind()) { case MCFragment::FT_Align: { From clattner at apple.com Tue Aug 25 16:11:19 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 25 Aug 2009 14:11:19 -0700 Subject: [llvm-commits] [llvm] r79615 - in /llvm/trunk/test/Analysis/Profiling: ./ 2009-08-21-irregular-loop.ll 2009-08-21-only-one-block.ll 2009-08-21-several-blocks.ll dg.exp In-Reply-To: <6a8523d60908251120q53ed9159i79679a1230174894@mail.gmail.com> References: <200908210936.n7L9aScH013127@zion.cs.uiuc.edu> <76A6DF93-A31D-470D-8504-A9FB859FD2B8@apple.com> <4A8EBD43.60501@gmx.at> <6a8523d60908241238v435742bbxbf7df11512a598c7@mail.gmail.com> <4A93E042.60707@student.tuwien.ac.at> <6a8523d60908251041s5eeb86a0o877457f5d958c3d6@mail.gmail.com> <6a8523d60908251120q53ed9159i79679a1230174894@mail.gmail.com> Message-ID: <7F28DD63-7FA0-4516-A59E-E76205AF1819@apple.com> On Aug 25, 2009, at 11:20 AM, Daniel Dunbar wrote: >> >> I think that llvm-config either knows or could know: >> >> my $TARGET_HAS_JIT = q{1}; >> >> Maybe it should get a new command line option? > > There is still some work to suck this into DejaGNU so it knows not to > run the test if the JIT isn't present. Or did you have something else > in mind? Couldn't the test do something like: ; RUN: !(llvm-config --host-has-jit) || llvm-as < %s | lli something like that? -Chris From clattner at apple.com Tue Aug 25 16:09:47 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 25 Aug 2009 14:09:47 -0700 Subject: [llvm-commits] [llvm] r79958 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp test/CodeGen/CellSPU/loads.ll In-Reply-To: <6a8523d60908251153o102ffa70n1c65067899975b5a@mail.gmail.com> References: <200908242357.n7ONvZ4d032311@zion.cs.uiuc.edu> <6a8523d60908251153o102ffa70n1c65067899975b5a@mail.gmail.com> Message-ID: <82A62C6B-3C7C-4E26-B4A9-A7DDAB449C7E@apple.com> On Aug 25, 2009, at 11:53 AM, Daniel Dunbar wrote: > Hi all, > > On Mon, Aug 24, 2009 at 4:57 PM, Scott Michel wrote: >> - Start moving CellSPU's tests to prefer FileCheck. > > While I don't want to discourage anyone from converting old tests to > use FileCheck (especially complicated old tests), I wanted to mention > that it is *very* likely that I will automatically convert an entire > boatload of tests to FileCheck sometime in, say, the next month. > > This automatic conversion probably won't be super smart, so > complicated tests are worth converting anyway, but if a test is little > more than llvm-as | llc followed by a sequence of greps, then I would > recommend not spending unnecessary time converting things (unless you > want to). > > New tests should still be written with FileCheck where possible, of > course. nice! -Chris From clattner at apple.com Tue Aug 25 16:13:34 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 25 Aug 2009 14:13:34 -0700 Subject: [llvm-commits] [llvm] r80024 - in /llvm/trunk: include/llvm/MC/MCAsmInfo.h lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp In-Reply-To: <200908252021.n7PKLIv9006323@zion.cs.uiuc.edu> References: <200908252021.n7PKLIv9006323@zion.cs.uiuc.edu> Message-ID: On Aug 25, 2009, at 1:21 PM, Bill Wendling wrote: > Author: void > Date: Tue Aug 25 15:21:17 2009 > New Revision: 80024 > > URL: http://llvm.org/viewvc/llvm-project?rev=80024&view=rev > Log: > Add a target asm info hook to specify that particular bits of data > in the FDE > should be forced to 32-bits (.long) even on 64-bit architectures. > Darwin wants > these bits to be 64-bits (.quad). However, other platforms may > disagree. > > This is just the info right now and is part of a work-in-progress > which needs > this. We'll add the actual *use* of this soon. hi Bill, Does this really make sense to go into MCAsmInfo.h? MCAsmInfo.h is (not currently, but intended to be) *just* about the syntax and capabilities of the .s files. A lot of the "this is how eh gets lowered" stuff should go into TargetLowering. What do you think? -Chris > Modified: > llvm/trunk/include/llvm/MC/MCAsmInfo.h > llvm/trunk/lib/MC/MCAsmInfo.cpp > llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp > > Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=80024&r1=80023&r2=80024&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original) > +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Tue Aug 25 15:21:17 2009 > @@ -254,52 +254,49 @@ > //===--- Dwarf Emission Directives > -----------------------------------===// > > /// AbsoluteDebugSectionOffsets - True if we should emit abolute > section > - /// offsets for debug information. Defaults to false. > - bool AbsoluteDebugSectionOffsets; > + /// offsets for debug information. > + bool AbsoluteDebugSectionOffsets; // Defaults to false. > > /// AbsoluteEHSectionOffsets - True if we should emit abolute > section > /// offsets for EH information. Defaults to false. > bool AbsoluteEHSectionOffsets; > > /// HasLEB128 - True if target asm supports leb128 directives. > - /// > - bool HasLEB128; // Defaults to false. > + bool HasLEB128; // Defaults to false. > > /// hasDotLocAndDotFile - True if target asm supports .loc > and .file > /// directives for emitting debugging information. > - /// > - bool HasDotLocAndDotFile; // Defaults to false. > + bool HasDotLocAndDotFile; // Defaults to false. > > /// SupportsDebugInformation - True if target supports emission > of debugging > /// information. > - bool SupportsDebugInformation; > + bool SupportsDebugInformation; // Defaults to false. > > - /// SupportsExceptionHandling - True if target supports > - /// exception handling. > - /// > - // Defaults to None > - ExceptionHandling::ExceptionsType ExceptionsType; > + /// SupportsExceptionHandling - True if target supports > exception handling. > + ExceptionHandling::ExceptionsType ExceptionsType; // Defaults > to None > > /// RequiresFrameSection - true if the Dwarf2 output needs a > frame section > - /// > - bool DwarfRequiresFrameSection; // Defaults to true. > + bool DwarfRequiresFrameSection; // Defaults to true. > > /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection > is used to > /// encode inline subroutine information. > - bool DwarfUsesInlineInfoSection; // Defaults to false. > + bool DwarfUsesInlineInfoSection; // Defaults to false. > > /// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private > so that it > /// doesn't show up in the symbol table of the object file. > - bool Is_EHSymbolPrivate; // Defaults to true. > + bool Is_EHSymbolPrivate; // Defaults to true. > + > + /// ForceEncodingOfFDETo32Bits - If set, the encoding of some > of the FDE > + /// data is forced to 32-bit. > + bool ForceEncodingOfFDETo32Bits; // Defaults to true. > > /// GlobalEHDirective - This is the directive used to make > exception frame > /// tables globally visible. > - /// > - const char *GlobalEHDirective; // Defaults to NULL. > + const char *GlobalEHDirective; // Defaults to NULL. > > /// SupportsWeakEmptyEHFrame - True if target assembler and > linker will > /// handle a weak_definition of constant 0 for an omitted EH > frame. > - bool SupportsWeakOmittedEHFrame; // Defaults to true. > + bool SupportsWeakOmittedEHFrame; // Defaults to true. > > /// DwarfSectionOffsetDirective - Special section offset > directive. > const char* DwarfSectionOffsetDirective; // Defaults to NULL > @@ -508,6 +505,9 @@ > bool is_EHSymbolPrivate() const { > return Is_EHSymbolPrivate; > } > + bool forceEncodingOfFDETo32Bits() const { > + return ForceEncodingOfFDETo32Bits; > + } > const char *getGlobalEHDirective() const { > return GlobalEHDirective; > } > > Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=80024&r1=80023&r2=80024&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original) > +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Tue Aug 25 15:21:17 2009 > @@ -78,6 +78,7 @@ > DwarfRequiresFrameSection = true; > DwarfUsesInlineInfoSection = false; > Is_EHSymbolPrivate = true; > + ForceEncodingOfFDETo32Bits = true; > GlobalEHDirective = 0; > SupportsWeakOmittedEHFrame = true; > DwarfSectionOffsetDirective = 0; > > Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=80024&r1=80023&r2=80024&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original) > +++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Tue Aug 25 15:21:17 2009 > @@ -52,6 +52,7 @@ > // doesn't hurt anything. > // FIXME: I need to get this from Triple. > Is_EHSymbolPrivate = false; > + ForceEncodingOfFDETo32Bits = false; > GlobalEHDirective = "\t.globl\t"; > SupportsWeakOmittedEHFrame = false; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From echristo at apple.com Tue Aug 25 16:20:13 2009 From: echristo at apple.com (Eric Christopher) Date: Tue, 25 Aug 2009 14:20:13 -0700 Subject: [llvm-commits] [llvm] r80024 - in /llvm/trunk: include/llvm/MC/MCAsmInfo.h lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp In-Reply-To: References: <200908252021.n7PKLIv9006323@zion.cs.uiuc.edu> Message-ID: > > > Does this really make sense to go into MCAsmInfo.h? MCAsmInfo.h is > (not currently, but intended to be) *just* about the syntax and > capabilities of the .s files. A lot of the "this is how eh gets > lowered" stuff should go into TargetLowering. What do you think? I was wondering about that myself - at least on the Target side I think we're going to need a few hooks for EH data. Probably a set of routines to override somewhere would be good. -eric From isanbard at gmail.com Tue Aug 25 16:23:02 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 14:23:02 -0700 Subject: [llvm-commits] [llvm] r80024 - in /llvm/trunk: include/llvm/MC/MCAsmInfo.h lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp In-Reply-To: References: <200908252021.n7PKLIv9006323@zion.cs.uiuc.edu> Message-ID: <16e5fdf90908251423y43797842yb07bbdd8d2d57299@mail.gmail.com> On Tue, Aug 25, 2009 at 2:20 PM, Eric Christopher wrote: >> Does this really make sense to go into MCAsmInfo.h? ?MCAsmInfo.h is >> (not currently, but intended to be) *just* about the syntax and >> capabilities of the .s files. ?A lot of the "this is how eh gets >> lowered" stuff should go into TargetLowering. ?What do you think? > > I was wondering about that myself - at least on the Target side I think > we're going to need a few hooks for EH data. Probably a set of routines to > override somewhere would be good. > I see what both of you mean. Okay, I'll go ahead and make the change. As Eric says, there will be a lot more of this type of stuff coming up. -bw From ggreif at gmail.com Tue Aug 25 16:25:23 2009 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 25 Aug 2009 21:25:23 -0000 Subject: [llvm-commits] [llvm] r80035 - in /llvm/trunk/include/llvm: ADT/ilist.h ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h Message-ID: <200908252125.n7PLPNAL014449@zion.cs.uiuc.edu> Author: ggreif Date: Tue Aug 25 16:25:22 2009 New Revision: 80035 URL: http://llvm.org/viewvc/llvm-project?rev=80035&view=rev Log: re-committing yesterday's r79938. This time there is no additional include of llvm/Config/config.h at all. Instead I use a hard-coded preprecessor symbol: LLVM_COMPACTIFY_SENTINELS (should this work on the self-hosting buildbot, then cleanups come next) Modified: llvm/trunk/include/llvm/ADT/ilist.h llvm/trunk/include/llvm/ADT/ilist_node.h llvm/trunk/include/llvm/BasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/Function.h Modified: llvm/trunk/include/llvm/ADT/ilist.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=80035&r1=80034&r2=80035&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist.h (original) +++ llvm/trunk/include/llvm/ADT/ilist.h Tue Aug 25 16:25:22 2009 @@ -41,6 +41,21 @@ #include "llvm/ADT/iterator.h" #include +#undef LLVM_COMPACTIFY_SENTINELS +/// @brief activate small sentinel structs +/// Comment out if you want better debuggability +/// of ilist<> end() iterators. +/// See also llvm/ADT/ilist_node.h, where the +/// same change must be made. +/// +#define LLVM_COMPACTIFY_SENTINELS 1 + +#if defined(LLVM_COMPACTIFY_SENTINELS) && LLVM_COMPACTIFY_SENTINELS +# define sentinel_tail_assert(COND) +#else +# define sentinel_tail_assert(COND) assert(COND) +#endif + namespace llvm { template class iplist; @@ -189,12 +204,12 @@ // Accessors... operator pointer() const { - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return NodePtr; } reference operator*() const { - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return *NodePtr; } pointer operator->() const { return &operator*(); } @@ -215,7 +230,7 @@ } ilist_iterator &operator++() { // preincrement - Advance NodePtr = Traits::getNext(NodePtr); - assert(NodePtr && "++'d off the end of an ilist!"); + sentinel_tail_assert(NodePtr && "++'d off the end of an ilist!"); return *this; } ilist_iterator operator--(int) { // postdecrement operators... Modified: llvm/trunk/include/llvm/ADT/ilist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=80035&r1=80034&r2=80035&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) +++ llvm/trunk/include/llvm/ADT/ilist_node.h Tue Aug 25 16:25:22 2009 @@ -15,33 +15,63 @@ #ifndef LLVM_ADT_ILIST_NODE_H #define LLVM_ADT_ILIST_NODE_H +#undef LLVM_COMPACTIFY_SENTINELS +/// @brief activate small sentinel structs +/// Comment out if you want better debuggability +/// of ilist<> end() iterators. +/// See also llvm/ADT/ilist.h, where the +/// same change must be made. +/// +#define LLVM_COMPACTIFY_SENTINELS 1 + namespace llvm { template -struct ilist_nextprev_traits; +struct ilist_traits; +/// ilist_half_node - Base class that provides prev services for sentinels. +/// template -struct ilist_traits; +class ilist_half_node { + friend struct ilist_traits; + NodeTy *Prev; +protected: + NodeTy *getPrev() { return Prev; } + const NodeTy *getPrev() const { return Prev; } + void setPrev(NodeTy *P) { Prev = P; } + ilist_half_node() : Prev(0) {} +}; + +template +struct ilist_nextprev_traits; /// ilist_node - Base class that provides next/prev services for nodes /// that use ilist_nextprev_traits or ilist_default_traits. /// template -class ilist_node { -private: +class ilist_node : ilist_half_node { friend struct ilist_nextprev_traits; friend struct ilist_traits; - NodeTy *Prev, *Next; - NodeTy *getPrev() { return Prev; } + NodeTy *Next; NodeTy *getNext() { return Next; } - const NodeTy *getPrev() const { return Prev; } const NodeTy *getNext() const { return Next; } - void setPrev(NodeTy *N) { Prev = N; } void setNext(NodeTy *N) { Next = N; } protected: - ilist_node() : Prev(0), Next(0) {} + ilist_node() : Next(0) {} }; +/// When assertions are off, the Next field of sentinels +/// will not be accessed. So it is not necessary to allocate +/// space for it. The following macro selects the most +/// efficient traits class. The LLVM_COMPACTIFY_SENTINELS +/// preprocessor symbol controls this. +/// +#if defined(LLVM_COMPACTIFY_SENTINELS) && LLVM_COMPACTIFY_SENTINELS +# define ILIST_NODE ilist_half_node +#else +# define ILIST_NODE ilist_node +#endif + } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=80035&r1=80034&r2=80035&view=diff ============================================================================== --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Tue Aug 25 16:25:22 2009 @@ -47,7 +47,7 @@ Instruction *ensureHead(Instruction*) const { return createSentinel(); } static void noteHead(Instruction*, Instruction*) {} private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; /// This represents a single basic block in LLVM. A basic block is simply a Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=80035&r1=80034&r2=80035&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Tue Aug 25 16:25:22 2009 @@ -26,7 +26,7 @@ template <> struct ilist_traits : public ilist_default_traits { private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; // this is only set by the MachineBasicBlock owning the LiveList friend class MachineBasicBlock; Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=80035&r1=80034&r2=80035&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Tue Aug 25 16:25:22 2009 @@ -38,7 +38,7 @@ template <> struct ilist_traits : public ilist_default_traits { - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; public: MachineBasicBlock *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=80035&r1=80034&r2=80035&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Aug 25 16:25:22 2009 @@ -37,7 +37,7 @@ template<> struct ilist_traits : public ilist_default_traits { private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; public: SDNode *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=80035&r1=80034&r2=80035&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Tue Aug 25 16:25:22 2009 @@ -45,7 +45,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; template<> struct ilist_traits @@ -62,7 +62,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; class Function : public GlobalValue, From isanbard at gmail.com Tue Aug 25 16:31:39 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 25 Aug 2009 21:31:39 -0000 Subject: [llvm-commits] [llvm] r80036 - in /llvm/trunk: include/llvm/MC/MCAsmInfo.h lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp Message-ID: <200908252131.n7PLVdWl015242@zion.cs.uiuc.edu> Author: void Date: Tue Aug 25 16:31:39 2009 New Revision: 80036 URL: http://llvm.org/viewvc/llvm-project?rev=80036&view=rev Log: Revert last patch. We need to put this into TargetLowering. There will be a lot of EH stuff going into there, so we can wait to add them all then. Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h llvm/trunk/lib/MC/MCAsmInfo.cpp llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=80036&r1=80035&r2=80036&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original) +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Tue Aug 25 16:31:39 2009 @@ -283,10 +283,6 @@ /// doesn't show up in the symbol table of the object file. bool Is_EHSymbolPrivate; // Defaults to true. - /// ForceEncodingOfFDETo32Bits - If set, the encoding of some of the FDE - /// data is forced to 32-bit. - bool ForceEncodingOfFDETo32Bits; // Defaults to true. - /// GlobalEHDirective - This is the directive used to make exception frame /// tables globally visible. const char *GlobalEHDirective; // Defaults to NULL. @@ -502,9 +498,6 @@ bool is_EHSymbolPrivate() const { return Is_EHSymbolPrivate; } - bool forceEncodingOfFDETo32Bits() const { - return ForceEncodingOfFDETo32Bits; - } const char *getGlobalEHDirective() const { return GlobalEHDirective; } Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=80036&r1=80035&r2=80036&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Tue Aug 25 16:31:39 2009 @@ -79,7 +79,6 @@ DwarfRequiresFrameSection = true; DwarfUsesInlineInfoSection = false; Is_EHSymbolPrivate = true; - ForceEncodingOfFDETo32Bits = true; GlobalEHDirective = 0; SupportsWeakOmittedEHFrame = true; DwarfSectionOffsetDirective = 0; Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=80036&r1=80035&r2=80036&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Tue Aug 25 16:31:39 2009 @@ -52,7 +52,6 @@ // doesn't hurt anything. // FIXME: I need to get this from Triple. Is_EHSymbolPrivate = false; - ForceEncodingOfFDETo32Bits = false; GlobalEHDirective = "\t.globl\t"; SupportsWeakOmittedEHFrame = false; From gohman at apple.com Tue Aug 25 17:11:20 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 22:11:20 -0000 Subject: [llvm-commits] [llvm] r80038 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instruction.h include/llvm/Instructions.h include/llvm/Value.h lib/Transforms/IPO/MergeFunctions.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/Transforms/Utils/BasicBlockUtils.cpp lib/Transforms/Utils/SimplifyCFG.cpp lib/VMCore/Instruction.cpp lib/VMCore/Instructions.cpp Message-ID: <200908252211.n7PMBLsV020878@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 17:11:20 2009 New Revision: 80038 URL: http://llvm.org/viewvc/llvm-project?rev=80038&view=rev Log: Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined, and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! Modified: llvm/trunk/include/llvm/InstrTypes.h llvm/trunk/include/llvm/Instruction.h llvm/trunk/include/llvm/Instructions.h llvm/trunk/include/llvm/Value.h llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp llvm/trunk/lib/VMCore/Instruction.cpp llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/include/llvm/InstrTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/include/llvm/InstrTypes.h (original) +++ llvm/trunk/include/llvm/InstrTypes.h Tue Aug 25 17:11:20 2009 @@ -90,7 +90,6 @@ class UnaryInstruction : public Instruction { void *operator new(size_t, unsigned); // Do not implement - UnaryInstruction(const UnaryInstruction&); // Do not implement protected: UnaryInstruction(const Type *Ty, unsigned iType, Value *V, @@ -315,12 +314,6 @@ /// if (isa(Instr)) { ... } /// @brief Base class of casting instructions. class CastInst : public UnaryInstruction { - /// @brief Copy constructor - CastInst(const CastInst &CI) - : UnaryInstruction(CI.getType(), CI.getOpcode(), CI.getOperand(0)) { - } - /// @brief Do not allow default construction - CastInst(); protected: /// @brief Constructor with insert-before-instruction semantics for subclasses CastInst(const Type *Ty, unsigned iType, Value *S, Modified: llvm/trunk/include/llvm/Instruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instruction.h (original) +++ llvm/trunk/include/llvm/Instruction.h Tue Aug 25 17:11:20 2009 @@ -54,6 +54,11 @@ /// extra information (e.g. load is volatile) agree. bool isIdenticalTo(const Instruction *I) const; + /// isIdenticalToWhenDefined - This is like isIdenticalTo, except that it + /// ignores the SubclassOptionalData flags, which specify conditions + /// under which the instruction's result is undefined. + bool isIdenticalToWhenDefined(const Instruction *I) const; + /// This function determines if the specified instruction executes the same /// operation as the current one. This means that the opcodes, type, operand /// types and any other factors affecting the operation must be the same. This Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue Aug 25 17:11:20 2009 @@ -99,7 +99,6 @@ /// MallocInst - an instruction to allocated memory on the heap /// class MallocInst : public AllocationInst { - MallocInst(const MallocInst &MI); public: explicit MallocInst(const Type *Ty, Value *ArraySize = 0, const Twine &NameStr = "", @@ -148,7 +147,6 @@ /// AllocaInst - an instruction to allocate memory on the stack /// class AllocaInst : public AllocationInst { - AllocaInst(const AllocaInst &); public: explicit AllocaInst(const Type *Ty, Value *ArraySize = 0, @@ -234,16 +232,6 @@ /// SubclassData field in Value to store whether or not the load is volatile. /// class LoadInst : public UnaryInstruction { - - LoadInst(const LoadInst &LI) - : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) { - setVolatile(LI.isVolatile()); - setAlignment(LI.getAlignment()); - -#ifndef NDEBUG - AssertOK(); -#endif - } void AssertOK(); public: LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore); @@ -308,18 +296,6 @@ /// class StoreInst : public Instruction { void *operator new(size_t, unsigned); // DO NOT IMPLEMENT - - StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store, - &Op<0>(), 2) { - Op<0>() = SI.Op<0>(); - Op<1>() = SI.Op<1>(); - setVolatile(SI.isVolatile()); - setAlignment(SI.getAlignment()); - -#ifndef NDEBUG - AssertOK(); -#endif - } void AssertOK(); public: // allocate space for exactly two operands @@ -1196,10 +1172,6 @@ Op<2>() = S2; } - SelectInst(const SelectInst &SI) - : Instruction(SI.getType(), SI.getOpcode(), &Op<0>(), 3) { - init(SI.Op<0>(), SI.Op<1>(), SI.Op<2>()); - } SelectInst(Value *C, Value *S1, Value *S2, const Twine &NameStr, Instruction *InsertBefore) : Instruction(S1->getType(), Instruction::Select, @@ -1267,8 +1239,6 @@ /// an argument of the specified type given a va_list and increments that list /// class VAArgInst : public UnaryInstruction { - VAArgInst(const VAArgInst &VAA) - : UnaryInstruction(VAA.getType(), VAArg, VAA.getOperand(0)) {} public: VAArgInst(Value *List, const Type *Ty, const Twine &NameStr = "", Instruction *InsertBefore = 0) @@ -1301,19 +1271,13 @@ /// element from a VectorType value /// class ExtractElementInst : public Instruction { - ExtractElementInst(const ExtractElementInst &EE) : - Instruction(EE.getType(), ExtractElement, &Op<0>(), 2) { - Op<0>() = EE.Op<0>(); - Op<1>() = EE.Op<1>(); - } - ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr = "", Instruction *InsertBefore = 0); ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd); public: static ExtractElementInst *Create(const ExtractElementInst &EE) { - return new(EE.getNumOperands()) ExtractElementInst(EE); + return Create(EE.getOperand(0), EE.getOperand(1)); } static ExtractElementInst *Create(Value *Vec, Value *Idx, @@ -1360,7 +1324,6 @@ /// element into a VectorType value /// class InsertElementInst : public Instruction { - InsertElementInst(const InsertElementInst &IE); InsertElementInst(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr = "", Instruction *InsertBefore = 0); @@ -1368,7 +1331,7 @@ const Twine &NameStr, BasicBlock *InsertAtEnd); public: static InsertElementInst *Create(const InsertElementInst &IE) { - return new(IE.getNumOperands()) InsertElementInst(IE); + return Create(IE.getOperand(0), IE.getOperand(1), IE.getOperand(2)); } static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr = "", @@ -1421,7 +1384,6 @@ /// input vectors. /// class ShuffleVectorInst : public Instruction { - ShuffleVectorInst(const ShuffleVectorInst &IE); public: // allocate space for exactly three operands void *operator new(size_t s) { @@ -2658,10 +2620,6 @@ /// @brief This class represents a truncation of integer types. class TruncInst : public CastInst { - /// Private copy constructor - TruncInst(const TruncInst &CI) - : CastInst(CI.getType(), Trunc, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics TruncInst( @@ -2698,10 +2656,6 @@ /// @brief This class represents zero extension of integer types. class ZExtInst : public CastInst { - /// @brief Private copy constructor - ZExtInst(const ZExtInst &CI) - : CastInst(CI.getType(), ZExt, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics ZExtInst( @@ -2738,10 +2692,6 @@ /// @brief This class represents a sign extension of integer types. class SExtInst : public CastInst { - /// @brief Private copy constructor - SExtInst(const SExtInst &CI) - : CastInst(CI.getType(), SExt, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics SExtInst( @@ -2778,9 +2728,6 @@ /// @brief This class represents a truncation of floating point types. class FPTruncInst : public CastInst { - FPTruncInst(const FPTruncInst &CI) - : CastInst(CI.getType(), FPTrunc, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics FPTruncInst( @@ -2817,9 +2764,6 @@ /// @brief This class represents an extension of floating point types. class FPExtInst : public CastInst { - FPExtInst(const FPExtInst &CI) - : CastInst(CI.getType(), FPExt, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics FPExtInst( @@ -2856,9 +2800,6 @@ /// @brief This class represents a cast unsigned integer to floating point. class UIToFPInst : public CastInst { - UIToFPInst(const UIToFPInst &CI) - : CastInst(CI.getType(), UIToFP, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics UIToFPInst( @@ -2895,9 +2836,6 @@ /// @brief This class represents a cast from signed integer to floating point. class SIToFPInst : public CastInst { - SIToFPInst(const SIToFPInst &CI) - : CastInst(CI.getType(), SIToFP, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics SIToFPInst( @@ -2934,9 +2872,6 @@ /// @brief This class represents a cast from floating point to unsigned integer class FPToUIInst : public CastInst { - FPToUIInst(const FPToUIInst &CI) - : CastInst(CI.getType(), FPToUI, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics FPToUIInst( @@ -2973,9 +2908,6 @@ /// @brief This class represents a cast from floating point to signed integer. class FPToSIInst : public CastInst { - FPToSIInst(const FPToSIInst &CI) - : CastInst(CI.getType(), FPToSI, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics FPToSIInst( @@ -3012,9 +2944,6 @@ /// @brief This class represents a cast from an integer to a pointer. class IntToPtrInst : public CastInst { - IntToPtrInst(const IntToPtrInst &CI) - : CastInst(CI.getType(), IntToPtr, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics IntToPtrInst( @@ -3051,9 +2980,6 @@ /// @brief This class represents a cast from a pointer to an integer class PtrToIntInst : public CastInst { - PtrToIntInst(const PtrToIntInst &CI) - : CastInst(CI.getType(), PtrToInt, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics PtrToIntInst( @@ -3090,9 +3016,6 @@ /// @brief This class represents a no-op cast from one type to another. class BitCastInst : public CastInst { - BitCastInst(const BitCastInst &CI) - : CastInst(CI.getType(), BitCast, CI.getOperand(0)) { - } public: /// @brief Constructor with insert-before-instruction semantics BitCastInst( Modified: llvm/trunk/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/include/llvm/Value.h (original) +++ llvm/trunk/include/llvm/Value.h Tue Aug 25 17:11:20 2009 @@ -240,6 +240,18 @@ return SubclassID; } + /// hasSameSubclassOptionalData - Test whether the optional flags contained + /// in this value are equal to the optional flags in the given value. + bool hasSameSubclassOptionalData(const Value *V) const { + return SubclassOptionalData == V->SubclassOptionalData; + } + + /// intersectOptionalDataWith - Clear any optional flags in this value + /// that are not also set in the given value. + void intersectOptionalDataWith(const Value *V) { + SubclassOptionalData &= V->SubclassOptionalData; + } + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const Value *) { return true; // Values are always values. Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Tue Aug 25 17:11:20 2009 @@ -188,7 +188,8 @@ isEquivalentOperation(const Instruction *I1, const Instruction *I2) { if (I1->getOpcode() != I2->getOpcode() || I1->getNumOperands() != I2->getNumOperands() || - !isEquivalentType(I1->getType(), I2->getType())) + !isEquivalentType(I1->getType(), I2->getType()) || + !I1->hasSameSubclassOptionalData(I2)) return false; // We have two instructions of identical opcode and #operands. Check to see Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Aug 25 17:11:20 2009 @@ -11815,12 +11815,16 @@ if (A == B) return true; // Test if the values come form identical arithmetic instructions. + // This uses isIdenticalToWhenDefined instead of isIdenticalTo because + // its only used to compare two uses within the same basic block, which + // means that they'll always either have the same value or one of them + // will have an undefined value. if (isa(A) || isa(A) || isa(A) || isa(A)) if (Instruction *BI = dyn_cast(B)) - if (cast(A)->isIdenticalTo(BI)) + if (cast(A)->isIdenticalToWhenDefined(BI)) return true; // Otherwise they may not be equivalent. Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Tue Aug 25 17:11:20 2009 @@ -504,11 +504,15 @@ // Test if the values are trivially equivalent. if (A == B) return true; - // Test if the values come form identical arithmetic instructions. + // Test if the values come from identical arithmetic instructions. + // Use isIdenticalToWhenDefined instead of isIdenticalTo because + // this function is only used when one address use dominates the + // other, which means that they'll always either have the same + // value or one of them will have an undefined value. if (isa(A) || isa(A) || isa(A) || isa(A)) if (const Instruction *BI = dyn_cast(B)) - if (cast(A)->isIdenticalTo(BI)) + if (cast(A)->isIdenticalToWhenDefined(BI)) return true; // Otherwise they may not be equivalent. Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Tue Aug 25 17:11:20 2009 @@ -872,7 +872,7 @@ while (isa(I2)) I2 = BB2_Itr++; if (I1->getOpcode() != I2->getOpcode() || isa(I1) || - !I1->isIdenticalTo(I2) || + !I1->isIdenticalToWhenDefined(I2) || (isa(I1) && !isSafeToHoistInvoke(BB1, BB2, I1, I2))) return false; @@ -891,6 +891,7 @@ BIParent->getInstList().splice(BI, BB1->getInstList(), I1); if (!I2->use_empty()) I2->replaceAllUsesWith(I1); + I1->intersectOptionalDataWith(I2); BB2->getInstList().erase(I2); I1 = BB1_Itr++; @@ -899,7 +900,8 @@ I2 = BB2_Itr++; while (isa(I2)) I2 = BB2_Itr++; - } while (I1->getOpcode() == I2->getOpcode() && I1->isIdenticalTo(I2)); + } while (I1->getOpcode() == I2->getOpcode() && + I1->isIdenticalToWhenDefined(I2)); return true; Modified: llvm/trunk/lib/VMCore/Instruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instruction.cpp?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instruction.cpp (original) +++ llvm/trunk/lib/VMCore/Instruction.cpp Tue Aug 25 17:11:20 2009 @@ -168,6 +168,14 @@ /// identical to the current one. This means that all operands match and any /// extra information (e.g. load is volatile) agree. bool Instruction::isIdenticalTo(const Instruction *I) const { + return isIdenticalTo(I) && + SubclassOptionalData == I->SubclassOptionalData; +} + +/// isIdenticalToWenDefined - This is like isIdenticalTo, except that it +/// ignores the SubclassOptionalData flags, which specify conditions +/// under which the instruction's result is undefined. +bool Instruction::isIdenticalToWhenDefined(const Instruction *I) const { if (getOpcode() != I->getOpcode() || getNumOperands() != I->getNumOperands() || getType() != I->getType()) Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=80038&r1=80037&r2=80038&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Aug 25 17:11:20 2009 @@ -154,6 +154,7 @@ OL[i] = PN.getOperand(i); OL[i+1] = PN.getOperand(i+1); } + SubclassOptionalData = PN.SubclassOptionalData; } PHINode::~PHINode() { @@ -403,6 +404,7 @@ Use *InOL = CI.OperandList; for (unsigned i = 0, e = CI.getNumOperands(); i != e; ++i) OL[i] = InOL[i]; + SubclassOptionalData = CI.SubclassOptionalData; } void CallInst::addAttribute(unsigned i, Attributes attr) { @@ -464,6 +466,7 @@ Use *OL = OperandList, *InOL = II.OperandList; for (unsigned i = 0, e = II.getNumOperands(); i != e; ++i) OL[i] = InOL[i]; + SubclassOptionalData = II.SubclassOptionalData; } BasicBlock *InvokeInst::getSuccessorV(unsigned idx) const { @@ -508,6 +511,7 @@ RI.getNumOperands()) { if (RI.getNumOperands()) Op<0>() = RI.Op<0>(); + SubclassOptionalData = RI.SubclassOptionalData; } ReturnInst::ReturnInst(LLVMContext &C, Value *retVal, Instruction *InsertBefore) @@ -663,6 +667,7 @@ Op<-3>() = BI.Op<-3>(); Op<-2>() = BI.Op<-2>(); } + SubclassOptionalData = BI.SubclassOptionalData; } @@ -757,12 +762,6 @@ return getType()->getElementType(); } -AllocaInst::AllocaInst(const AllocaInst &AI) - : AllocationInst(AI.getType()->getElementType(), - (Value*)AI.getOperand(0), Instruction::Alloca, - AI.getAlignment()) { -} - /// isStaticAlloca - Return true if this alloca is in the entry block of the /// function and is a constant size. If so, the code generator will fold it /// into the prolog/epilog code, so it is basically free. @@ -775,12 +774,6 @@ return Parent == &Parent->getParent()->front(); } -MallocInst::MallocInst(const MallocInst &MI) - : AllocationInst(MI.getType()->getElementType(), - (Value*)MI.getOperand(0), Instruction::Malloc, - MI.getAlignment()) { -} - //===----------------------------------------------------------------------===// // FreeInst Implementation //===----------------------------------------------------------------------===// @@ -1048,6 +1041,7 @@ Use *GEPIOL = GEPI.OperandList; for (unsigned i = 0, E = NumOperands; i != E; ++i) OL[i] = GEPIOL[i]; + SubclassOptionalData = GEPI.SubclassOptionalData; } GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx, @@ -1211,13 +1205,6 @@ // InsertElementInst Implementation //===----------------------------------------------------------------------===// -InsertElementInst::InsertElementInst(const InsertElementInst &IE) - : Instruction(IE.getType(), InsertElement, - OperandTraits::op_begin(this), 3) { - Op<0>() = IE.Op<0>(); - Op<1>() = IE.Op<1>(); - Op<2>() = IE.Op<2>(); -} InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, Value *Index, const Twine &Name, Instruction *InsertBef) @@ -1265,15 +1252,6 @@ // ShuffleVectorInst Implementation //===----------------------------------------------------------------------===// -ShuffleVectorInst::ShuffleVectorInst(const ShuffleVectorInst &SV) - : Instruction(SV.getType(), ShuffleVector, - OperandTraits::op_begin(this), - OperandTraits::operands(this)) { - Op<0>() = SV.Op<0>(); - Op<1>() = SV.Op<1>(); - Op<2>() = SV.Op<2>(); -} - ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask, const Twine &Name, Instruction *InsertBefore) @@ -1364,6 +1342,7 @@ Indices(IVI.Indices) { Op<0>() = IVI.getOperand(0); Op<1>() = IVI.getOperand(1); + SubclassOptionalData = IVI.SubclassOptionalData; } InsertValueInst::InsertValueInst(Value *Agg, @@ -1410,6 +1389,7 @@ ExtractValueInst::ExtractValueInst(const ExtractValueInst &EVI) : UnaryInstruction(EVI.getType(), ExtractValue, EVI.getOperand(0)), Indices(EVI.Indices) { + SubclassOptionalData = EVI.SubclassOptionalData; } // getIndexedType - Returns the type of the element that would be extracted @@ -2790,6 +2770,7 @@ OL[i] = InOL[i]; OL[i+1] = InOL[i+1]; } + SubclassOptionalData = SI.SubclassOptionalData; } SwitchInst::~SwitchInst() { @@ -2882,144 +2863,230 @@ // unit that uses these classes. GetElementPtrInst *GetElementPtrInst::clone(LLVMContext&) const { - return new(getNumOperands()) GetElementPtrInst(*this); + GetElementPtrInst *New = new(getNumOperands()) GetElementPtrInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } BinaryOperator *BinaryOperator::clone(LLVMContext&) const { - return Create(getOpcode(), Op<0>(), Op<1>()); + BinaryOperator *New = Create(getOpcode(), Op<0>(), Op<1>()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } FCmpInst* FCmpInst::clone(LLVMContext &Context) const { - return new FCmpInst(Context, getPredicate(), Op<0>(), Op<1>()); + FCmpInst *New = new FCmpInst(Context, getPredicate(), Op<0>(), Op<1>()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } ICmpInst* ICmpInst::clone(LLVMContext &Context) const { - return new ICmpInst(Context, getPredicate(), Op<0>(), Op<1>()); + ICmpInst *New = new ICmpInst(Context, getPredicate(), Op<0>(), Op<1>()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } ExtractValueInst *ExtractValueInst::clone(LLVMContext&) const { - return new ExtractValueInst(*this); + ExtractValueInst *New = new ExtractValueInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } InsertValueInst *InsertValueInst::clone(LLVMContext&) const { - return new InsertValueInst(*this); + InsertValueInst *New = new InsertValueInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } MallocInst *MallocInst::clone(LLVMContext&) const { - return new MallocInst(*this); + MallocInst *New = new MallocInst(getAllocatedType(), + (Value*)getOperand(0), + getAlignment()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } AllocaInst *AllocaInst::clone(LLVMContext&) const { - return new AllocaInst(*this); + AllocaInst *New = new AllocaInst(getAllocatedType(), + (Value*)getOperand(0), + getAlignment()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } FreeInst *FreeInst::clone(LLVMContext&) const { - return new FreeInst(getOperand(0)); + FreeInst *New = new FreeInst(getOperand(0)); + New->SubclassOptionalData = SubclassOptionalData; + return New; } LoadInst *LoadInst::clone(LLVMContext&) const { - return new LoadInst(*this); + LoadInst *New = new LoadInst(getOperand(0), + Twine(), isVolatile(), + getAlignment()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } StoreInst *StoreInst::clone(LLVMContext&) const { - return new StoreInst(*this); + StoreInst *New = new StoreInst(getOperand(0), getOperand(1), + isVolatile(), getAlignment()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *TruncInst::clone(LLVMContext&) const { - return new TruncInst(*this); + TruncInst *New = new TruncInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *ZExtInst::clone(LLVMContext&) const { - return new ZExtInst(*this); + ZExtInst *New = new ZExtInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *SExtInst::clone(LLVMContext&) const { - return new SExtInst(*this); + SExtInst *New = new SExtInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *FPTruncInst::clone(LLVMContext&) const { - return new FPTruncInst(*this); + FPTruncInst *New = new FPTruncInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *FPExtInst::clone(LLVMContext&) const { - return new FPExtInst(*this); + FPExtInst *New = new FPExtInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *UIToFPInst::clone(LLVMContext&) const { - return new UIToFPInst(*this); + UIToFPInst *New = new UIToFPInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *SIToFPInst::clone(LLVMContext&) const { - return new SIToFPInst(*this); + SIToFPInst *New = new SIToFPInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *FPToUIInst::clone(LLVMContext&) const { - return new FPToUIInst(*this); + FPToUIInst *New = new FPToUIInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *FPToSIInst::clone(LLVMContext&) const { - return new FPToSIInst(*this); + FPToSIInst *New = new FPToSIInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *PtrToIntInst::clone(LLVMContext&) const { - return new PtrToIntInst(*this); + PtrToIntInst *New = new PtrToIntInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *IntToPtrInst::clone(LLVMContext&) const { - return new IntToPtrInst(*this); + IntToPtrInst *New = new IntToPtrInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CastInst *BitCastInst::clone(LLVMContext&) const { - return new BitCastInst(*this); + BitCastInst *New = new BitCastInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } CallInst *CallInst::clone(LLVMContext&) const { - return new(getNumOperands()) CallInst(*this); + CallInst *New = new(getNumOperands()) CallInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } -SelectInst *SelectInst::clone(LLVMContext&) const { - return new(getNumOperands()) SelectInst(*this); +SelectInst *SelectInst::clone(LLVMContext&) const { + SelectInst *New = SelectInst::Create(getOperand(0), + getOperand(1), + getOperand(2)); + New->SubclassOptionalData = SubclassOptionalData; + return New; } VAArgInst *VAArgInst::clone(LLVMContext&) const { - return new VAArgInst(*this); + VAArgInst *New = new VAArgInst(getOperand(0), getType()); + New->SubclassOptionalData = SubclassOptionalData; + return New; } ExtractElementInst *ExtractElementInst::clone(LLVMContext&) const { - return ExtractElementInst::Create(*this); + ExtractElementInst *New = ExtractElementInst::Create(getOperand(0), + getOperand(1)); + New->SubclassOptionalData = SubclassOptionalData; + return New; } InsertElementInst *InsertElementInst::clone(LLVMContext&) const { - return InsertElementInst::Create(*this); + InsertElementInst *New = InsertElementInst::Create(getOperand(0), + getOperand(1), + getOperand(2)); + New->SubclassOptionalData = SubclassOptionalData; + return New; } ShuffleVectorInst *ShuffleVectorInst::clone(LLVMContext&) const { - return new ShuffleVectorInst(*this); + ShuffleVectorInst *New = new ShuffleVectorInst(getOperand(0), + getOperand(1), + getOperand(2)); + New->SubclassOptionalData = SubclassOptionalData; + return New; } PHINode *PHINode::clone(LLVMContext&) const { - return new PHINode(*this); + PHINode *New = new PHINode(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } ReturnInst *ReturnInst::clone(LLVMContext&) const { - return new(getNumOperands()) ReturnInst(*this); + ReturnInst *New = new(getNumOperands()) ReturnInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } BranchInst *BranchInst::clone(LLVMContext&) const { unsigned Ops(getNumOperands()); - return new(Ops, Ops == 1) BranchInst(*this); + BranchInst *New = new(Ops, Ops == 1) BranchInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } SwitchInst *SwitchInst::clone(LLVMContext&) const { - return new SwitchInst(*this); + SwitchInst *New = new SwitchInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } InvokeInst *InvokeInst::clone(LLVMContext&) const { - return new(getNumOperands()) InvokeInst(*this); + InvokeInst *New = new(getNumOperands()) InvokeInst(*this); + New->SubclassOptionalData = SubclassOptionalData; + return New; } UnwindInst *UnwindInst::clone(LLVMContext &C) const { - return new UnwindInst(C); + UnwindInst *New = new UnwindInst(C); + New->SubclassOptionalData = SubclassOptionalData; + return New; } UnreachableInst *UnreachableInst::clone(LLVMContext &C) const { - return new UnreachableInst(C); + UnreachableInst *New = new UnreachableInst(C); + New->SubclassOptionalData = SubclassOptionalData; + return New; } From devang.patel at gmail.com Tue Aug 25 17:20:27 2009 From: devang.patel at gmail.com (Devang Patel) Date: Tue, 25 Aug 2009 15:20:27 -0700 Subject: [llvm-commits] [llvm] r80038 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instruction.h include/llvm/Instructions.h include/llvm/Value.h lib/Transforms/IPO/MergeFunctions.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/Transfor Message-ID: <352a1fb20908251520h56d65ce7jc48ff889a5aea8ab@mail.gmail.com> On Tue, Aug 25, 2009 at 3:11 PM, Dan Gohman wrote: ============================================================================== > --- llvm/trunk/lib/VMCore/Instruction.cpp (original) > +++ llvm/trunk/lib/VMCore/Instruction.cpp Tue Aug 25 17:11:20 2009 > @@ -168,6 +168,14 @@ > ?/// identical to the current one. ?This means that all operands match and any > ?/// extra information (e.g. load is volatile) agree. > ?bool Instruction::isIdenticalTo(const Instruction *I) const { > + ?return isIdenticalTo(I) && Did you mean isIdenticalToWhenDefined(I) here ? - Devang > + ? ? ? ? SubclassOptionalData == I->SubclassOptionalData; > +} > + > +/// isIdenticalToWenDefined - This is like isIdenticalTo, except that it > +/// ignores the SubclassOptionalData flags, which specify conditions > +/// under which the instruction's result is undefined. > +bool Instruction::isIdenticalToWhenDefined(const Instruction *I) const { > ? if (getOpcode() != I->getOpcode() || > ? ? ? getNumOperands() != I->getNumOperands() || > ? ? ? getType() != I->getType()) > > Modified: llvm/trunk/lib/VMCore/Instructions.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=80038&r1=80037&r2=80038&view=diff > From gohman at apple.com Tue Aug 25 17:24:20 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 22:24:20 -0000 Subject: [llvm-commits] [llvm] r80039 - /llvm/trunk/lib/VMCore/Instruction.cpp Message-ID: <200908252224.n7PMOKOn022600@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 17:24:20 2009 New Revision: 80039 URL: http://llvm.org/viewvc/llvm-project?rev=80039&view=rev Log: This should use isIndenticalToWhenDefined. Modified: llvm/trunk/lib/VMCore/Instruction.cpp Modified: llvm/trunk/lib/VMCore/Instruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instruction.cpp?rev=80039&r1=80038&r2=80039&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instruction.cpp (original) +++ llvm/trunk/lib/VMCore/Instruction.cpp Tue Aug 25 17:24:20 2009 @@ -168,11 +168,11 @@ /// identical to the current one. This means that all operands match and any /// extra information (e.g. load is volatile) agree. bool Instruction::isIdenticalTo(const Instruction *I) const { - return isIdenticalTo(I) && + return isIdenticalToWhenDefined(I) && SubclassOptionalData == I->SubclassOptionalData; } -/// isIdenticalToWenDefined - This is like isIdenticalTo, except that it +/// isIdenticalToWhenDefined - This is like isIdenticalTo, except that it /// ignores the SubclassOptionalData flags, which specify conditions /// under which the instruction's result is undefined. bool Instruction::isIdenticalToWhenDefined(const Instruction *I) const { From gohman at apple.com Tue Aug 25 17:26:00 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 15:26:00 -0700 Subject: [llvm-commits] [llvm] r80038 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instruction.h include/llvm/Instructions.h include/llvm/Value.h lib/Transforms/IPO/MergeFunctions.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/Transfor In-Reply-To: <352a1fb20908251520h56d65ce7jc48ff889a5aea8ab@mail.gmail.com> References: <352a1fb20908251520h56d65ce7jc48ff889a5aea8ab@mail.gmail.com> Message-ID: On Aug 25, 2009, at 3:20 PM, Devang Patel wrote: > On Tue, Aug 25, 2009 at 3:11 PM, Dan Gohman wrote: > = > = > = > = > = > = > = > = > ====================================================================== > >> --- llvm/trunk/lib/VMCore/Instruction.cpp (original) >> >> +++ llvm/trunk/lib/VMCore/Instruction.cpp Tue Aug 25 17:11:20 2009 >> >> @@ -168,6 +168,14 @@ >> >> /// identical to the current one. This means that all operands >> match and any >> >> /// extra information (e.g. load is volatile) agree. >> >> bool Instruction::isIdenticalTo(const Instruction *I) const { >> >> + return isIdenticalTo(I) && >> > > Did you mean isIdenticalToWhenDefined(I) here ? Yes, thanks! Dan From resistor at mac.com Tue Aug 25 17:27:22 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 25 Aug 2009 22:27:22 -0000 Subject: [llvm-commits] [llvm] r80040 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200908252227.n7PMRNxL022987@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 25 17:27:22 2009 New Revision: 80040 URL: http://llvm.org/viewvc/llvm-project?rev=80040&view=rev Log: Get rid of this horrible "benign race" by exploiting ManagedStatic to initialize the array on its first access. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=80040&r1=80039&r2=80040&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 25 17:27:22 2009 @@ -5014,8 +5014,20 @@ AddNodeIDNode(ID, this); } +namespace { + struct EVTArray { + std::vector VTs; + + EVTArray() { + VTs.reserve(MVT::LAST_VALUETYPE); + for (unsigned i = 0; i < MVT::LAST_VALUETYPE; ++i) + VTs.push_back(MVT((MVT::SimpleValueType)i)); + } + }; +} + static ManagedStatic > EVTs; -static EVT VTs[MVT::LAST_VALUETYPE]; +static ManagedStatic SimpleVTArray; static ManagedStatic > VTMutex; /// getValueTypeList - Return a pointer to the specified value type. @@ -5025,12 +5037,7 @@ sys::SmartScopedLock Lock(*VTMutex); return &(*EVTs->insert(VT).first); } else { - // All writes to this location will have the same value, so it's ok - // to race on it. We only need to ensure that at least one write has - // succeeded before we return the pointer into the array. - VTs[VT.getSimpleVT().SimpleTy] = VT; - sys::MemoryFence(); - return VTs + VT.getSimpleVT().SimpleTy; + return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy]; } } From gohman at apple.com Tue Aug 25 17:29:09 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 22:29:09 -0000 Subject: [llvm-commits] [llvm] r80041 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instructions.h lib/VMCore/Instructions.cpp Message-ID: <200908252229.n7PMT9rM023220@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 17:29:08 2009 New Revision: 80041 URL: http://llvm.org/viewvc/llvm-project?rev=80041&view=rev Log: Use covariant return types for Instruction::clone, and eliminate the forms of ExtractElementInst and InsertElementInst that are equivalent to clone. Modified: llvm/trunk/include/llvm/InstrTypes.h llvm/trunk/include/llvm/Instructions.h llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/include/llvm/InstrTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=80041&r1=80040&r2=80041&view=diff ============================================================================== --- llvm/trunk/include/llvm/InstrTypes.h (original) +++ llvm/trunk/include/llvm/InstrTypes.h Tue Aug 25 17:29:08 2009 @@ -53,7 +53,7 @@ virtual void setSuccessorV(unsigned idx, BasicBlock *B) = 0; public: - virtual Instruction *clone(LLVMContext &Context) const = 0; + virtual TerminatorInst *clone(LLVMContext &Context) const = 0; /// getNumSuccessors - Return the number of successors that this terminator /// has. Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=80041&r1=80040&r2=80041&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue Aug 25 17:29:08 2009 @@ -78,7 +78,7 @@ unsigned getAlignment() const { return (1u << SubclassData) >> 1; } void setAlignment(unsigned Align); - virtual Instruction *clone(LLVMContext &Context) const = 0; + virtual AllocationInst *clone(LLVMContext &Context) const = 0; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const AllocationInst *) { return true; } @@ -1276,10 +1276,6 @@ ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd); public: - static ExtractElementInst *Create(const ExtractElementInst &EE) { - return Create(EE.getOperand(0), EE.getOperand(1)); - } - static ExtractElementInst *Create(Value *Vec, Value *Idx, const Twine &NameStr = "", Instruction *InsertBefore = 0) { @@ -1330,9 +1326,6 @@ InsertElementInst(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd); public: - static InsertElementInst *Create(const InsertElementInst &IE) { - return Create(IE.getOperand(0), IE.getOperand(1), IE.getOperand(2)); - } static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr = "", Instruction *InsertBefore = 0) { @@ -2638,7 +2631,7 @@ ); /// @brief Clone an identical TruncInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual TruncInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const TruncInst *) { return true; } @@ -2674,7 +2667,7 @@ ); /// @brief Clone an identical ZExtInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual ZExtInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ZExtInst *) { return true; } @@ -2710,7 +2703,7 @@ ); /// @brief Clone an identical SExtInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual SExtInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SExtInst *) { return true; } @@ -2746,7 +2739,7 @@ ); /// @brief Clone an identical FPTruncInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual FPTruncInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const FPTruncInst *) { return true; } @@ -2782,7 +2775,7 @@ ); /// @brief Clone an identical FPExtInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual FPExtInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const FPExtInst *) { return true; } @@ -2818,7 +2811,7 @@ ); /// @brief Clone an identical UIToFPInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual UIToFPInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const UIToFPInst *) { return true; } @@ -2854,7 +2847,7 @@ ); /// @brief Clone an identical SIToFPInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual SIToFPInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SIToFPInst *) { return true; } @@ -2890,7 +2883,7 @@ ); /// @brief Clone an identical FPToUIInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual FPToUIInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const FPToUIInst *) { return true; } @@ -2926,7 +2919,7 @@ ); /// @brief Clone an identical FPToSIInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual FPToSIInst *clone(LLVMContext &Context) const; /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const FPToSIInst *) { return true; } @@ -2962,7 +2955,7 @@ ); /// @brief Clone an identical IntToPtrInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual IntToPtrInst *clone(LLVMContext &Context) const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const IntToPtrInst *) { return true; } @@ -2998,7 +2991,7 @@ ); /// @brief Clone an identical PtrToIntInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual PtrToIntInst *clone(LLVMContext &Context) const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const PtrToIntInst *) { return true; } @@ -3034,7 +3027,7 @@ ); /// @brief Clone an identical BitCastInst - virtual CastInst *clone(LLVMContext &Context) const; + virtual BitCastInst *clone(LLVMContext &Context) const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BitCastInst *) { return true; } Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=80041&r1=80040&r2=80041&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Aug 25 17:29:08 2009 @@ -2933,73 +2933,73 @@ return New; } -CastInst *TruncInst::clone(LLVMContext&) const { +TruncInst *TruncInst::clone(LLVMContext&) const { TruncInst *New = new TruncInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *ZExtInst::clone(LLVMContext&) const { +ZExtInst *ZExtInst::clone(LLVMContext&) const { ZExtInst *New = new ZExtInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *SExtInst::clone(LLVMContext&) const { +SExtInst *SExtInst::clone(LLVMContext&) const { SExtInst *New = new SExtInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *FPTruncInst::clone(LLVMContext&) const { +FPTruncInst *FPTruncInst::clone(LLVMContext&) const { FPTruncInst *New = new FPTruncInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *FPExtInst::clone(LLVMContext&) const { +FPExtInst *FPExtInst::clone(LLVMContext&) const { FPExtInst *New = new FPExtInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *UIToFPInst::clone(LLVMContext&) const { +UIToFPInst *UIToFPInst::clone(LLVMContext&) const { UIToFPInst *New = new UIToFPInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *SIToFPInst::clone(LLVMContext&) const { +SIToFPInst *SIToFPInst::clone(LLVMContext&) const { SIToFPInst *New = new SIToFPInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *FPToUIInst::clone(LLVMContext&) const { +FPToUIInst *FPToUIInst::clone(LLVMContext&) const { FPToUIInst *New = new FPToUIInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *FPToSIInst::clone(LLVMContext&) const { +FPToSIInst *FPToSIInst::clone(LLVMContext&) const { FPToSIInst *New = new FPToSIInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *PtrToIntInst::clone(LLVMContext&) const { +PtrToIntInst *PtrToIntInst::clone(LLVMContext&) const { PtrToIntInst *New = new PtrToIntInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *IntToPtrInst::clone(LLVMContext&) const { +IntToPtrInst *IntToPtrInst::clone(LLVMContext&) const { IntToPtrInst *New = new IntToPtrInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; } -CastInst *BitCastInst::clone(LLVMContext&) const { +BitCastInst *BitCastInst::clone(LLVMContext&) const { BitCastInst *New = new BitCastInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; return New; From scottm at aero.org Tue Aug 25 17:37:34 2009 From: scottm at aero.org (Scott Michel) Date: Tue, 25 Aug 2009 22:37:34 -0000 Subject: [llvm-commits] [llvm] r80042 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp test/CodeGen/CellSPU/sext128.ll Message-ID: <200908252237.n7PMbYr1024252@zion.cs.uiuc.edu> Author: pingbak Date: Tue Aug 25 17:37:34 2009 New Revision: 80042 URL: http://llvm.org/viewvc/llvm-project?rev=80042&view=rev Log: Updated i128 sext support for CellSPU backend, contributed by Ken Werner (IBM) 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=80042&r1=80041&r2=80042&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Aug 25 17:37:34 2009 @@ -350,7 +350,7 @@ // Custom lower i128 -> i64 truncates setOperationAction(ISD::TRUNCATE, MVT::i64, Custom); - // Custom lower i64 -> i128 sign extend + // Custom lower i32/i64 -> i128 sign extend setOperationAction(ISD::SIGN_EXTEND, MVT::i128, Custom); setOperationAction(ISD::FP_TO_SINT, MVT::i8, Promote); @@ -2610,41 +2610,57 @@ return SDValue(); // Leave the truncate unmolested } -//! Custom lower ISD::SIGN_EXTEND +/*! + * Emit the instruction sequence for i64/i32 -> i128 sign extend. The basic + * algorithm is to duplicate the sign bit using rotmai to generate at + * least one byte full of sign bits. Then propagate the "sign-byte" into + * the leftmost words and the i64/i32 into the rightmost words using shufb. + * + * @param Op The sext operand + * @param DAG The current DAG + * @return The SDValue with the entire instruction sequence + */ static SDValue LowerSIGN_EXTEND(SDValue Op, SelectionDAG &DAG) { - // Type to extend to - EVT VT = Op.getValueType(); DebugLoc dl = Op.getDebugLoc(); + // Type to extend to + MVT OpVT = Op.getValueType().getSimpleVT(); + EVT VecVT = EVT::getVectorVT(*DAG.getContext(), + OpVT, (128 / OpVT.getSizeInBits())); + // Type to extend from SDValue Op0 = Op.getOperand(0); - EVT Op0VT = Op0.getValueType(); + MVT Op0VT = Op0.getValueType().getSimpleVT(); - assert((VT == MVT::i128 && Op0VT == MVT::i64) && + // The type to extend to needs to be a i128 and + // the type to extend from needs to be i64 or i32. + assert((OpVT == MVT::i128 && (Op0VT == MVT::i64 || Op0VT == MVT::i32)) && "LowerSIGN_EXTEND: input and/or output operand have wrong size"); // Create shuffle mask - unsigned mask1 = 0x10101010; // byte 0 - 3 and 4 - 7 - unsigned mask2 = 0x01020304; // byte 8 - 11 - unsigned mask3 = 0x05060708; // byte 12 - 15 + unsigned mask1 = 0x10101010; // byte 0 - 3 and 4 - 7 + unsigned mask2 = Op0VT == MVT::i64 ? 0x00010203 : 0x10101010; // byte 8 - 11 + unsigned mask3 = Op0VT == MVT::i64 ? 0x04050607 : 0x00010203; // byte 12 - 15 SDValue shufMask = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, DAG.getConstant(mask1, MVT::i32), DAG.getConstant(mask1, MVT::i32), DAG.getConstant(mask2, MVT::i32), DAG.getConstant(mask3, MVT::i32)); - // Word wise arithmetic right shift to generate a byte that contains sign bits + // Word wise arithmetic right shift to generate at least one byte + // that contains sign bits. + MVT mvt = Op0VT == MVT::i64 ? MVT::v2i64 : MVT::v4i32; SDValue sraVal = DAG.getNode(ISD::SRA, dl, - MVT::v2i64, - DAG.getNode(SPUISD::PREFSLOT2VEC, dl, MVT::v2i64, Op0, Op0), + mvt, + DAG.getNode(SPUISD::PREFSLOT2VEC, dl, mvt, Op0, Op0), DAG.getConstant(31, MVT::i32)); - // shuffle bytes - copies 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::v2i64, - Op0, sraVal, shufMask); + // 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); 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=80042&r1=80041&r2=80042&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/sext128.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/sext128.ll Tue Aug 25 17:37:34 2009 @@ -6,13 +6,42 @@ define i128 @sext_i64_i128(i64 %a) { entry: + %0 = sext i64 %a to i128 + ret i128 %0 ; CHECK: long 269488144 ; CHECK: long 269488144 -; CHECK: long 16909060 -; CHECK: long 84281096 +; CHECK: long 66051 +; CHECK: long 67438087 ; CHECK: rotmai ; CHECK: lqa ; CHECK: shufb - %0 = sext i64 %a to i128 +} + +define i128 @sext_i32_i128(i32 %a) { +entry: + %0 = sext i32 %a to i128 ret i128 %0 +; CHECK: long 269488144 +; CHECK: long 269488144 +; CHECK: long 269488144 +; CHECK: long 66051 +; CHECK: rotmai +; CHECK: lqa +; CHECK: shufb } + +define i128 @sext_i32_i128a(float %a) { +entry: + %0 = call i32 @myfunc(float %a) + %1 = sext i32 %0 to i128 + ret i128 %1 +; CHECK: long 269488144 +; CHECK: long 269488144 +; CHECK: long 269488144 +; CHECK: long 66051 +; CHECK: rotmai +; CHECK: lqa +; CHECK: shufb +} + +declare i32 @myfunc(float) From ggreif at gmail.com Tue Aug 25 18:02:22 2009 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 25 Aug 2009 23:02:22 -0000 Subject: [llvm-commits] [llvm] r80048 - in /llvm/trunk: CMakeLists.txt autoconf/configure.ac include/llvm/Config/config.h.cmake Message-ID: <200908252302.n7PN2MBN027449@zion.cs.uiuc.edu> Author: ggreif Date: Tue Aug 25 18:02:21 2009 New Revision: 80048 URL: http://llvm.org/viewvc/llvm-project?rev=80048&view=rev Log: revert r78628 and r78803 as these are not needed any more Modified: llvm/trunk/CMakeLists.txt llvm/trunk/autoconf/configure.ac llvm/trunk/include/llvm/Config/config.h.cmake Modified: llvm/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=80048&r1=80047&r2=80048&view=diff ============================================================================== --- llvm/trunk/CMakeLists.txt (original) +++ llvm/trunk/CMakeLists.txt Tue Aug 25 18:02:21 2009 @@ -94,12 +94,6 @@ endif() endif() -if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS ) - set( LLVM_COMPACT_SENTINELS 1 ) -else( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS ) - set( LLVM_COMPACT_SENTINELS 0 ) -endif( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS ) - if( LLVM_TARGETS_TO_BUILD STREQUAL "all" ) set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} ) endif() Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=80048&r1=80047&r2=80048&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Aug 25 18:02:21 2009 @@ -361,17 +361,6 @@ AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]]) fi -dnl LLVM_COMPACT_SENTINELS : can be used to shrink ilist's end iterators and disable certain checks on them: -if test ${ENABLE_OPTIMIZED},${DISABLE_ASSERTIONS} = "ENABLE_OPTIMIZED=1,DISABLE_ASSERTIONS=1" ; then - AC_SUBST(LLVM_COMPACT_SENTINELS,[1]) -else - AC_SUBST(LLVM_COMPACT_SENTINELS,[0]) -fi - -AC_DEFINE_UNQUOTED([LLVM_COMPACT_SENTINELS],$LLVM_COMPACT_SENTINELS, - [Define to 1 for ilist sentinel compaction]) - - dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks: AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING( --enable-expensive-checks,[Compile with expensive debug checks enabled (default is NO)]),, enableval="no") Modified: llvm/trunk/include/llvm/Config/config.h.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=80048&r1=80047&r2=80048&view=diff ============================================================================== --- llvm/trunk/include/llvm/Config/config.h.cmake (original) +++ llvm/trunk/include/llvm/Config/config.h.cmake Tue Aug 25 18:02:21 2009 @@ -425,9 +425,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H} -/* Define to 1 for ilist sentinel compaction */ -#cmakedefine LLVM_COMPACT_SENTINELS ${LLVM_COMPACT_SENTINELS} - /* Installation directory for binary executables */ #undef LLVM_BINDIR From gohman at apple.com Tue Aug 25 18:17:54 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 23:17:54 -0000 Subject: [llvm-commits] [llvm] r80049 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instructions.h include/llvm/Support/IRBuilder.h lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/Transforms/Scalar/CodeGenPrepare.cpp lib/Transforms/Scalar/GVNPRE.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/Transforms/Utils/LowerSwitch.cpp lib/VMCore/Instructions.cpp Message-ID: <200908252317.n7PNHtIx029387@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 18:17:54 2009 New Revision: 80049 URL: http://llvm.org/viewvc/llvm-project?rev=80049&view=rev Log: Eliminate the unused Context argument on one of the ICmpInst and FCmpInst constructors. Modified: llvm/trunk/include/llvm/InstrTypes.h llvm/trunk/include/llvm/Instructions.h llvm/trunk/include/llvm/Support/IRBuilder.h llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/include/llvm/InstrTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/include/llvm/InstrTypes.h (original) +++ llvm/trunk/include/llvm/InstrTypes.h Tue Aug 25 18:17:54 2009 @@ -606,7 +606,7 @@ /// instruction into a BasicBlock right before the specified instruction. /// The specified Instruction is allowed to be a dereferenced end iterator. /// @brief Create a CmpInst - static CmpInst *Create(LLVMContext &Context, OtherOps Op, + static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const Twine &Name = "", Instruction *InsertBefore = 0); Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue Aug 25 18:17:54 2009 @@ -696,7 +696,6 @@ /// @brief Constructor with no-insertion semantics ICmpInst( - LLVMContext &Context, ///< Context to construct within Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression @@ -867,7 +866,6 @@ /// @brief Constructor with no-insertion semantics FCmpInst( - LLVMContext &Context, ///< Context to build in Predicate pred, ///< The predicate to use for the comparison Value *LHS, ///< The left-hand-side of the expression Value *RHS, ///< The right-hand-side of the expression Modified: llvm/trunk/include/llvm/Support/IRBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/IRBuilder.h (original) +++ llvm/trunk/include/llvm/Support/IRBuilder.h Tue Aug 25 18:17:54 2009 @@ -744,14 +744,14 @@ if (Constant *LC = dyn_cast(LHS)) if (Constant *RC = dyn_cast(RHS)) return Folder.CreateICmp(P, LC, RC); - return Insert(new ICmpInst(Context, P, LHS, RHS), Name); + return Insert(new ICmpInst(P, LHS, RHS), Name); } Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, const Twine &Name = "") { if (Constant *LC = dyn_cast(LHS)) if (Constant *RC = dyn_cast(RHS)) return Folder.CreateFCmp(P, LC, RC); - return Insert(new FCmpInst(Context, P, LHS, RHS), Name); + return Insert(new FCmpInst(P, LHS, RHS), Name); } //===--------------------------------------------------------------------===// Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Aug 25 18:17:54 2009 @@ -3089,13 +3089,13 @@ if (Opc == Instruction::FCmp) { if (!LHS->getType()->isFPOrFPVector()) return Error(Loc, "fcmp requires floating point operands"); - Inst = new FCmpInst(Context, CmpInst::Predicate(Pred), LHS, RHS); + Inst = new FCmpInst(CmpInst::Predicate(Pred), LHS, RHS); } else { assert(Opc == Instruction::ICmp && "Unknown opcode for CmpInst!"); if (!LHS->getType()->isIntOrIntVector() && !isa(LHS->getType())) return Error(Loc, "icmp requires integer operands"); - Inst = new ICmpInst(Context, CmpInst::Predicate(Pred), LHS, RHS); + Inst = new ICmpInst(CmpInst::Predicate(Pred), LHS, RHS); } return false; } Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Aug 25 18:17:54 2009 @@ -1781,9 +1781,9 @@ return Error("Invalid CMP record"); if (LHS->getType()->isFPOrFPVector()) - I = new FCmpInst(Context, (FCmpInst::Predicate)Record[OpNum], LHS, RHS); + I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); else - I = new ICmpInst(Context, (ICmpInst::Predicate)Record[OpNum], LHS, RHS); + I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); break; } Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Tue Aug 25 18:17:54 2009 @@ -519,7 +519,7 @@ BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI(); InsertedCmp = - CmpInst::Create(DefBB->getContext(), CI->getOpcode(), + CmpInst::Create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0), CI->getOperand(1), "", InsertPt); MadeChange = true; Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Aug 25 18:17:54 2009 @@ -864,7 +864,7 @@ newOp1, newOp2, BO->getName()+".expr"); else if (CmpInst* C = dyn_cast(U)) - newVal = CmpInst::Create(Context, C->getOpcode(), + newVal = CmpInst::Create(C->getOpcode(), C->getPredicate(), newOp1, newOp2, C->getName()+".expr"); @@ -1684,7 +1684,7 @@ BO->getName()+".gvnpre", (*PI)->getTerminator()); else if (CmpInst* C = dyn_cast(U)) - newVal = CmpInst::Create(Context, C->getOpcode(), + newVal = CmpInst::Create(C->getOpcode(), C->getPredicate(), s1, s2, C->getName()+".gvnpre", (*PI)->getTerminator()); Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Aug 25 18:17:54 2009 @@ -1893,7 +1893,7 @@ if (BinaryOperator *BO = dyn_cast(&I)) New = BinaryOperator::Create(BO->getOpcode(), Op0, Op1,SO->getName()+".op"); else if (CmpInst *CI = dyn_cast(&I)) - New = CmpInst::Create(*Context, CI->getOpcode(), CI->getPredicate(), + New = CmpInst::Create(CI->getOpcode(), CI->getPredicate(), Op0, Op1, SO->getName()+".cmp"); else { llvm_unreachable("Unknown binary instruction type!"); @@ -1982,7 +1982,7 @@ PN->getIncomingValue(i), C, "phitmp", NonConstBB->getTerminator()); else if (CmpInst *CI = dyn_cast(&I)) - InV = CmpInst::Create(*Context, CI->getOpcode(), + InV = CmpInst::Create(CI->getOpcode(), CI->getPredicate(), PN->getIncomingValue(i), C, "phitmp", NonConstBB->getTerminator()); @@ -3006,8 +3006,7 @@ // X udiv C, where C >= signbit if (C->getValue().isNegative()) { - Value *IC = InsertNewInstBefore(new ICmpInst(*Context, - ICmpInst::ICMP_ULT, Op0, C), + Value *IC = InsertNewInstBefore(new ICmpInst(ICmpInst::ICMP_ULT, Op0, C), I); return SelectInst::Create(IC, Constant::getNullValue(I.getType()), ConstantInt::get(I.getType(), 1)); @@ -3388,26 +3387,26 @@ case 0: return ConstantInt::getFalse(*Context); case 1: if (sign) - return new ICmpInst(*Context, ICmpInst::ICMP_SGT, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_SGT, LHS, RHS); else - return new ICmpInst(*Context, ICmpInst::ICMP_UGT, LHS, RHS); - case 2: return new ICmpInst(*Context, ICmpInst::ICMP_EQ, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_UGT, LHS, RHS); + case 2: return new ICmpInst(ICmpInst::ICMP_EQ, LHS, RHS); case 3: if (sign) - return new ICmpInst(*Context, ICmpInst::ICMP_SGE, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_SGE, LHS, RHS); else - return new ICmpInst(*Context, ICmpInst::ICMP_UGE, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_UGE, LHS, RHS); case 4: if (sign) - return new ICmpInst(*Context, ICmpInst::ICMP_SLT, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_SLT, LHS, RHS); else - return new ICmpInst(*Context, ICmpInst::ICMP_ULT, LHS, RHS); - case 5: return new ICmpInst(*Context, ICmpInst::ICMP_NE, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_ULT, LHS, RHS); + case 5: return new ICmpInst(ICmpInst::ICMP_NE, LHS, RHS); case 6: if (sign) - return new ICmpInst(*Context, ICmpInst::ICMP_SLE, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_SLE, LHS, RHS); else - return new ICmpInst(*Context, ICmpInst::ICMP_ULE, LHS, RHS); + return new ICmpInst(ICmpInst::ICMP_ULE, LHS, RHS); case 7: return ConstantInt::getTrue(*Context); } } @@ -3421,39 +3420,39 @@ default: llvm_unreachable("Illegal FCmp code!"); case 0: if (isordered) - return new FCmpInst(*Context, FCmpInst::FCMP_ORD, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_ORD, LHS, RHS); else - return new FCmpInst(*Context, FCmpInst::FCMP_UNO, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_UNO, LHS, RHS); case 1: if (isordered) - return new FCmpInst(*Context, FCmpInst::FCMP_OGT, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_OGT, LHS, RHS); else - return new FCmpInst(*Context, FCmpInst::FCMP_UGT, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_UGT, LHS, RHS); case 2: if (isordered) - return new FCmpInst(*Context, FCmpInst::FCMP_OEQ, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_OEQ, LHS, RHS); else - return new FCmpInst(*Context, FCmpInst::FCMP_UEQ, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_UEQ, LHS, RHS); case 3: if (isordered) - return new FCmpInst(*Context, FCmpInst::FCMP_OGE, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_OGE, LHS, RHS); else - return new FCmpInst(*Context, FCmpInst::FCMP_UGE, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_UGE, LHS, RHS); case 4: if (isordered) - return new FCmpInst(*Context, FCmpInst::FCMP_OLT, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_OLT, LHS, RHS); else - return new FCmpInst(*Context, FCmpInst::FCMP_ULT, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_ULT, LHS, RHS); case 5: if (isordered) - return new FCmpInst(*Context, FCmpInst::FCMP_ONE, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_ONE, LHS, RHS); else - return new FCmpInst(*Context, FCmpInst::FCMP_UNE, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_UNE, LHS, RHS); case 6: if (isordered) - return new FCmpInst(*Context, FCmpInst::FCMP_OLE, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_OLE, LHS, RHS); else - return new FCmpInst(*Context, FCmpInst::FCMP_ULE, LHS, RHS); + return new FCmpInst(FCmpInst::FCMP_ULE, LHS, RHS); case 7: return ConstantInt::getTrue(*Context); } } @@ -3658,13 +3657,13 @@ if (Inside) { if (Lo == Hi) // Trivially false. - return new ICmpInst(*Context, ICmpInst::ICMP_NE, V, V); + return new ICmpInst(ICmpInst::ICMP_NE, V, V); // V >= Min && V < Hi --> V < Hi if (cast(Lo)->isMinValue(isSigned)) { ICmpInst::Predicate pred = (isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT); - return new ICmpInst(*Context, pred, V, Hi); + return new ICmpInst(pred, V, Hi); } // Emit V-Lo getName()+".off"); InsertNewInstBefore(Add, IB); Constant *UpperBound = ConstantExpr::getAdd(NegLo, Hi); - return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Add, UpperBound); + return new ICmpInst(ICmpInst::ICMP_ULT, Add, UpperBound); } if (Lo == Hi) // Trivially true. - return new ICmpInst(*Context, ICmpInst::ICMP_EQ, V, V); + return new ICmpInst(ICmpInst::ICMP_EQ, V, V); // V < Min || V >= Hi -> V > Hi-1 Hi = SubOne(cast(Hi)); if (cast(Lo)->isMinValue(isSigned)) { ICmpInst::Predicate pred = (isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT); - return new ICmpInst(*Context, pred, V, Hi); + return new ICmpInst(pred, V, Hi); } // Emit V-Lo >u Hi-1-Lo @@ -3692,7 +3691,7 @@ Instruction *Add = BinaryOperator::CreateAdd(V, NegLo, V->getName()+".off"); InsertNewInstBefore(Add, IB); Constant *LowerBound = ConstantExpr::getAdd(NegLo, Hi); - return new ICmpInst(*Context, ICmpInst::ICMP_UGT, Add, LowerBound); + return new ICmpInst(ICmpInst::ICMP_UGT, Add, LowerBound); } // isRunOfOnes - Returns true iff Val consists of one contiguous run of 1s with @@ -3790,7 +3789,7 @@ LHSCst->getValue().isPowerOf2()) { Instruction *NewOr = BinaryOperator::CreateOr(Val, Val2); InsertNewInstBefore(NewOr, I); - return new ICmpInst(*Context, LHSCC, NewOr, LHSCst); + return new ICmpInst(LHSCC, NewOr, LHSCst); } // From here on, we only handle: @@ -3850,11 +3849,11 @@ default: llvm_unreachable("Unknown integer condition code!"); case ICmpInst::ICMP_ULT: if (LHSCst == SubOne(RHSCst)) // (X != 13 & X u< 14) -> X < 13 - return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Val, LHSCst); + return new ICmpInst(ICmpInst::ICMP_ULT, Val, LHSCst); break; // (X != 13 & X u< 15) -> no change case ICmpInst::ICMP_SLT: if (LHSCst == SubOne(RHSCst)) // (X != 13 & X s< 14) -> X < 13 - return new ICmpInst(*Context, ICmpInst::ICMP_SLT, Val, LHSCst); + return new ICmpInst(ICmpInst::ICMP_SLT, Val, LHSCst); break; // (X != 13 & X s< 15) -> no change case ICmpInst::ICMP_EQ: // (X != 13 & X == 15) -> X == 15 case ICmpInst::ICMP_UGT: // (X != 13 & X u> 15) -> X u> 15 @@ -3866,7 +3865,7 @@ Instruction *Add = BinaryOperator::CreateAdd(Val, AddCST, Val->getName()+".off"); InsertNewInstBefore(Add, I); - return new ICmpInst(*Context, ICmpInst::ICMP_UGT, Add, + return new ICmpInst(ICmpInst::ICMP_UGT, Add, ConstantInt::get(Add->getType(), 1)); } break; // (X != 13 & X != 15) -> no change @@ -3912,7 +3911,7 @@ break; case ICmpInst::ICMP_NE: if (RHSCst == AddOne(LHSCst)) // (X u> 13 & X != 14) -> X u> 14 - return new ICmpInst(*Context, LHSCC, Val, RHSCst); + return new ICmpInst(LHSCC, Val, RHSCst); break; // (X u> 13 & X != 15) -> no change case ICmpInst::ICMP_ULT: // (X u> 13 & X u< 15) -> (X-14) 13 & X != 14) -> X s> 14 - return new ICmpInst(*Context, LHSCC, Val, RHSCst); + return new ICmpInst(LHSCC, Val, RHSCst); break; // (X s> 13 & X != 15) -> no change case ICmpInst::ICMP_SLT: // (X s> 13 & X s< 15) -> (X-14) s< 1 return InsertRangeTest(Val, AddOne(LHSCst), @@ -3957,7 +3956,7 @@ // false. if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN()) return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); - return new FCmpInst(*Context, FCmpInst::FCMP_ORD, + return new FCmpInst(FCmpInst::FCMP_ORD, LHS->getOperand(0), RHS->getOperand(0)); } @@ -3965,7 +3964,7 @@ // "fcmp ord x,x" is "fcmp ord x, 0". if (isa(LHS->getOperand(1)) && isa(RHS->getOperand(1))) - return new FCmpInst(*Context, FCmpInst::FCMP_ORD, + return new FCmpInst(FCmpInst::FCMP_ORD, LHS->getOperand(0), RHS->getOperand(0)); return 0; } @@ -3984,7 +3983,7 @@ if (Op0LHS == Op1LHS && Op0RHS == Op1RHS) { // Simplify (fcmp cc0 x, y) & (fcmp cc1 x, y). if (Op0CC == Op1CC) - return new FCmpInst(*Context, (FCmpInst::Predicate)Op0CC, Op0LHS, Op0RHS); + return new FCmpInst((FCmpInst::Predicate)Op0CC, Op0LHS, Op0RHS); if (Op0CC == FCmpInst::FCMP_FALSE || Op1CC == FCmpInst::FCMP_FALSE) return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); @@ -4119,7 +4118,7 @@ // (1 << x) & 1 --> zext(x == 0) // (1 >> x) & 1 --> zext(x == 0) if (AndRHSMask == 1 && Op0LHS == AndRHS) { - Instruction *NewICmp = new ICmpInst(*Context, ICmpInst::ICMP_EQ, + Instruction *NewICmp = new ICmpInst(ICmpInst::ICMP_EQ, Op0RHS, Constant::getNullValue(I.getType())); InsertNewInstBefore(NewICmp, I); return new ZExtInst(NewICmp, I.getType()); @@ -4550,7 +4549,7 @@ Val->getName()+".off"); InsertNewInstBefore(Add, I); AddCST = ConstantExpr::getSub(AddOne(RHSCst), LHSCst); - return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Add, AddCST); + return new ICmpInst(ICmpInst::ICMP_ULT, Add, AddCST); } break; // (X == 13 | X == 15) -> no change case ICmpInst::ICMP_UGT: // (X == 13 | X u> 14) -> no change @@ -4665,7 +4664,7 @@ // Otherwise, no need to compare the two constants, compare the // rest. - return new FCmpInst(*Context, FCmpInst::FCMP_UNO, + return new FCmpInst(FCmpInst::FCMP_UNO, LHS->getOperand(0), RHS->getOperand(0)); } @@ -4673,7 +4672,7 @@ // "fcmp uno x,x" is "fcmp uno x, 0". if (isa(LHS->getOperand(1)) && isa(RHS->getOperand(1))) - return new FCmpInst(*Context, FCmpInst::FCMP_UNO, + return new FCmpInst(FCmpInst::FCMP_UNO, LHS->getOperand(0), RHS->getOperand(0)); return 0; @@ -4691,7 +4690,7 @@ if (Op0LHS == Op1LHS && Op0RHS == Op1RHS) { // Simplify (fcmp cc0 x, y) | (fcmp cc1 x, y). if (Op0CC == Op1CC) - return new FCmpInst(*Context, (FCmpInst::Predicate)Op0CC, + return new FCmpInst((FCmpInst::Predicate)Op0CC, Op0LHS, Op0RHS); if (Op0CC == FCmpInst::FCMP_TRUE || Op1CC == FCmpInst::FCMP_TRUE) return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); @@ -5083,11 +5082,11 @@ if (RHS == ConstantInt::getTrue(*Context) && Op0->hasOneUse()) { // xor (cmp A, B), true = not (cmp A, B) = !cmp A, B if (ICmpInst *ICI = dyn_cast(Op0)) - return new ICmpInst(*Context, ICI->getInversePredicate(), + return new ICmpInst(ICI->getInversePredicate(), ICI->getOperand(0), ICI->getOperand(1)); if (FCmpInst *FCI = dyn_cast(Op0)) - return new FCmpInst(*Context, FCI->getInversePredicate(), + return new FCmpInst(FCI->getInversePredicate(), FCI->getOperand(0), FCI->getOperand(1)); } @@ -5101,7 +5100,6 @@ ConstantInt::getTrue(*Context), Op0C->getDestTy())) { Instruction *NewCI = InsertNewInstBefore(CmpInst::Create( - *Context, CI->getOpcode(), CI->getInversePredicate(), CI->getOperand(0), CI->getOperand(1)), I); NewCI->takeName(CI); @@ -5596,7 +5594,7 @@ // If not, synthesize the offset the hard way. if (Offset == 0) Offset = EmitGEPOffset(GEPLHS, I, *this); - return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), Offset, + return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset, Constant::getNullValue(Offset->getType())); } else if (GEPOperator *GEPRHS = dyn_cast(RHS)) { // If the base pointers are different, but the indices are the same, just @@ -5614,7 +5612,7 @@ // If all indices are the same, just compare the base pointers. if (IndicesTheSame) - return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), + return new ICmpInst(ICmpInst::getSignedPredicate(Cond), GEPLHS->getOperand(0), GEPRHS->getOperand(0)); // Otherwise, the base pointers are different and the indices are @@ -5671,8 +5669,7 @@ Value *LHSV = GEPLHS->getOperand(DiffOperand); Value *RHSV = GEPRHS->getOperand(DiffOperand); // Make sure we do a signed comparison here. - return new ICmpInst(*Context, - ICmpInst::getSignedPredicate(Cond), LHSV, RHSV); + return new ICmpInst(ICmpInst::getSignedPredicate(Cond), LHSV, RHSV); } } @@ -5684,7 +5681,7 @@ // ((gep Ptr, OFFSET1) cmp (gep Ptr, OFFSET2) ---> (OFFSET1 cmp OFFSET2) Value *L = EmitGEPOffset(GEPLHS, I, *this); Value *R = EmitGEPOffset(GEPRHS, I, *this); - return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), L, R); + return new ICmpInst(ICmpInst::getSignedPredicate(Cond), L, R); } } return 0; @@ -5879,7 +5876,7 @@ // Lower this FP comparison into an appropriate integer version of the // comparison. - return new ICmpInst(*Context, Pred, LHSI->getOperand(0), RHSInt); + return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt); } Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) { @@ -5967,14 +5964,14 @@ // Fold the known value into the constant operand. Op1 = ConstantExpr::getCompare(I.getPredicate(), C, RHSC); // Insert a new FCmp of the other select operand. - Op2 = InsertNewInstBefore(new FCmpInst(*Context, I.getPredicate(), + Op2 = InsertNewInstBefore(new FCmpInst(I.getPredicate(), LHSI->getOperand(2), RHSC, I.getName()), I); } else if (Constant *C = dyn_cast(LHSI->getOperand(2))) { // Fold the known value into the constant operand. Op2 = ConstantExpr::getCompare(I.getPredicate(), C, RHSC); // Insert a new FCmp of the other select operand. - Op1 = InsertNewInstBefore(new FCmpInst(*Context, I.getPredicate(), + Op1 = InsertNewInstBefore(new FCmpInst(I.getPredicate(), LHSI->getOperand(1), RHSC, I.getName()), I); } @@ -6074,7 +6071,7 @@ if (I.isEquality() && CI->isNullValue() && match(Op0, m_Sub(m_Value(A), m_Value(B)))) { // (icmp cond A B) if cond is equality - return new ICmpInst(*Context, I.getPredicate(), A, B); + return new ICmpInst(I.getPredicate(), A, B); } // If we have an icmp le or icmp ge instruction, turn it into the @@ -6085,22 +6082,22 @@ case ICmpInst::ICMP_ULE: if (CI->isMaxValue(false)) // A <=u MAX -> TRUE return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); - return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Op0, + return new ICmpInst(ICmpInst::ICMP_ULT, Op0, AddOne(CI)); case ICmpInst::ICMP_SLE: if (CI->isMaxValue(true)) // A <=s MAX -> TRUE return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); - return new ICmpInst(*Context, ICmpInst::ICMP_SLT, Op0, + return new ICmpInst(ICmpInst::ICMP_SLT, Op0, AddOne(CI)); case ICmpInst::ICMP_UGE: if (CI->isMinValue(false)) // A >=u MIN -> TRUE return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); - return new ICmpInst(*Context, ICmpInst::ICMP_UGT, Op0, + return new ICmpInst(ICmpInst::ICMP_UGT, Op0, SubOne(CI)); case ICmpInst::ICMP_SGE: if (CI->isMinValue(true)) // A >=s MIN -> TRUE return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); - return new ICmpInst(*Context, ICmpInst::ICMP_SGT, Op0, + return new ICmpInst(ICmpInst::ICMP_SGT, Op0, SubOne(CI)); } @@ -6147,10 +6144,10 @@ // figured out that the LHS is a constant. Just constant fold this now so // that code below can assume that Min != Max. if (!isa(Op0) && Op0Min == Op0Max) - return new ICmpInst(*Context, I.getPredicate(), + return new ICmpInst(I.getPredicate(), ConstantInt::get(*Context, Op0Min), Op1); if (!isa(Op1) && Op1Min == Op1Max) - return new ICmpInst(*Context, I.getPredicate(), Op0, + return new ICmpInst(I.getPredicate(), Op0, ConstantInt::get(*Context, Op1Min)); // Based on the range information we know about the LHS, see if we can @@ -6171,15 +6168,15 @@ if (Op0Min.uge(Op1Max)) // A false if min(A) >= max(B) return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); if (Op1Min == Op0Max) // A A != B if max(A) == min(B) - return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); + return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); if (ConstantInt *CI = dyn_cast(Op1)) { if (Op1Max == Op0Min+1) // A A == C-1 if min(A)+1 == C - return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, + return new ICmpInst(ICmpInst::ICMP_EQ, Op0, SubOne(CI)); // (x (x >s -1) -> true if sign bit clear if (CI->isMinValue(true)) - return new ICmpInst(*Context, ICmpInst::ICMP_SGT, Op0, + return new ICmpInst(ICmpInst::ICMP_SGT, Op0, Constant::getAllOnesValue(Op0->getType())); } break; @@ -6190,15 +6187,15 @@ return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); if (Op1Max == Op0Min) // A >u B -> A != B if min(A) == max(B) - return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); + return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); if (ConstantInt *CI = dyn_cast(Op1)) { if (Op1Min == Op0Max-1) // A >u C -> A == C+1 if max(a)-1 == C - return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, + return new ICmpInst(ICmpInst::ICMP_EQ, Op0, AddOne(CI)); // (x >u 2147483647) -> (x true if sign bit set if (CI->isMaxValue(true)) - return new ICmpInst(*Context, ICmpInst::ICMP_SLT, Op0, + return new ICmpInst(ICmpInst::ICMP_SLT, Op0, Constant::getNullValue(Op0->getType())); } break; @@ -6208,10 +6205,10 @@ if (Op0Min.sge(Op1Max)) // A false if min(A) >= max(C) return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); if (Op1Min == Op0Max) // A A != B if max(A) == min(B) - return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); + return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); if (ConstantInt *CI = dyn_cast(Op1)) { if (Op1Max == Op0Min+1) // A A == C-1 if min(A)+1 == C - return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, + return new ICmpInst(ICmpInst::ICMP_EQ, Op0, SubOne(CI)); } break; @@ -6222,10 +6219,10 @@ return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); if (Op1Max == Op0Min) // A >s B -> A != B if min(A) == max(B) - return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); + return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); if (ConstantInt *CI = dyn_cast(Op1)) { if (Op1Min == Op0Max-1) // A >s C -> A == C+1 if max(A)-1 == C - return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, + return new ICmpInst(ICmpInst::ICMP_EQ, Op0, AddOne(CI)); } break; @@ -6264,7 +6261,7 @@ if (I.isSignedPredicate() && ((Op0KnownZero.isNegative() && Op1KnownZero.isNegative()) || (Op0KnownOne.isNegative() && Op1KnownOne.isNegative()))) - return new ICmpInst(*Context, I.getUnsignedPredicate(), Op0, Op1); + return new ICmpInst(I.getUnsignedPredicate(), Op0, Op1); } // Test if the ICmpInst instruction is used exclusively by a select as @@ -6306,7 +6303,7 @@ break; } if (isAllZeros) - return new ICmpInst(*Context, I.getPredicate(), LHSI->getOperand(0), + return new ICmpInst(I.getPredicate(), LHSI->getOperand(0), Constant::getNullValue(LHSI->getOperand(0)->getType())); } break; @@ -6329,14 +6326,14 @@ // Fold the known value into the constant operand. Op1 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC); // Insert a new ICmp of the other select operand. - Op2 = InsertNewInstBefore(new ICmpInst(*Context, I.getPredicate(), + Op2 = InsertNewInstBefore(new ICmpInst(I.getPredicate(), LHSI->getOperand(2), RHSC, I.getName()), I); } else if (Constant *C = dyn_cast(LHSI->getOperand(2))) { // Fold the known value into the constant operand. Op2 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC); // Insert a new ICmp of the other select operand. - Op1 = InsertNewInstBefore(new ICmpInst(*Context, I.getPredicate(), + Op1 = InsertNewInstBefore(new ICmpInst(I.getPredicate(), LHSI->getOperand(1), RHSC, I.getName()), I); } @@ -6391,7 +6388,7 @@ Op1 = InsertBitCastBefore(Op1, Op0->getType(), I); } } - return new ICmpInst(*Context, I.getPredicate(), Op0, Op1); + return new ICmpInst(I.getPredicate(), Op0, Op1); } } @@ -6418,7 +6415,7 @@ case Instruction::Sub: case Instruction::Xor: if (I.isEquality()) // a+x icmp eq/ne b+x --> a icmp b - return new ICmpInst(*Context, I.getPredicate(), Op0I->getOperand(0), + return new ICmpInst(I.getPredicate(), Op0I->getOperand(0), Op1I->getOperand(0)); // icmp u/s (a ^ signbit), (b ^ signbit) --> icmp s/u a, b if (ConstantInt *CI = dyn_cast(Op0I->getOperand(1))) { @@ -6426,7 +6423,7 @@ ICmpInst::Predicate Pred = I.isSignedPredicate() ? I.getUnsignedPredicate() : I.getSignedPredicate(); - return new ICmpInst(*Context, Pred, Op0I->getOperand(0), + return new ICmpInst(Pred, Op0I->getOperand(0), Op1I->getOperand(0)); } @@ -6435,7 +6432,7 @@ ? I.getUnsignedPredicate() : I.getSignedPredicate(); Pred = I.getSwappedPredicate(Pred); - return new ICmpInst(*Context, Pred, Op0I->getOperand(0), + return new ICmpInst(Pred, Op0I->getOperand(0), Op1I->getOperand(0)); } } @@ -6459,7 +6456,7 @@ Mask); InsertNewInstBefore(And1, I); InsertNewInstBefore(And2, I); - return new ICmpInst(*Context, I.getPredicate(), And1, And2); + return new ICmpInst(I.getPredicate(), And1, And2); } } break; @@ -6472,7 +6469,7 @@ { Value *A, *B; if (match(Op0, m_Not(m_Value(A))) && match(Op1, m_Not(m_Value(B)))) - return new ICmpInst(*Context, I.getPredicate(), B, A); + return new ICmpInst(I.getPredicate(), B, A); } if (I.isEquality()) { @@ -6481,12 +6478,12 @@ // -x == -y --> x == y if (match(Op0, m_Neg(m_Value(A))) && match(Op1, m_Neg(m_Value(B)))) - return new ICmpInst(*Context, I.getPredicate(), A, B); + return new ICmpInst(I.getPredicate(), A, B); if (match(Op0, m_Xor(m_Value(A), m_Value(B)))) { if (A == Op1 || B == Op1) { // (A^B) == A -> B == 0 Value *OtherVal = A == Op1 ? B : A; - return new ICmpInst(*Context, I.getPredicate(), OtherVal, + return new ICmpInst(I.getPredicate(), OtherVal, Constant::getNullValue(A->getType())); } @@ -6498,15 +6495,15 @@ Constant *NC = ConstantInt::get(*Context, C1->getValue() ^ C2->getValue()); Instruction *Xor = BinaryOperator::CreateXor(C, NC, "tmp"); - return new ICmpInst(*Context, I.getPredicate(), A, + return new ICmpInst(I.getPredicate(), A, InsertNewInstBefore(Xor, I)); } // A^B == A^D -> B == D - if (A == C) return new ICmpInst(*Context, I.getPredicate(), B, D); - if (A == D) return new ICmpInst(*Context, I.getPredicate(), B, C); - if (B == C) return new ICmpInst(*Context, I.getPredicate(), A, D); - if (B == D) return new ICmpInst(*Context, I.getPredicate(), A, C); + if (A == C) return new ICmpInst(I.getPredicate(), B, D); + if (A == D) return new ICmpInst(I.getPredicate(), B, C); + if (B == C) return new ICmpInst(I.getPredicate(), A, D); + if (B == D) return new ICmpInst(I.getPredicate(), A, C); } } @@ -6514,18 +6511,18 @@ (A == Op0 || B == Op0)) { // A == (A^B) -> B == 0 Value *OtherVal = A == Op0 ? B : A; - return new ICmpInst(*Context, I.getPredicate(), OtherVal, + return new ICmpInst(I.getPredicate(), OtherVal, Constant::getNullValue(A->getType())); } // (A-B) == A -> B == 0 if (match(Op0, m_Sub(m_Specific(Op1), m_Value(B)))) - return new ICmpInst(*Context, I.getPredicate(), B, + return new ICmpInst(I.getPredicate(), B, Constant::getNullValue(B->getType())); // A == (A-B) -> B == 0 if (match(Op1, m_Sub(m_Specific(Op0), m_Value(B)))) - return new ICmpInst(*Context, I.getPredicate(), B, + return new ICmpInst(I.getPredicate(), B, Constant::getNullValue(B->getType())); // (X&Z) == (Y&Z) -> (X^Y) & Z == 0 @@ -6669,10 +6666,10 @@ if (LoOverflow && HiOverflow) return ReplaceInstUsesWith(ICI, ConstantInt::getFalse(*Context)); else if (HiOverflow) - return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SGE : + return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE, X, LoBound); else if (LoOverflow) - return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SLT : + return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, X, HiBound); else return InsertRangeTest(X, LoBound, HiBound, DivIsSigned, true, ICI); @@ -6680,10 +6677,10 @@ if (LoOverflow && HiOverflow) return ReplaceInstUsesWith(ICI, ConstantInt::getTrue(*Context)); else if (HiOverflow) - return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SLT : + return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, X, LoBound); else if (LoOverflow) - return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SGE : + return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE, X, HiBound); else return InsertRangeTest(X, LoBound, HiBound, DivIsSigned, false, ICI); @@ -6693,7 +6690,7 @@ return ReplaceInstUsesWith(ICI, ConstantInt::getTrue(*Context)); if (LoOverflow == -1) // Low bound is less than input range. return ReplaceInstUsesWith(ICI, ConstantInt::getFalse(*Context)); - return new ICmpInst(*Context, Pred, X, LoBound); + return new ICmpInst(Pred, X, LoBound); case ICmpInst::ICMP_UGT: case ICmpInst::ICMP_SGT: if (HiOverflow == +1) // High bound greater than input range. @@ -6701,9 +6698,9 @@ else if (HiOverflow == -1) // High bound less than input range. return ReplaceInstUsesWith(ICI, ConstantInt::getTrue(*Context)); if (Pred == ICmpInst::ICMP_UGT) - return new ICmpInst(*Context, ICmpInst::ICMP_UGE, X, HiBound); + return new ICmpInst(ICmpInst::ICMP_UGE, X, HiBound); else - return new ICmpInst(*Context, ICmpInst::ICMP_SGE, X, HiBound); + return new ICmpInst(ICmpInst::ICMP_SGE, X, HiBound); } } @@ -6732,7 +6729,7 @@ APInt NewRHS(RHS->getValue()); NewRHS.zext(SrcBits); NewRHS |= KnownOne; - return new ICmpInst(*Context, ICI.getPredicate(), LHSI->getOperand(0), + return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), ConstantInt::get(*Context, NewRHS)); } } @@ -6761,10 +6758,10 @@ isTrueIfPositive ^= true; if (isTrueIfPositive) - return new ICmpInst(*Context, ICmpInst::ICMP_SGT, CompareVal, + return new ICmpInst(ICmpInst::ICMP_SGT, CompareVal, SubOne(RHS)); else - return new ICmpInst(*Context, ICmpInst::ICMP_SLT, CompareVal, + return new ICmpInst(ICmpInst::ICMP_SLT, CompareVal, AddOne(RHS)); } @@ -6775,7 +6772,7 @@ ICmpInst::Predicate Pred = ICI.isSignedPredicate() ? ICI.getUnsignedPredicate() : ICI.getSignedPredicate(); - return new ICmpInst(*Context, Pred, LHSI->getOperand(0), + return new ICmpInst(Pred, LHSI->getOperand(0), ConstantInt::get(*Context, RHSV ^ SignBit)); } @@ -6786,7 +6783,7 @@ ? ICI.getUnsignedPredicate() : ICI.getSignedPredicate(); Pred = ICI.getSwappedPredicate(Pred); - return new ICmpInst(*Context, Pred, LHSI->getOperand(0), + return new ICmpInst(Pred, LHSI->getOperand(0), ConstantInt::get(*Context, RHSV ^ NotSignBit)); } } @@ -6818,7 +6815,7 @@ BinaryOperator::CreateAnd(Cast->getOperand(0), ConstantInt::get(*Context, NewCST), LHSI->getName()); InsertNewInstBefore(NewAnd, ICI); - return new ICmpInst(*Context, ICI.getPredicate(), NewAnd, + return new ICmpInst(ICI.getPredicate(), NewAnd, ConstantInt::get(*Context, NewCI)); } } @@ -6951,7 +6948,7 @@ BinaryOperator::CreateAnd(LHSI->getOperand(0), Mask, LHSI->getName()+".mask"); Value *And = InsertNewInstBefore(AndI, ICI); - return new ICmpInst(*Context, ICI.getPredicate(), And, + return new ICmpInst(ICI.getPredicate(), And, ConstantInt::get(*Context, RHSV.lshr(ShAmtVal))); } } @@ -6968,8 +6965,7 @@ Mask, LHSI->getName()+".mask"); Value *And = InsertNewInstBefore(AndI, ICI); - return new ICmpInst(*Context, - TrueIfSigned ? ICmpInst::ICMP_NE : ICmpInst::ICMP_EQ, + return new ICmpInst(TrueIfSigned ? ICmpInst::ICMP_NE : ICmpInst::ICMP_EQ, And, Constant::getNullValue(And->getType())); } break; @@ -7010,7 +7006,7 @@ if (LHSI->hasOneUse() && MaskedValueIsZero(LHSI->getOperand(0), APInt::getLowBitsSet(Comp.getBitWidth(), ShAmtVal))) { - return new ICmpInst(*Context, ICI.getPredicate(), LHSI->getOperand(0), + return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), ConstantExpr::getShl(RHS, ShAmt)); } @@ -7023,7 +7019,7 @@ BinaryOperator::CreateAnd(LHSI->getOperand(0), Mask, LHSI->getName()+".mask"); Value *And = InsertNewInstBefore(AndI, ICI); - return new ICmpInst(*Context, ICI.getPredicate(), And, + return new ICmpInst(ICI.getPredicate(), And, ConstantExpr::getShl(RHS, ShAmt)); } break; @@ -7056,18 +7052,18 @@ if (ICI.isSignedPredicate()) { if (CR.getLower().isSignBit()) { - return new ICmpInst(*Context, ICmpInst::ICMP_SLT, LHSI->getOperand(0), + return new ICmpInst(ICmpInst::ICMP_SLT, LHSI->getOperand(0), ConstantInt::get(*Context, CR.getUpper())); } else if (CR.getUpper().isSignBit()) { - return new ICmpInst(*Context, ICmpInst::ICMP_SGE, LHSI->getOperand(0), + return new ICmpInst(ICmpInst::ICMP_SGE, LHSI->getOperand(0), ConstantInt::get(*Context, CR.getLower())); } } else { if (CR.getLower().isMinValue()) { - return new ICmpInst(*Context, ICmpInst::ICMP_ULT, LHSI->getOperand(0), + return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0), ConstantInt::get(*Context, CR.getUpper())); } else if (CR.getUpper().isMinValue()) { - return new ICmpInst(*Context, ICmpInst::ICMP_UGE, LHSI->getOperand(0), + return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), ConstantInt::get(*Context, CR.getLower())); } } @@ -7092,7 +7088,7 @@ BinaryOperator::CreateURem(BO->getOperand(0), BO->getOperand(1), BO->getName()); InsertNewInstBefore(NewRem, ICI); - return new ICmpInst(*Context, ICI.getPredicate(), NewRem, + return new ICmpInst(ICI.getPredicate(), NewRem, Constant::getNullValue(BO->getType())); } } @@ -7101,7 +7097,7 @@ // Replace ((add A, B) != C) with (A != C-B) if B & C are constants. if (ConstantInt *BOp1C = dyn_cast(BO->getOperand(1))) { if (BO->hasOneUse()) - return new ICmpInst(*Context, ICI.getPredicate(), BO->getOperand(0), + return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), ConstantExpr::getSub(RHS, BOp1C)); } else if (RHSV == 0) { // Replace ((add A, B) != 0) with (A != -B) if A or B is @@ -7109,14 +7105,14 @@ Value *BOp0 = BO->getOperand(0), *BOp1 = BO->getOperand(1); if (Value *NegVal = dyn_castNegVal(BOp1)) - return new ICmpInst(*Context, ICI.getPredicate(), BOp0, NegVal); + return new ICmpInst(ICI.getPredicate(), BOp0, NegVal); else if (Value *NegVal = dyn_castNegVal(BOp0)) - return new ICmpInst(*Context, ICI.getPredicate(), NegVal, BOp1); + return new ICmpInst(ICI.getPredicate(), NegVal, BOp1); else if (BO->hasOneUse()) { Instruction *Neg = BinaryOperator::CreateNeg(BOp1); InsertNewInstBefore(Neg, ICI); Neg->takeName(BO); - return new ICmpInst(*Context, ICI.getPredicate(), BOp0, Neg); + return new ICmpInst(ICI.getPredicate(), BOp0, Neg); } } break; @@ -7124,14 +7120,14 @@ // For the xor case, we can xor two constants together, eliminating // the explicit xor. if (Constant *BOC = dyn_cast(BO->getOperand(1))) - return new ICmpInst(*Context, ICI.getPredicate(), BO->getOperand(0), + return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), ConstantExpr::getXor(RHS, BOC)); // FALLTHROUGH case Instruction::Sub: // Replace (([sub|xor] A, B) != 0) with (A != B) if (RHSV == 0) - return new ICmpInst(*Context, ICI.getPredicate(), BO->getOperand(0), + return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), BO->getOperand(1)); break; @@ -7158,7 +7154,7 @@ // If we have ((X & C) == C), turn it into ((X & C) != 0). if (RHS == BOC && RHSV.isPowerOf2()) - return new ICmpInst(*Context, isICMP_NE ? ICmpInst::ICMP_EQ : + return new ICmpInst(isICMP_NE ? ICmpInst::ICMP_EQ : ICmpInst::ICMP_NE, LHSI, Constant::getNullValue(RHS->getType())); @@ -7168,7 +7164,7 @@ Constant *Zero = Constant::getNullValue(X->getType()); ICmpInst::Predicate pred = isICMP_NE ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_SGE; - return new ICmpInst(*Context, pred, X, Zero); + return new ICmpInst(pred, X, Zero); } // ((X & ~7) == 0) --> X < 8 @@ -7177,7 +7173,7 @@ Constant *NegX = ConstantExpr::getNeg(BOC); ICmpInst::Predicate pred = isICMP_NE ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_ULT; - return new ICmpInst(*Context, pred, X, NegX); + return new ICmpInst(pred, X, NegX); } } default: break; @@ -7221,7 +7217,7 @@ } if (RHSOp) - return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, RHSOp); + return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSOp); } // The code below only handles extension cast instructions, so far. @@ -7246,15 +7242,15 @@ // Deal with equality cases early. if (ICI.isEquality()) - return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, RHSCIOp); + return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); // A signed comparison of sign extended values simplifies into a // signed comparison. if (isSignedCmp && isSignedExt) - return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, RHSCIOp); + return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); // The other three cases all fold into an unsigned comparison. - return new ICmpInst(*Context, ICI.getUnsignedPredicate(), LHSCIOp, RHSCIOp); + return new ICmpInst(ICI.getUnsignedPredicate(), LHSCIOp, RHSCIOp); } // If we aren't dealing with a constant on the RHS, exit early @@ -7281,7 +7277,7 @@ // However, we allow this when the compare is EQ/NE, because they are // signless. if (isSignedExt == isSignedCmp || ICI.isEquality()) - return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, Res1); + return new ICmpInst(ICI.getPredicate(), LHSCIOp, Res1); return 0; } @@ -7310,7 +7306,7 @@ // We're performing an unsigned comp with a sign extended value. // This is true if the input is >= 0. [aka >s -1] Constant *NegOne = Constant::getAllOnesValue(SrcTy); - Result = InsertNewInstBefore(new ICmpInst(*Context, ICmpInst::ICMP_SGT, + Result = InsertNewInstBefore(new ICmpInst(ICmpInst::ICMP_SGT, LHSCIOp, NegOne, ICI.getName()), ICI); } else { // Unsigned extend & unsigned compare -> always true. @@ -8492,7 +8488,7 @@ Constant *One = ConstantInt::get(Src->getType(), 1); Src = InsertNewInstBefore(BinaryOperator::CreateAnd(Src, One, "tmp"), CI); Value *Zero = Constant::getNullValue(Src->getType()); - return new ICmpInst(*Context, ICmpInst::ICMP_NE, Src, Zero); + return new ICmpInst(ICmpInst::ICMP_NE, Src, Zero); } // Optimize trunc(lshr(), c) to pull the shift through the truncate. @@ -10593,7 +10589,7 @@ if (BinaryOperator *BinOp = dyn_cast(FirstInst)) return BinaryOperator::Create(BinOp->getOpcode(), LHSVal, RHSVal); CmpInst *CIOp = cast(FirstInst); - return CmpInst::Create(*Context, CIOp->getOpcode(), CIOp->getPredicate(), + return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(), LHSVal, RHSVal); } @@ -10844,7 +10840,7 @@ if (BinaryOperator *BinOp = dyn_cast(FirstInst)) return BinaryOperator::Create(BinOp->getOpcode(), PhiVal, ConstantOp); if (CmpInst *CIOp = dyn_cast(FirstInst)) - return CmpInst::Create(*Context, CIOp->getOpcode(), CIOp->getPredicate(), + return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(), PhiVal, ConstantOp); assert(isa(FirstInst) && "Unknown operation"); Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Tue Aug 25 18:17:54 2009 @@ -159,7 +159,7 @@ Function::iterator FI = OrigBlock; F->getBasicBlockList().insert(++FI, NewNode); - ICmpInst* Comp = new ICmpInst(Default->getContext(), ICmpInst::ICMP_SLT, + ICmpInst* Comp = new ICmpInst(ICmpInst::ICMP_SLT, Val, Pivot.Low, "Pivot"); NewNode->getInstList().push_back(Comp); BranchInst::Create(LBranch, RBranch, Comp, NewNode); Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=80049&r1=80048&r2=80049&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Aug 25 18:17:54 2009 @@ -2506,7 +2506,7 @@ } CmpInst * -CmpInst::Create(LLVMContext &Context, OtherOps Op, unsigned short predicate, +CmpInst::Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const Twine &Name, Instruction *InsertBefore) { if (Op == Instruction::ICmp) { @@ -2514,7 +2514,7 @@ return new ICmpInst(InsertBefore, CmpInst::Predicate(predicate), S1, S2, Name); else - return new ICmpInst(Context, CmpInst::Predicate(predicate), + return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name); } @@ -2522,7 +2522,7 @@ return new FCmpInst(InsertBefore, CmpInst::Predicate(predicate), S1, S2, Name); else - return new FCmpInst(Context, CmpInst::Predicate(predicate), + return new FCmpInst(CmpInst::Predicate(predicate), S1, S2, Name); } @@ -2875,12 +2875,12 @@ } FCmpInst* FCmpInst::clone(LLVMContext &Context) const { - FCmpInst *New = new FCmpInst(Context, getPredicate(), Op<0>(), Op<1>()); + FCmpInst *New = new FCmpInst(getPredicate(), Op<0>(), Op<1>()); New->SubclassOptionalData = SubclassOptionalData; return New; } ICmpInst* ICmpInst::clone(LLVMContext &Context) const { - ICmpInst *New = new ICmpInst(Context, getPredicate(), Op<0>(), Op<1>()); + ICmpInst *New = new ICmpInst(getPredicate(), Op<0>(), Op<1>()); New->SubclassOptionalData = SubclassOptionalData; return New; } From gohman at apple.com Tue Aug 25 18:27:45 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 23:27:45 -0000 Subject: [llvm-commits] [llvm] r80050 - /llvm/trunk/lib/VMCore/Instructions.cpp Message-ID: <200908252327.n7PNRjqg030684@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 18:27:45 2009 New Revision: 80050 URL: http://llvm.org/viewvc/llvm-project?rev=80050&view=rev Log: Fix the InsertAtEnd form of ShuffleVectorInst constructor to use the correct type. Modified: llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=80050&r1=80049&r2=80050&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Aug 25 18:27:45 2009 @@ -1272,10 +1272,12 @@ ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask, const Twine &Name, BasicBlock *InsertAtEnd) - : Instruction(V1->getType(), ShuffleVector, - OperandTraits::op_begin(this), - OperandTraits::operands(this), - InsertAtEnd) { +: Instruction(VectorType::get(cast(V1->getType())->getElementType(), + cast(Mask->getType())->getNumElements()), + ShuffleVector, + OperandTraits::op_begin(this), + OperandTraits::operands(this), + InsertAtEnd) { assert(isValidOperands(V1, V2, Mask) && "Invalid shuffle vector instruction operands!"); From kremenek at apple.com Tue Aug 25 18:29:17 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 25 Aug 2009 23:29:17 -0000 Subject: [llvm-commits] [llvm] r80052 - /llvm/tags/checker/checker-0.217/ Message-ID: <200908252329.n7PNTHY7030890@zion.cs.uiuc.edu> Author: kremenek Date: Tue Aug 25 18:29:17 2009 New Revision: 80052 URL: http://llvm.org/viewvc/llvm-project?rev=80052&view=rev Log: Tagging checker-0.217. Added: llvm/tags/checker/checker-0.217/ - copied from r80051, llvm/trunk/ From rnk at mit.edu Tue Aug 25 18:38:50 2009 From: rnk at mit.edu (Reid Kleckner) Date: Tue, 25 Aug 2009 16:38:50 -0700 Subject: [llvm-commits] [llvm] r80049 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instructions.h include/llvm/Support/IRBuilder.h lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/Transforms/Scalar/CodeGenPrepare.cpp lib/Tra Message-ID: <9a9942200908251638k23a215bfr39da97b073191aa9@mail.gmail.com> Please also fix the CPPBackend to use the correct constructor. I fixed it the other direction. :) Reid On Tue, Aug 25, 2009 at 4:17 PM, Dan Gohman wrote: > Author: djg > Date: Tue Aug 25 18:17:54 2009 > New Revision: 80049 > > URL: http://llvm.org/viewvc/llvm-project?rev=80049&view=rev > Log: > Eliminate the unused Context argument on one of the ICmpInst and FCmpInst > constructors. > > Modified: > ? ?llvm/trunk/include/llvm/InstrTypes.h > ? ?llvm/trunk/include/llvm/Instructions.h > ? ?llvm/trunk/include/llvm/Support/IRBuilder.h > ? ?llvm/trunk/lib/AsmParser/LLParser.cpp > ? ?llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > ? ?llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp > ? ?llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp > ? ?llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > ? ?llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp > ? ?llvm/trunk/lib/VMCore/Instructions.cpp > > Modified: llvm/trunk/include/llvm/InstrTypes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/InstrTypes.h (original) > +++ llvm/trunk/include/llvm/InstrTypes.h Tue Aug 25 18:17:54 2009 > @@ -606,7 +606,7 @@ > ? /// instruction into a BasicBlock right before the specified instruction. > ? /// The specified Instruction is allowed to be a dereferenced end iterator. > ? /// @brief Create a CmpInst > - ?static CmpInst *Create(LLVMContext &Context, OtherOps Op, > + ?static CmpInst *Create(OtherOps Op, > ? ? ? ? ? ? ? ? ? ? ? ? ?unsigned short predicate, Value *S1, > ? ? ? ? ? ? ? ? ? ? ? ? ?Value *S2, const Twine &Name = "", > ? ? ? ? ? ? ? ? ? ? ? ? ?Instruction *InsertBefore = 0); > > Modified: llvm/trunk/include/llvm/Instructions.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/Instructions.h (original) > +++ llvm/trunk/include/llvm/Instructions.h Tue Aug 25 18:17:54 2009 > @@ -696,7 +696,6 @@ > > ? /// @brief Constructor with no-insertion semantics > ? ICmpInst( > - ? ?LLVMContext &Context, ///< Context to construct within > ? ? Predicate pred, ///< The predicate to use for the comparison > ? ? Value *LHS, ? ? ///< The left-hand-side of the expression > ? ? Value *RHS, ? ? ///< The right-hand-side of the expression > @@ -867,7 +866,6 @@ > > ? /// @brief Constructor with no-insertion semantics > ? FCmpInst( > - ? ?LLVMContext &Context, ///< Context to build in > ? ? Predicate pred, ///< The predicate to use for the comparison > ? ? Value *LHS, ? ? ///< The left-hand-side of the expression > ? ? Value *RHS, ? ? ///< The right-hand-side of the expression > > Modified: llvm/trunk/include/llvm/Support/IRBuilder.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/Support/IRBuilder.h (original) > +++ llvm/trunk/include/llvm/Support/IRBuilder.h Tue Aug 25 18:17:54 2009 > @@ -744,14 +744,14 @@ > ? ? if (Constant *LC = dyn_cast(LHS)) > ? ? ? if (Constant *RC = dyn_cast(RHS)) > ? ? ? ? return Folder.CreateICmp(P, LC, RC); > - ? ?return Insert(new ICmpInst(Context, P, LHS, RHS), Name); > + ? ?return Insert(new ICmpInst(P, LHS, RHS), Name); > ? } > ? Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, > ? ? ? ? ? ? ? ? ? ? const Twine &Name = "") { > ? ? if (Constant *LC = dyn_cast(LHS)) > ? ? ? if (Constant *RC = dyn_cast(RHS)) > ? ? ? ? return Folder.CreateFCmp(P, LC, RC); > - ? ?return Insert(new FCmpInst(Context, P, LHS, RHS), Name); > + ? ?return Insert(new FCmpInst(P, LHS, RHS), Name); > ? } > > ? //===--------------------------------------------------------------------===// > > Modified: llvm/trunk/lib/AsmParser/LLParser.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) > +++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Aug 25 18:17:54 2009 > @@ -3089,13 +3089,13 @@ > ? if (Opc == Instruction::FCmp) { > ? ? if (!LHS->getType()->isFPOrFPVector()) > ? ? ? return Error(Loc, "fcmp requires floating point operands"); > - ? ?Inst = new FCmpInst(Context, CmpInst::Predicate(Pred), LHS, RHS); > + ? ?Inst = new FCmpInst(CmpInst::Predicate(Pred), LHS, RHS); > ? } else { > ? ? assert(Opc == Instruction::ICmp && "Unknown opcode for CmpInst!"); > ? ? if (!LHS->getType()->isIntOrIntVector() && > ? ? ? ? !isa(LHS->getType())) > ? ? ? return Error(Loc, "icmp requires integer operands"); > - ? ?Inst = new ICmpInst(Context, CmpInst::Predicate(Pred), LHS, RHS); > + ? ?Inst = new ICmpInst(CmpInst::Predicate(Pred), LHS, RHS); > ? } > ? return false; > ?} > > Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) > +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Aug 25 18:17:54 2009 > @@ -1781,9 +1781,9 @@ > ? ? ? ? return Error("Invalid CMP record"); > > ? ? ? if (LHS->getType()->isFPOrFPVector()) > - ? ? ? ?I = new FCmpInst(Context, (FCmpInst::Predicate)Record[OpNum], LHS, RHS); > + ? ? ? ?I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); > ? ? ? else > - ? ? ? ?I = new ICmpInst(Context, (ICmpInst::Predicate)Record[OpNum], LHS, RHS); > + ? ? ? ?I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); > ? ? ? break; > ? ? } > > > Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Tue Aug 25 18:17:54 2009 > @@ -519,7 +519,7 @@ > ? ? ? BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI(); > > ? ? ? InsertedCmp = > - ? ? ? ?CmpInst::Create(DefBB->getContext(), CI->getOpcode(), > + ? ? ? ?CmpInst::Create(CI->getOpcode(), > ? ? ? ? ? ? ? ? ? ? ? ? CI->getPredicate(), ?CI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? CI->getOperand(1), "", InsertPt); > ? ? ? MadeChange = true; > > Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Aug 25 18:17:54 2009 > @@ -864,7 +864,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? newOp1, newOp2, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BO->getName()+".expr"); > ? ? ? else if (CmpInst* C = dyn_cast(U)) > - ? ? ? ?newVal = CmpInst::Create(Context, C->getOpcode(), > + ? ? ? ?newVal = CmpInst::Create(C->getOpcode(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?C->getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?newOp1, newOp2, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?C->getName()+".expr"); > @@ -1684,7 +1684,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BO->getName()+".gvnpre", > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (*PI)->getTerminator()); > ? ? ? else if (CmpInst* C = dyn_cast(U)) > - ? ? ? ?newVal = CmpInst::Create(Context, C->getOpcode(), > + ? ? ? ?newVal = CmpInst::Create(C->getOpcode(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?C->getPredicate(), s1, s2, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?C->getName()+".gvnpre", > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(*PI)->getTerminator()); > > Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Aug 25 18:17:54 2009 > @@ -1893,7 +1893,7 @@ > ? if (BinaryOperator *BO = dyn_cast(&I)) > ? ? New = BinaryOperator::Create(BO->getOpcode(), Op0, Op1,SO->getName()+".op"); > ? else if (CmpInst *CI = dyn_cast(&I)) > - ? ?New = CmpInst::Create(*Context, CI->getOpcode(), CI->getPredicate(), > + ? ?New = CmpInst::Create(CI->getOpcode(), CI->getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? Op0, Op1, SO->getName()+".cmp"); > ? else { > ? ? llvm_unreachable("Unknown binary instruction type!"); > @@ -1982,7 +1982,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PN->getIncomingValue(i), C, "phitmp", > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?NonConstBB->getTerminator()); > ? ? ? ? else if (CmpInst *CI = dyn_cast(&I)) > - ? ? ? ? ?InV = CmpInst::Create(*Context, CI->getOpcode(), > + ? ? ? ? ?InV = CmpInst::Create(CI->getOpcode(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CI->getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PN->getIncomingValue(i), C, "phitmp", > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? NonConstBB->getTerminator()); > @@ -3006,8 +3006,7 @@ > > ? ? // X udiv C, where C >= signbit > ? ? if (C->getValue().isNegative()) { > - ? ? ?Value *IC = InsertNewInstBefore(new ICmpInst(*Context, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ICmpInst::ICMP_ULT, Op0, C), > + ? ? ?Value *IC = InsertNewInstBefore(new ICmpInst(ICmpInst::ICMP_ULT, Op0, C), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? I); > ? ? ? return SelectInst::Create(IC, Constant::getNullValue(I.getType()), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(I.getType(), 1)); > @@ -3388,26 +3387,26 @@ > ? case ?0: return ConstantInt::getFalse(*Context); > ? case ?1: > ? ? if (sign) > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SGT, LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_SGT, LHS, RHS); > ? ? else > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_UGT, LHS, RHS); > - ?case ?2: return new ICmpInst(*Context, ICmpInst::ICMP_EQ, ?LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_UGT, LHS, RHS); > + ?case ?2: return new ICmpInst(ICmpInst::ICMP_EQ, ?LHS, RHS); > ? case ?3: > ? ? if (sign) > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SGE, LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_SGE, LHS, RHS); > ? ? else > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_UGE, LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_UGE, LHS, RHS); > ? case ?4: > ? ? if (sign) > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SLT, LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_SLT, LHS, RHS); > ? ? else > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_ULT, LHS, RHS); > - ?case ?5: return new ICmpInst(*Context, ICmpInst::ICMP_NE, ?LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_ULT, LHS, RHS); > + ?case ?5: return new ICmpInst(ICmpInst::ICMP_NE, ?LHS, RHS); > ? case ?6: > ? ? if (sign) > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SLE, LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_SLE, LHS, RHS); > ? ? else > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_ULE, LHS, RHS); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_ULE, LHS, RHS); > ? case ?7: return ConstantInt::getTrue(*Context); > ? } > ?} > @@ -3421,39 +3420,39 @@ > ? default: llvm_unreachable("Illegal FCmp code!"); > ? case ?0: > ? ? if (isordered) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_ORD, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_ORD, LHS, RHS); > ? ? else > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_UNO, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_UNO, LHS, RHS); > ? case ?1: > ? ? if (isordered) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_OGT, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_OGT, LHS, RHS); > ? ? else > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_UGT, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_UGT, LHS, RHS); > ? case ?2: > ? ? if (isordered) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_OEQ, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_OEQ, LHS, RHS); > ? ? else > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_UEQ, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_UEQ, LHS, RHS); > ? case ?3: > ? ? if (isordered) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_OGE, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_OGE, LHS, RHS); > ? ? else > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_UGE, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_UGE, LHS, RHS); > ? case ?4: > ? ? if (isordered) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_OLT, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_OLT, LHS, RHS); > ? ? else > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_ULT, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_ULT, LHS, RHS); > ? case ?5: > ? ? if (isordered) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_ONE, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_ONE, LHS, RHS); > ? ? else > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_UNE, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_UNE, LHS, RHS); > ? case ?6: > ? ? if (isordered) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_OLE, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_OLE, LHS, RHS); > ? ? else > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_ULE, LHS, RHS); > + ? ? ?return new FCmpInst(FCmpInst::FCMP_ULE, LHS, RHS); > ? case ?7: return ConstantInt::getTrue(*Context); > ? } > ?} > @@ -3658,13 +3657,13 @@ > > ? if (Inside) { > ? ? if (Lo == Hi) ?// Trivially false. > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_NE, V, V); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_NE, V, V); > > ? ? // V >= Min && V < Hi --> V < Hi > ? ? if (cast(Lo)->isMinValue(isSigned)) { > ? ? ? ICmpInst::Predicate pred = (isSigned ? > ? ? ? ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT); > - ? ? ?return new ICmpInst(*Context, pred, V, Hi); > + ? ? ?return new ICmpInst(pred, V, Hi); > ? ? } > > ? ? // Emit V-Lo @@ -3672,18 +3671,18 @@ > ? ? Instruction *Add = BinaryOperator::CreateAdd(V, NegLo, V->getName()+".off"); > ? ? InsertNewInstBefore(Add, IB); > ? ? Constant *UpperBound = ConstantExpr::getAdd(NegLo, Hi); > - ? ?return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Add, UpperBound); > + ? ?return new ICmpInst(ICmpInst::ICMP_ULT, Add, UpperBound); > ? } > > ? if (Lo == Hi) ?// Trivially true. > - ? ?return new ICmpInst(*Context, ICmpInst::ICMP_EQ, V, V); > + ? ?return new ICmpInst(ICmpInst::ICMP_EQ, V, V); > > ? // V < Min || V >= Hi -> V > Hi-1 > ? Hi = SubOne(cast(Hi)); > ? if (cast(Lo)->isMinValue(isSigned)) { > ? ? ICmpInst::Predicate pred = (isSigned ? > ? ? ? ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT); > - ? ?return new ICmpInst(*Context, pred, V, Hi); > + ? ?return new ICmpInst(pred, V, Hi); > ? } > > ? // Emit V-Lo >u Hi-1-Lo > @@ -3692,7 +3691,7 @@ > ? Instruction *Add = BinaryOperator::CreateAdd(V, NegLo, V->getName()+".off"); > ? InsertNewInstBefore(Add, IB); > ? Constant *LowerBound = ConstantExpr::getAdd(NegLo, Hi); > - ?return new ICmpInst(*Context, ICmpInst::ICMP_UGT, Add, LowerBound); > + ?return new ICmpInst(ICmpInst::ICMP_UGT, Add, LowerBound); > ?} > > ?// isRunOfOnes - Returns true iff Val consists of one contiguous run of 1s with > @@ -3790,7 +3789,7 @@ > ? ? ? LHSCst->getValue().isPowerOf2()) { > ? ? Instruction *NewOr = BinaryOperator::CreateOr(Val, Val2); > ? ? InsertNewInstBefore(NewOr, I); > - ? ?return new ICmpInst(*Context, LHSCC, NewOr, LHSCst); > + ? ?return new ICmpInst(LHSCC, NewOr, LHSCst); > ? } > > ? // From here on, we only handle: > @@ -3850,11 +3849,11 @@ > ? ? default: llvm_unreachable("Unknown integer condition code!"); > ? ? case ICmpInst::ICMP_ULT: > ? ? ? if (LHSCst == SubOne(RHSCst)) // (X != 13 & X u< 14) -> X < 13 > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Val, LHSCst); > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_ULT, Val, LHSCst); > ? ? ? break; ? ? ? ? ? ? ? ? ? ? ? ?// (X != 13 & X u< 15) -> no change > ? ? case ICmpInst::ICMP_SLT: > ? ? ? if (LHSCst == SubOne(RHSCst)) // (X != 13 & X s< 14) -> X < 13 > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SLT, Val, LHSCst); > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_SLT, Val, LHSCst); > ? ? ? break; ? ? ? ? ? ? ? ? ? ? ? ?// (X != 13 & X s< 15) -> no change > ? ? case ICmpInst::ICMP_EQ: ? ? ? ? // (X != 13 & X == 15) -> X == 15 > ? ? case ICmpInst::ICMP_UGT: ? ? ? ?// (X != 13 & X u> 15) -> X u> 15 > @@ -3866,7 +3865,7 @@ > ? ? ? ? Instruction *Add = BinaryOperator::CreateAdd(Val, AddCST, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Val->getName()+".off"); > ? ? ? ? InsertNewInstBefore(Add, I); > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_UGT, Add, > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_UGT, Add, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(Add->getType(), 1)); > ? ? ? } > ? ? ? break; ? ? ? ? ? ? ? ? ? ? ? ?// (X != 13 & X != 15) -> no change > @@ -3912,7 +3911,7 @@ > ? ? ? break; > ? ? case ICmpInst::ICMP_NE: > ? ? ? if (RHSCst == AddOne(LHSCst)) // (X u> 13 & X != 14) -> X u> 14 > - ? ? ? ?return new ICmpInst(*Context, LHSCC, Val, RHSCst); > + ? ? ? ?return new ICmpInst(LHSCC, Val, RHSCst); > ? ? ? break; ? ? ? ? ? ? ? ? ? ? ? ?// (X u> 13 & X != 15) -> no change > ? ? case ICmpInst::ICMP_ULT: ? ? ? ?// (X u> 13 & X u< 15) -> (X-14) ? ? ? return InsertRangeTest(Val, AddOne(LHSCst), > @@ -3931,7 +3930,7 @@ > ? ? ? break; > ? ? case ICmpInst::ICMP_NE: > ? ? ? if (RHSCst == AddOne(LHSCst)) // (X s> 13 & X != 14) -> X s> 14 > - ? ? ? ?return new ICmpInst(*Context, LHSCC, Val, RHSCst); > + ? ? ? ?return new ICmpInst(LHSCC, Val, RHSCst); > ? ? ? break; ? ? ? ? ? ? ? ? ? ? ? ?// (X s> 13 & X != 15) -> no change > ? ? case ICmpInst::ICMP_SLT: ? ? ? ?// (X s> 13 & X s< 15) -> (X-14) s< 1 > ? ? ? return InsertRangeTest(Val, AddOne(LHSCst), > @@ -3957,7 +3956,7 @@ > ? ? ? ? // false. > ? ? ? ? if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN()) > ? ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); > - ? ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_ORD, > + ? ? ? ?return new FCmpInst(FCmpInst::FCMP_ORD, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? LHS->getOperand(0), RHS->getOperand(0)); > ? ? ? } > > @@ -3965,7 +3964,7 @@ > ? ? // "fcmp ord x,x" is "fcmp ord x, 0". > ? ? if (isa(LHS->getOperand(1)) && > ? ? ? ? isa(RHS->getOperand(1))) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_ORD, > + ? ? ?return new FCmpInst(FCmpInst::FCMP_ORD, > ? ? ? ? ? ? ? ? ? ? ? ? ? LHS->getOperand(0), RHS->getOperand(0)); > ? ? return 0; > ? } > @@ -3984,7 +3983,7 @@ > ? if (Op0LHS == Op1LHS && Op0RHS == Op1RHS) { > ? ? // Simplify (fcmp cc0 x, y) & (fcmp cc1 x, y). > ? ? if (Op0CC == Op1CC) > - ? ? ?return new FCmpInst(*Context, (FCmpInst::Predicate)Op0CC, Op0LHS, Op0RHS); > + ? ? ?return new FCmpInst((FCmpInst::Predicate)Op0CC, Op0LHS, Op0RHS); > > ? ? if (Op0CC == FCmpInst::FCMP_FALSE || Op1CC == FCmpInst::FCMP_FALSE) > ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); > @@ -4119,7 +4118,7 @@ > ? ? ? ? // (1 << x) & 1 --> zext(x == 0) > ? ? ? ? // (1 >> x) & 1 --> zext(x == 0) > ? ? ? ? if (AndRHSMask == 1 && Op0LHS == AndRHS) { > - ? ? ? ? ?Instruction *NewICmp = new ICmpInst(*Context, ICmpInst::ICMP_EQ, > + ? ? ? ? ?Instruction *NewICmp = new ICmpInst(ICmpInst::ICMP_EQ, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Op0RHS, Constant::getNullValue(I.getType())); > ? ? ? ? ? InsertNewInstBefore(NewICmp, I); > ? ? ? ? ? return new ZExtInst(NewICmp, I.getType()); > @@ -4550,7 +4549,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Val->getName()+".off"); > ? ? ? ? InsertNewInstBefore(Add, I); > ? ? ? ? AddCST = ConstantExpr::getSub(AddOne(RHSCst), LHSCst); > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Add, AddCST); > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_ULT, Add, AddCST); > ? ? ? } > ? ? ? break; ? ? ? ? ? ? ? ? ? ? ? ? // (X == 13 | X == 15) -> no change > ? ? case ICmpInst::ICMP_UGT: ? ? ? ? // (X == 13 | X u> 14) -> no change > @@ -4665,7 +4664,7 @@ > > ? ? ? ? // Otherwise, no need to compare the two constants, compare the > ? ? ? ? // rest. > - ? ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_UNO, > + ? ? ? ?return new FCmpInst(FCmpInst::FCMP_UNO, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? LHS->getOperand(0), RHS->getOperand(0)); > ? ? ? } > > @@ -4673,7 +4672,7 @@ > ? ? // "fcmp uno x,x" is "fcmp uno x, 0". > ? ? if (isa(LHS->getOperand(1)) && > ? ? ? ? isa(RHS->getOperand(1))) > - ? ? ?return new FCmpInst(*Context, FCmpInst::FCMP_UNO, > + ? ? ?return new FCmpInst(FCmpInst::FCMP_UNO, > ? ? ? ? ? ? ? ? ? ? ? ? ? LHS->getOperand(0), RHS->getOperand(0)); > > ? ? return 0; > @@ -4691,7 +4690,7 @@ > ? if (Op0LHS == Op1LHS && Op0RHS == Op1RHS) { > ? ? // Simplify (fcmp cc0 x, y) | (fcmp cc1 x, y). > ? ? if (Op0CC == Op1CC) > - ? ? ?return new FCmpInst(*Context, (FCmpInst::Predicate)Op0CC, > + ? ? ?return new FCmpInst((FCmpInst::Predicate)Op0CC, > ? ? ? ? ? ? ? ? ? ? ? ? ? Op0LHS, Op0RHS); > ? ? if (Op0CC == FCmpInst::FCMP_TRUE || Op1CC == FCmpInst::FCMP_TRUE) > ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); > @@ -5083,11 +5082,11 @@ > ? ? if (RHS == ConstantInt::getTrue(*Context) && Op0->hasOneUse()) { > ? ? ? // xor (cmp A, B), true = not (cmp A, B) = !cmp A, B > ? ? ? if (ICmpInst *ICI = dyn_cast(Op0)) > - ? ? ? ?return new ICmpInst(*Context, ICI->getInversePredicate(), > + ? ? ? ?return new ICmpInst(ICI->getInversePredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ICI->getOperand(0), ICI->getOperand(1)); > > ? ? ? if (FCmpInst *FCI = dyn_cast(Op0)) > - ? ? ? ?return new FCmpInst(*Context, FCI->getInversePredicate(), > + ? ? ? ?return new FCmpInst(FCI->getInversePredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? FCI->getOperand(0), FCI->getOperand(1)); > ? ? } > > @@ -5101,7 +5100,6 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ConstantInt::getTrue(*Context), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Op0C->getDestTy())) { > ? ? ? ? ? ? ? Instruction *NewCI = InsertNewInstBefore(CmpInst::Create( > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *Context, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CI->getOpcode(), CI->getInversePredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CI->getOperand(0), CI->getOperand(1)), I); > ? ? ? ? ? ? ? NewCI->takeName(CI); > @@ -5596,7 +5594,7 @@ > ? ? // If not, synthesize the offset the hard way. > ? ? if (Offset == 0) > ? ? ? Offset = EmitGEPOffset(GEPLHS, I, *this); > - ? ?return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), Offset, > + ? ?return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset, > ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(Offset->getType())); > ? } else if (GEPOperator *GEPRHS = dyn_cast(RHS)) { > ? ? // If the base pointers are different, but the indices are the same, just > @@ -5614,7 +5612,7 @@ > > ? ? ? // If all indices are the same, just compare the base pointers. > ? ? ? if (IndicesTheSame) > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), > + ? ? ? ?return new ICmpInst(ICmpInst::getSignedPredicate(Cond), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? GEPLHS->getOperand(0), GEPRHS->getOperand(0)); > > ? ? ? // Otherwise, the base pointers are different and the indices are > @@ -5671,8 +5669,7 @@ > ? ? ? ? Value *LHSV = GEPLHS->getOperand(DiffOperand); > ? ? ? ? Value *RHSV = GEPRHS->getOperand(DiffOperand); > ? ? ? ? // Make sure we do a signed comparison here. > - ? ? ? ?return new ICmpInst(*Context, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ?ICmpInst::getSignedPredicate(Cond), LHSV, RHSV); > + ? ? ? ?return new ICmpInst(ICmpInst::getSignedPredicate(Cond), LHSV, RHSV); > ? ? ? } > ? ? } > > @@ -5684,7 +5681,7 @@ > ? ? ? // ((gep Ptr, OFFSET1) cmp (gep Ptr, OFFSET2) ?---> ?(OFFSET1 cmp OFFSET2) > ? ? ? Value *L = EmitGEPOffset(GEPLHS, I, *this); > ? ? ? Value *R = EmitGEPOffset(GEPRHS, I, *this); > - ? ? ?return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), L, R); > + ? ? ?return new ICmpInst(ICmpInst::getSignedPredicate(Cond), L, R); > ? ? } > ? } > ? return 0; > @@ -5879,7 +5876,7 @@ > > ? // Lower this FP comparison into an appropriate integer version of the > ? // comparison. > - ?return new ICmpInst(*Context, Pred, LHSI->getOperand(0), RHSInt); > + ?return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt); > ?} > > ?Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) { > @@ -5967,14 +5964,14 @@ > ? ? ? ? ? ? // Fold the known value into the constant operand. > ? ? ? ? ? ? Op1 = ConstantExpr::getCompare(I.getPredicate(), C, RHSC); > ? ? ? ? ? ? // Insert a new FCmp of the other select operand. > - ? ? ? ? ? ?Op2 = InsertNewInstBefore(new FCmpInst(*Context, I.getPredicate(), > + ? ? ? ? ? ?Op2 = InsertNewInstBefore(new FCmpInst(I.getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? LHSI->getOperand(2), RHSC, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? I.getName()), I); > ? ? ? ? ? } else if (Constant *C = dyn_cast(LHSI->getOperand(2))) { > ? ? ? ? ? ? // Fold the known value into the constant operand. > ? ? ? ? ? ? Op2 = ConstantExpr::getCompare(I.getPredicate(), C, RHSC); > ? ? ? ? ? ? // Insert a new FCmp of the other select operand. > - ? ? ? ? ? ?Op1 = InsertNewInstBefore(new FCmpInst(*Context, I.getPredicate(), > + ? ? ? ? ? ?Op1 = InsertNewInstBefore(new FCmpInst(I.getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? LHSI->getOperand(1), RHSC, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? I.getName()), I); > ? ? ? ? ? } > @@ -6074,7 +6071,7 @@ > ? ? if (I.isEquality() && CI->isNullValue() && > ? ? ? ? match(Op0, m_Sub(m_Value(A), m_Value(B)))) { > ? ? ? // (icmp cond A B) if cond is equality > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), A, B); > + ? ? ?return new ICmpInst(I.getPredicate(), A, B); > ? ? } > > ? ? // If we have an icmp le or icmp ge instruction, turn it into the > @@ -6085,22 +6082,22 @@ > ? ? case ICmpInst::ICMP_ULE: > ? ? ? if (CI->isMaxValue(false)) ? ? ? ? ? ? ? ? // A <=u MAX -> TRUE > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Op0, > + ? ? ?return new ICmpInst(ICmpInst::ICMP_ULT, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? AddOne(CI)); > ? ? case ICmpInst::ICMP_SLE: > ? ? ? if (CI->isMaxValue(true)) ? ? ? ? ? ? ? ? ?// A <=s MAX -> TRUE > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SLT, Op0, > + ? ? ?return new ICmpInst(ICmpInst::ICMP_SLT, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? AddOne(CI)); > ? ? case ICmpInst::ICMP_UGE: > ? ? ? if (CI->isMinValue(false)) ? ? ? ? ? ? ? ? // A >=u MIN -> TRUE > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_UGT, Op0, > + ? ? ?return new ICmpInst(ICmpInst::ICMP_UGT, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? SubOne(CI)); > ? ? case ICmpInst::ICMP_SGE: > ? ? ? if (CI->isMinValue(true)) ? ? ? ? ? ? ? ? ?// A >=s MIN -> TRUE > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getTrue(*Context)); > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SGT, Op0, > + ? ? ?return new ICmpInst(ICmpInst::ICMP_SGT, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? SubOne(CI)); > ? ? } > > @@ -6147,10 +6144,10 @@ > ? ? // figured out that the LHS is a constant. ?Just constant fold this now so > ? ? // that code below can assume that Min != Max. > ? ? if (!isa(Op0) && Op0Min == Op0Max) > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), > + ? ? ?return new ICmpInst(I.getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, Op0Min), Op1); > ? ? if (!isa(Op1) && Op1Min == Op1Max) > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), Op0, > + ? ? ?return new ICmpInst(I.getPredicate(), Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, Op1Min)); > > ? ? // Based on the range information we know about the LHS, see if we can > @@ -6171,15 +6168,15 @@ > ? ? ? if (Op0Min.uge(Op1Max)) ? ? ? ? ?// A false if min(A) >= max(B) > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); > ? ? ? if (Op1Min == Op0Max) ? ? ? ? ? ?// A A != B if max(A) == min(B) > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); > ? ? ? if (ConstantInt *CI = dyn_cast(Op1)) { > ? ? ? ? if (Op1Max == Op0Min+1) ? ? ? ?// A A == C-1 if min(A)+1 == C > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_EQ, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SubOne(CI)); > > ? ? ? ? // (x (x >s -1) ?-> true if sign bit clear > ? ? ? ? if (CI->isMinValue(true)) > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SGT, Op0, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_SGT, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ?Constant::getAllOnesValue(Op0->getType())); > ? ? ? } > ? ? ? break; > @@ -6190,15 +6187,15 @@ > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); > > ? ? ? if (Op1Max == Op0Min) ? ? ? ? ? ?// A >u B -> A != B if min(A) == max(B) > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); > ? ? ? if (ConstantInt *CI = dyn_cast(Op1)) { > ? ? ? ? if (Op1Min == Op0Max-1) ? ? ? ?// A >u C -> A == C+1 if max(a)-1 == C > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_EQ, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? AddOne(CI)); > > ? ? ? ? // (x >u 2147483647) -> (x true if sign bit set > ? ? ? ? if (CI->isMaxValue(true)) > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SLT, Op0, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_SLT, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(Op0->getType())); > ? ? ? } > ? ? ? break; > @@ -6208,10 +6205,10 @@ > ? ? ? if (Op0Min.sge(Op1Max)) ? ? ? ? ?// A false if min(A) >= max(C) > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); > ? ? ? if (Op1Min == Op0Max) ? ? ? ? ? ?// A A != B if max(A) == min(B) > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); > ? ? ? if (ConstantInt *CI = dyn_cast(Op1)) { > ? ? ? ? if (Op1Max == Op0Min+1) ? ? ? ?// A A == C-1 if min(A)+1 == C > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_EQ, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SubOne(CI)); > ? ? ? } > ? ? ? break; > @@ -6222,10 +6219,10 @@ > ? ? ? ? return ReplaceInstUsesWith(I, ConstantInt::getFalse(*Context)); > > ? ? ? if (Op1Max == Op0Min) ? ? ? ? ? ?// A >s B -> A != B if min(A) == max(B) > - ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_NE, Op0, Op1); > + ? ? ? ?return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); > ? ? ? if (ConstantInt *CI = dyn_cast(Op1)) { > ? ? ? ? if (Op1Min == Op0Max-1) ? ? ? ?// A >s C -> A == C+1 if max(A)-1 == C > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_EQ, Op0, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_EQ, Op0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? AddOne(CI)); > ? ? ? } > ? ? ? break; > @@ -6264,7 +6261,7 @@ > ? ? if (I.isSignedPredicate() && > ? ? ? ? ((Op0KnownZero.isNegative() && Op1KnownZero.isNegative()) || > ? ? ? ? ?(Op0KnownOne.isNegative() && Op1KnownOne.isNegative()))) > - ? ? ?return new ICmpInst(*Context, I.getUnsignedPredicate(), Op0, Op1); > + ? ? ?return new ICmpInst(I.getUnsignedPredicate(), Op0, Op1); > ? } > > ? // Test if the ICmpInst instruction is used exclusively by a select as > @@ -6306,7 +6303,7 @@ > ? ? ? ? ? ? ? break; > ? ? ? ? ? ? } > ? ? ? ? ? if (isAllZeros) > - ? ? ? ? ? ?return new ICmpInst(*Context, I.getPredicate(), LHSI->getOperand(0), > + ? ? ? ? ? ?return new ICmpInst(I.getPredicate(), LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(LHSI->getOperand(0)->getType())); > ? ? ? ? } > ? ? ? ? break; > @@ -6329,14 +6326,14 @@ > ? ? ? ? ? ? // Fold the known value into the constant operand. > ? ? ? ? ? ? Op1 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC); > ? ? ? ? ? ? // Insert a new ICmp of the other select operand. > - ? ? ? ? ? ?Op2 = InsertNewInstBefore(new ICmpInst(*Context, I.getPredicate(), > + ? ? ? ? ? ?Op2 = InsertNewInstBefore(new ICmpInst(I.getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?LHSI->getOperand(2), RHSC, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?I.getName()), I); > ? ? ? ? ? } else if (Constant *C = dyn_cast(LHSI->getOperand(2))) { > ? ? ? ? ? ? // Fold the known value into the constant operand. > ? ? ? ? ? ? Op2 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC); > ? ? ? ? ? ? // Insert a new ICmp of the other select operand. > - ? ? ? ? ? ?Op1 = InsertNewInstBefore(new ICmpInst(*Context, I.getPredicate(), > + ? ? ? ? ? ?Op1 = InsertNewInstBefore(new ICmpInst(I.getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?LHSI->getOperand(1), RHSC, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?I.getName()), I); > ? ? ? ? ? } > @@ -6391,7 +6388,7 @@ > ? ? ? ? ? Op1 = InsertBitCastBefore(Op1, Op0->getType(), I); > ? ? ? ? } > ? ? ? } > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), Op0, Op1); > + ? ? ?return new ICmpInst(I.getPredicate(), Op0, Op1); > ? ? } > ? } > > @@ -6418,7 +6415,7 @@ > ? ? ? ? case Instruction::Sub: > ? ? ? ? case Instruction::Xor: > ? ? ? ? ? if (I.isEquality()) ? ?// a+x icmp eq/ne b+x --> a icmp b > - ? ? ? ? ? ?return new ICmpInst(*Context, I.getPredicate(), Op0I->getOperand(0), > + ? ? ? ? ? ?return new ICmpInst(I.getPredicate(), Op0I->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Op1I->getOperand(0)); > ? ? ? ? ? // icmp u/s (a ^ signbit), (b ^ signbit) --> icmp s/u a, b > ? ? ? ? ? if (ConstantInt *CI = dyn_cast(Op0I->getOperand(1))) { > @@ -6426,7 +6423,7 @@ > ? ? ? ? ? ? ? ICmpInst::Predicate Pred = I.isSignedPredicate() > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? I.getUnsignedPredicate() > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: I.getSignedPredicate(); > - ? ? ? ? ? ? ?return new ICmpInst(*Context, Pred, Op0I->getOperand(0), > + ? ? ? ? ? ? ?return new ICmpInst(Pred, Op0I->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Op1I->getOperand(0)); > ? ? ? ? ? ? } > > @@ -6435,7 +6432,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? I.getUnsignedPredicate() > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: I.getSignedPredicate(); > ? ? ? ? ? ? ? Pred = I.getSwappedPredicate(Pred); > - ? ? ? ? ? ? ?return new ICmpInst(*Context, Pred, Op0I->getOperand(0), > + ? ? ? ? ? ? ?return new ICmpInst(Pred, Op0I->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Op1I->getOperand(0)); > ? ? ? ? ? ? } > ? ? ? ? ? } > @@ -6459,7 +6456,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Mask); > ? ? ? ? ? ? ? InsertNewInstBefore(And1, I); > ? ? ? ? ? ? ? InsertNewInstBefore(And2, I); > - ? ? ? ? ? ? ?return new ICmpInst(*Context, I.getPredicate(), And1, And2); > + ? ? ? ? ? ? ?return new ICmpInst(I.getPredicate(), And1, And2); > ? ? ? ? ? ? } > ? ? ? ? ? } > ? ? ? ? ? break; > @@ -6472,7 +6469,7 @@ > ? { Value *A, *B; > ? ? if (match(Op0, m_Not(m_Value(A))) && > ? ? ? ? match(Op1, m_Not(m_Value(B)))) > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), B, A); > + ? ? ?return new ICmpInst(I.getPredicate(), B, A); > ? } > > ? if (I.isEquality()) { > @@ -6481,12 +6478,12 @@ > ? ? // -x == -y --> x == y > ? ? if (match(Op0, m_Neg(m_Value(A))) && > ? ? ? ? match(Op1, m_Neg(m_Value(B)))) > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), A, B); > + ? ? ?return new ICmpInst(I.getPredicate(), A, B); > > ? ? if (match(Op0, m_Xor(m_Value(A), m_Value(B)))) { > ? ? ? if (A == Op1 || B == Op1) { ? ?// (A^B) == A ?-> ?B == 0 > ? ? ? ? Value *OtherVal = A == Op1 ? B : A; > - ? ? ? ?return new ICmpInst(*Context, I.getPredicate(), OtherVal, > + ? ? ? ?return new ICmpInst(I.getPredicate(), OtherVal, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(A->getType())); > ? ? ? } > > @@ -6498,15 +6495,15 @@ > ? ? ? ? ? Constant *NC = > ? ? ? ? ? ? ? ? ? ?ConstantInt::get(*Context, C1->getValue() ^ C2->getValue()); > ? ? ? ? ? Instruction *Xor = BinaryOperator::CreateXor(C, NC, "tmp"); > - ? ? ? ? ?return new ICmpInst(*Context, I.getPredicate(), A, > + ? ? ? ? ?return new ICmpInst(I.getPredicate(), A, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? InsertNewInstBefore(Xor, I)); > ? ? ? ? } > > ? ? ? ? // A^B == A^D -> B == D > - ? ? ? ?if (A == C) return new ICmpInst(*Context, I.getPredicate(), B, D); > - ? ? ? ?if (A == D) return new ICmpInst(*Context, I.getPredicate(), B, C); > - ? ? ? ?if (B == C) return new ICmpInst(*Context, I.getPredicate(), A, D); > - ? ? ? ?if (B == D) return new ICmpInst(*Context, I.getPredicate(), A, C); > + ? ? ? ?if (A == C) return new ICmpInst(I.getPredicate(), B, D); > + ? ? ? ?if (A == D) return new ICmpInst(I.getPredicate(), B, C); > + ? ? ? ?if (B == C) return new ICmpInst(I.getPredicate(), A, D); > + ? ? ? ?if (B == D) return new ICmpInst(I.getPredicate(), A, C); > ? ? ? } > ? ? } > > @@ -6514,18 +6511,18 @@ > ? ? ? ? (A == Op0 || B == Op0)) { > ? ? ? // A == (A^B) ?-> ?B == 0 > ? ? ? Value *OtherVal = A == Op0 ? B : A; > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), OtherVal, > + ? ? ?return new ICmpInst(I.getPredicate(), OtherVal, > ? ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(A->getType())); > ? ? } > > ? ? // (A-B) == A ?-> ?B == 0 > ? ? if (match(Op0, m_Sub(m_Specific(Op1), m_Value(B)))) > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), B, > + ? ? ?return new ICmpInst(I.getPredicate(), B, > ? ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(B->getType())); > > ? ? // A == (A-B) ?-> ?B == 0 > ? ? if (match(Op1, m_Sub(m_Specific(Op0), m_Value(B)))) > - ? ? ?return new ICmpInst(*Context, I.getPredicate(), B, > + ? ? ?return new ICmpInst(I.getPredicate(), B, > ? ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(B->getType())); > > ? ? // (X&Z) == (Y&Z) -> (X^Y) & Z == 0 > @@ -6669,10 +6666,10 @@ > ? ? if (LoOverflow && HiOverflow) > ? ? ? return ReplaceInstUsesWith(ICI, ConstantInt::getFalse(*Context)); > ? ? else if (HiOverflow) > - ? ? ?return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SGE : > + ? ? ?return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE : > ? ? ? ? ? ? ? ? ? ? ? ? ? ICmpInst::ICMP_UGE, X, LoBound); > ? ? else if (LoOverflow) > - ? ? ?return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SLT : > + ? ? ?return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT : > ? ? ? ? ? ? ? ? ? ? ? ? ? ICmpInst::ICMP_ULT, X, HiBound); > ? ? else > ? ? ? return InsertRangeTest(X, LoBound, HiBound, DivIsSigned, true, ICI); > @@ -6680,10 +6677,10 @@ > ? ? if (LoOverflow && HiOverflow) > ? ? ? return ReplaceInstUsesWith(ICI, ConstantInt::getTrue(*Context)); > ? ? else if (HiOverflow) > - ? ? ?return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SLT : > + ? ? ?return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SLT : > ? ? ? ? ? ? ? ? ? ? ? ? ? ICmpInst::ICMP_ULT, X, LoBound); > ? ? else if (LoOverflow) > - ? ? ?return new ICmpInst(*Context, DivIsSigned ? ICmpInst::ICMP_SGE : > + ? ? ?return new ICmpInst(DivIsSigned ? ICmpInst::ICMP_SGE : > ? ? ? ? ? ? ? ? ? ? ? ? ? ICmpInst::ICMP_UGE, X, HiBound); > ? ? else > ? ? ? return InsertRangeTest(X, LoBound, HiBound, DivIsSigned, false, ICI); > @@ -6693,7 +6690,7 @@ > ? ? ? return ReplaceInstUsesWith(ICI, ConstantInt::getTrue(*Context)); > ? ? if (LoOverflow == -1) ? // Low bound is less than input range. > ? ? ? return ReplaceInstUsesWith(ICI, ConstantInt::getFalse(*Context)); > - ? ?return new ICmpInst(*Context, Pred, X, LoBound); > + ? ?return new ICmpInst(Pred, X, LoBound); > ? case ICmpInst::ICMP_UGT: > ? case ICmpInst::ICMP_SGT: > ? ? if (HiOverflow == +1) ? ? ? // High bound greater than input range. > @@ -6701,9 +6698,9 @@ > ? ? else if (HiOverflow == -1) ?// High bound less than input range. > ? ? ? return ReplaceInstUsesWith(ICI, ConstantInt::getTrue(*Context)); > ? ? if (Pred == ICmpInst::ICMP_UGT) > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_UGE, X, HiBound); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_UGE, X, HiBound); > ? ? else > - ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SGE, X, HiBound); > + ? ? ?return new ICmpInst(ICmpInst::ICMP_SGE, X, HiBound); > ? } > ?} > > @@ -6732,7 +6729,7 @@ > ? ? ? ? APInt NewRHS(RHS->getValue()); > ? ? ? ? NewRHS.zext(SrcBits); > ? ? ? ? NewRHS |= KnownOne; > - ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), LHSI->getOperand(0), > + ? ? ? ?return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, NewRHS)); > ? ? ? } > ? ? } > @@ -6761,10 +6758,10 @@ > ? ? ? ? isTrueIfPositive ^= true; > > ? ? ? ? if (isTrueIfPositive) > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SGT, CompareVal, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_SGT, CompareVal, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SubOne(RHS)); > ? ? ? ? else > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SLT, CompareVal, > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_SLT, CompareVal, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? AddOne(RHS)); > ? ? ? } > > @@ -6775,7 +6772,7 @@ > ? ? ? ? ? ICmpInst::Predicate Pred = ICI.isSignedPredicate() > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ICI.getUnsignedPredicate() > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: ICI.getSignedPredicate(); > - ? ? ? ? ?return new ICmpInst(*Context, Pred, LHSI->getOperand(0), > + ? ? ? ? ?return new ICmpInst(Pred, LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, RHSV ^ SignBit)); > ? ? ? ? } > > @@ -6786,7 +6783,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ICI.getUnsignedPredicate() > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: ICI.getSignedPredicate(); > ? ? ? ? ? Pred = ICI.getSwappedPredicate(Pred); > - ? ? ? ? ?return new ICmpInst(*Context, Pred, LHSI->getOperand(0), > + ? ? ? ? ?return new ICmpInst(Pred, LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, RHSV ^ NotSignBit)); > ? ? ? ? } > ? ? ? } > @@ -6818,7 +6815,7 @@ > ? ? ? ? ? ? BinaryOperator::CreateAnd(Cast->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ?ConstantInt::get(*Context, NewCST), LHSI->getName()); > ? ? ? ? ? InsertNewInstBefore(NewAnd, ICI); > - ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), NewAnd, > + ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), NewAnd, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, NewCI)); > ? ? ? ? } > ? ? ? } > @@ -6951,7 +6948,7 @@ > ? ? ? ? ? BinaryOperator::CreateAnd(LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Mask, LHSI->getName()+".mask"); > ? ? ? ? Value *And = InsertNewInstBefore(AndI, ICI); > - ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), And, > + ? ? ? ?return new ICmpInst(ICI.getPredicate(), And, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, RHSV.lshr(ShAmtVal))); > ? ? ? } > ? ? } > @@ -6968,8 +6965,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Mask, LHSI->getName()+".mask"); > ? ? ? Value *And = InsertNewInstBefore(AndI, ICI); > > - ? ? ?return new ICmpInst(*Context, > - ? ? ? ? ? ? ? ? ? ? ? ? ?TrueIfSigned ? ICmpInst::ICMP_NE : ICmpInst::ICMP_EQ, > + ? ? ?return new ICmpInst(TrueIfSigned ? ICmpInst::ICMP_NE : ICmpInst::ICMP_EQ, > ? ? ? ? ? ? ? ? ? ? ? ? ? And, Constant::getNullValue(And->getType())); > ? ? } > ? ? break; > @@ -7010,7 +7006,7 @@ > ? ? if (LHSI->hasOneUse() && > ? ? ? ? MaskedValueIsZero(LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? APInt::getLowBitsSet(Comp.getBitWidth(), ShAmtVal))) { > - ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), LHSI->getOperand(0), > + ? ? ?return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantExpr::getShl(RHS, ShAmt)); > ? ? } > > @@ -7023,7 +7019,7 @@ > ? ? ? ? BinaryOperator::CreateAnd(LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Mask, LHSI->getName()+".mask"); > ? ? ? Value *And = InsertNewInstBefore(AndI, ICI); > - ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), And, > + ? ? ?return new ICmpInst(ICI.getPredicate(), And, > ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantExpr::getShl(RHS, ShAmt)); > ? ? } > ? ? break; > @@ -7056,18 +7052,18 @@ > > ? ? ? if (ICI.isSignedPredicate()) { > ? ? ? ? if (CR.getLower().isSignBit()) { > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SLT, LHSI->getOperand(0), > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_SLT, LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, CR.getUpper())); > ? ? ? ? } else if (CR.getUpper().isSignBit()) { > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_SGE, LHSI->getOperand(0), > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_SGE, LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, CR.getLower())); > ? ? ? ? } > ? ? ? } else { > ? ? ? ? if (CR.getLower().isMinValue()) { > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_ULT, LHSI->getOperand(0), > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, CR.getUpper())); > ? ? ? ? } else if (CR.getUpper().isMinValue()) { > - ? ? ? ? ?return new ICmpInst(*Context, ICmpInst::ICMP_UGE, LHSI->getOperand(0), > + ? ? ? ? ?return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantInt::get(*Context, CR.getLower())); > ? ? ? ? } > ? ? ? } > @@ -7092,7 +7088,7 @@ > ? ? ? ? ? ? ? BinaryOperator::CreateURem(BO->getOperand(0), BO->getOperand(1), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?BO->getName()); > ? ? ? ? ? ? InsertNewInstBefore(NewRem, ICI); > - ? ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), NewRem, > + ? ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), NewRem, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(BO->getType())); > ? ? ? ? ? } > ? ? ? ? } > @@ -7101,7 +7097,7 @@ > ? ? ? ? // Replace ((add A, B) != C) with (A != C-B) if B & C are constants. > ? ? ? ? if (ConstantInt *BOp1C = dyn_cast(BO->getOperand(1))) { > ? ? ? ? ? if (BO->hasOneUse()) > - ? ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), BO->getOperand(0), > + ? ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantExpr::getSub(RHS, BOp1C)); > ? ? ? ? } else if (RHSV == 0) { > ? ? ? ? ? // Replace ((add A, B) != 0) with (A != -B) if A or B is > @@ -7109,14 +7105,14 @@ > ? ? ? ? ? Value *BOp0 = BO->getOperand(0), *BOp1 = BO->getOperand(1); > > ? ? ? ? ? if (Value *NegVal = dyn_castNegVal(BOp1)) > - ? ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), BOp0, NegVal); > + ? ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), BOp0, NegVal); > ? ? ? ? ? else if (Value *NegVal = dyn_castNegVal(BOp0)) > - ? ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), NegVal, BOp1); > + ? ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), NegVal, BOp1); > ? ? ? ? ? else if (BO->hasOneUse()) { > ? ? ? ? ? ? Instruction *Neg = BinaryOperator::CreateNeg(BOp1); > ? ? ? ? ? ? InsertNewInstBefore(Neg, ICI); > ? ? ? ? ? ? Neg->takeName(BO); > - ? ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), BOp0, Neg); > + ? ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), BOp0, Neg); > ? ? ? ? ? } > ? ? ? ? } > ? ? ? ? break; > @@ -7124,14 +7120,14 @@ > ? ? ? ? // For the xor case, we can xor two constants together, eliminating > ? ? ? ? // the explicit xor. > ? ? ? ? if (Constant *BOC = dyn_cast(BO->getOperand(1))) > - ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), BO->getOperand(0), > + ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ConstantExpr::getXor(RHS, BOC)); > > ? ? ? ? // FALLTHROUGH > ? ? ? case Instruction::Sub: > ? ? ? ? // Replace (([sub|xor] A, B) != 0) with (A != B) > ? ? ? ? if (RHSV == 0) > - ? ? ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), BO->getOperand(0), > + ? ? ? ? ?return new ICmpInst(ICI.getPredicate(), BO->getOperand(0), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BO->getOperand(1)); > ? ? ? ? break; > > @@ -7158,7 +7154,7 @@ > > ? ? ? ? ? // If we have ((X & C) == C), turn it into ((X & C) != 0). > ? ? ? ? ? if (RHS == BOC && RHSV.isPowerOf2()) > - ? ? ? ? ? ?return new ICmpInst(*Context, isICMP_NE ? ICmpInst::ICMP_EQ : > + ? ? ? ? ? ?return new ICmpInst(isICMP_NE ? ICmpInst::ICMP_EQ : > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ICmpInst::ICMP_NE, LHSI, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Constant::getNullValue(RHS->getType())); > > @@ -7168,7 +7164,7 @@ > ? ? ? ? ? ? Constant *Zero = Constant::getNullValue(X->getType()); > ? ? ? ? ? ? ICmpInst::Predicate pred = isICMP_NE ? > ? ? ? ? ? ? ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_SGE; > - ? ? ? ? ? ?return new ICmpInst(*Context, pred, X, Zero); > + ? ? ? ? ? ?return new ICmpInst(pred, X, Zero); > ? ? ? ? ? } > > ? ? ? ? ? // ((X & ~7) == 0) --> X < 8 > @@ -7177,7 +7173,7 @@ > ? ? ? ? ? ? Constant *NegX = ConstantExpr::getNeg(BOC); > ? ? ? ? ? ? ICmpInst::Predicate pred = isICMP_NE ? > ? ? ? ? ? ? ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_ULT; > - ? ? ? ? ? ?return new ICmpInst(*Context, pred, X, NegX); > + ? ? ? ? ? ?return new ICmpInst(pred, X, NegX); > ? ? ? ? ? } > ? ? ? ? } > ? ? ? default: break; > @@ -7221,7 +7217,7 @@ > ? ? } > > ? ? if (RHSOp) > - ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, RHSOp); > + ? ? ?return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSOp); > ? } > > ? // The code below only handles extension cast instructions, so far. > @@ -7246,15 +7242,15 @@ > > ? ? // Deal with equality cases early. > ? ? if (ICI.isEquality()) > - ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, RHSCIOp); > + ? ? ?return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); > > ? ? // A signed comparison of sign extended values simplifies into a > ? ? // signed comparison. > ? ? if (isSignedCmp && isSignedExt) > - ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, RHSCIOp); > + ? ? ?return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); > > ? ? // The other three cases all fold into an unsigned comparison. > - ? ?return new ICmpInst(*Context, ICI.getUnsignedPredicate(), LHSCIOp, RHSCIOp); > + ? ?return new ICmpInst(ICI.getUnsignedPredicate(), LHSCIOp, RHSCIOp); > ? } > > ? // If we aren't dealing with a constant on the RHS, exit early > @@ -7281,7 +7277,7 @@ > ? ? // However, we allow this when the compare is EQ/NE, because they are > ? ? // signless. > ? ? if (isSignedExt == isSignedCmp || ICI.isEquality()) > - ? ? ?return new ICmpInst(*Context, ICI.getPredicate(), LHSCIOp, Res1); > + ? ? ?return new ICmpInst(ICI.getPredicate(), LHSCIOp, Res1); > ? ? return 0; > ? } > > @@ -7310,7 +7306,7 @@ > ? ? ? // We're performing an unsigned comp with a sign extended value. > ? ? ? // This is true if the input is >= 0. [aka >s -1] > ? ? ? Constant *NegOne = Constant::getAllOnesValue(SrcTy); > - ? ? ?Result = InsertNewInstBefore(new ICmpInst(*Context, ICmpInst::ICMP_SGT, > + ? ? ?Result = InsertNewInstBefore(new ICmpInst(ICmpInst::ICMP_SGT, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?LHSCIOp, NegOne, ICI.getName()), ICI); > ? ? } else { > ? ? ? // Unsigned extend & unsigned compare -> always true. > @@ -8492,7 +8488,7 @@ > ? ? Constant *One = ConstantInt::get(Src->getType(), 1); > ? ? Src = InsertNewInstBefore(BinaryOperator::CreateAnd(Src, One, "tmp"), CI); > ? ? Value *Zero = Constant::getNullValue(Src->getType()); > - ? ?return new ICmpInst(*Context, ICmpInst::ICMP_NE, Src, Zero); > + ? ?return new ICmpInst(ICmpInst::ICMP_NE, Src, Zero); > ? } > > ? // Optimize trunc(lshr(), c) to pull the shift through the truncate. > @@ -10593,7 +10589,7 @@ > ? if (BinaryOperator *BinOp = dyn_cast(FirstInst)) > ? ? return BinaryOperator::Create(BinOp->getOpcode(), LHSVal, RHSVal); > ? CmpInst *CIOp = cast(FirstInst); > - ?return CmpInst::Create(*Context, CIOp->getOpcode(), CIOp->getPredicate(), > + ?return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ?LHSVal, RHSVal); > ?} > > @@ -10844,7 +10840,7 @@ > ? if (BinaryOperator *BinOp = dyn_cast(FirstInst)) > ? ? return BinaryOperator::Create(BinOp->getOpcode(), PhiVal, ConstantOp); > ? if (CmpInst *CIOp = dyn_cast(FirstInst)) > - ? ?return CmpInst::Create(*Context, CIOp->getOpcode(), CIOp->getPredicate(), > + ? ?return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ?PhiVal, ConstantOp); > ? assert(isa(FirstInst) && "Unknown operation"); > > > Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Tue Aug 25 18:17:54 2009 > @@ -159,7 +159,7 @@ > ? Function::iterator FI = OrigBlock; > ? F->getBasicBlockList().insert(++FI, NewNode); > > - ?ICmpInst* Comp = new ICmpInst(Default->getContext(), ICmpInst::ICMP_SLT, > + ?ICmpInst* Comp = new ICmpInst(ICmpInst::ICMP_SLT, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Val, Pivot.Low, "Pivot"); > ? NewNode->getInstList().push_back(Comp); > ? BranchInst::Create(LBranch, RBranch, Comp, NewNode); > > Modified: llvm/trunk/lib/VMCore/Instructions.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=80049&r1=80048&r2=80049&view=diff > > ============================================================================== > --- llvm/trunk/lib/VMCore/Instructions.cpp (original) > +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Aug 25 18:17:54 2009 > @@ -2506,7 +2506,7 @@ > ?} > > ?CmpInst * > -CmpInst::Create(LLVMContext &Context, OtherOps Op, unsigned short predicate, > +CmpInst::Create(OtherOps Op, unsigned short predicate, > ? ? ? ? ? ? ? ? Value *S1, Value *S2, > ? ? ? ? ? ? ? ? const Twine &Name, Instruction *InsertBefore) { > ? if (Op == Instruction::ICmp) { > @@ -2514,7 +2514,7 @@ > ? ? ? return new ICmpInst(InsertBefore, CmpInst::Predicate(predicate), > ? ? ? ? ? ? ? ? ? ? ? ? ? S1, S2, Name); > ? ? else > - ? ? ?return new ICmpInst(Context, CmpInst::Predicate(predicate), > + ? ? ?return new ICmpInst(CmpInst::Predicate(predicate), > ? ? ? ? ? ? ? ? ? ? ? ? ? S1, S2, Name); > ? } > > @@ -2522,7 +2522,7 @@ > ? ? return new FCmpInst(InsertBefore, CmpInst::Predicate(predicate), > ? ? ? ? ? ? ? ? ? ? ? ? S1, S2, Name); > ? else > - ? ?return new FCmpInst(Context, CmpInst::Predicate(predicate), > + ? ?return new FCmpInst(CmpInst::Predicate(predicate), > ? ? ? ? ? ? ? ? ? ? ? ? S1, S2, Name); > ?} > > @@ -2875,12 +2875,12 @@ > ?} > > ?FCmpInst* FCmpInst::clone(LLVMContext &Context) const { > - ?FCmpInst *New = new FCmpInst(Context, getPredicate(), Op<0>(), Op<1>()); > + ?FCmpInst *New = new FCmpInst(getPredicate(), Op<0>(), Op<1>()); > ? New->SubclassOptionalData = SubclassOptionalData; > ? return New; > ?} > ?ICmpInst* ICmpInst::clone(LLVMContext &Context) const { > - ?ICmpInst *New = new ICmpInst(Context, getPredicate(), Op<0>(), Op<1>()); > + ?ICmpInst *New = new ICmpInst(getPredicate(), Op<0>(), Op<1>()); > ? New->SubclassOptionalData = SubclassOptionalData; > ? return New; > ?} > > > _______________________________________________ > 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 Aug 25 18:43:17 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 25 Aug 2009 16:43:17 -0700 Subject: [llvm-commits] [llvm] r80049 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instructions.h include/llvm/Support/IRBuilder.h lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/Transforms/Scalar/CodeGenPrepare.cpp lib/Tra In-Reply-To: <9a9942200908251638k23a215bfr39da97b073191aa9@mail.gmail.com> References: <9a9942200908251638k23a215bfr39da97b073191aa9@mail.gmail.com> Message-ID: <71BDB1A3-8FC0-4A99-9054-24FE34CF7C6F@apple.com> On Aug 25, 2009, at 4:38 PM, Reid Kleckner wrote: > Please also fix the CPPBackend to use the correct constructor. I > fixed it the other direction. :) Thanks for the reminder, though the CppBackend isn't affected by this change. It uses a different form of the constructor. Dan From daniel at zuster.org Tue Aug 25 19:10:55 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 00:10:55 -0000 Subject: [llvm-commits] [llvm] r80057 - /llvm/trunk/include/llvm/MC/MCSymbol.h Message-ID: <200908260010.n7Q0AttH003720@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 19:10:55 2009 New Revision: 80057 URL: http://llvm.org/viewvc/llvm-project?rev=80057&view=rev Log: llvm-mc: Add MCSection::isDefined() Modified: llvm/trunk/include/llvm/MC/MCSymbol.h Modified: llvm/trunk/include/llvm/MC/MCSymbol.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=80057&r1=80056&r2=80057&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCSymbol.h (original) +++ llvm/trunk/include/llvm/MC/MCSymbol.h Tue Aug 25 19:10:55 2009 @@ -63,9 +63,16 @@ /// @name Symbol Type /// @{ + /// isDefined - Check if this symbol is defined (i.e., it has an address). + /// + /// Defined symbols are either absolute or in some section. + bool isDefined() const { + return Section != 0; + } + /// isUndefined - Check if this symbol undefined (i.e., implicitly defined). bool isUndefined() const { - return Section == 0; + return !isDefined(); } /// isAbsolute - Check if this this is an absolute symbol. From gohman at apple.com Tue Aug 25 19:13:22 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 26 Aug 2009 00:13:22 -0000 Subject: [llvm-commits] [llvm] r80058 - in /llvm/trunk/lib/Transforms/Scalar: GVNPRE.cpp InstructionCombining.cpp Message-ID: <200908260013.n7Q0DNsT004035@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 25 19:13:22 2009 New Revision: 80058 URL: http://llvm.org/viewvc/llvm-project?rev=80058&view=rev Log: Remove unused variables. Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=80058&r1=80057&r2=80058&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Tue Aug 25 19:13:22 2009 @@ -800,8 +800,6 @@ Value* GVNPRE::phi_translate(Value* V, BasicBlock* pred, BasicBlock* succ) { if (V == 0) return 0; - - LLVMContext &Context = V->getContext(); // Unary Operations if (CastInst* U = dyn_cast(V)) { @@ -1597,7 +1595,6 @@ void GVNPRE::insertion_pre(Value* e, BasicBlock* BB, DenseMap& avail, std::map& new_sets) { - LLVMContext &Context = e->getContext(); for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI) { Value* e2 = avail[*PI]; if (!availableOut[*PI].test(VN.lookup(e2))) { Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=80058&r1=80057&r2=80058&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Aug 25 19:13:22 2009 @@ -1870,8 +1870,6 @@ static Value *FoldOperationIntoSelectOperand(Instruction &I, Value *SO, InstCombiner *IC) { - LLVMContext *Context = IC->getContext(); - if (CastInst *CI = dyn_cast(&I)) { return IC->InsertCastBefore(CI->getOpcode(), SO, I.getType(), I); } From daniel at zuster.org Tue Aug 25 19:18:21 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 00:18:21 -0000 Subject: [llvm-commits] [llvm] r80059 - in /llvm/trunk: lib/MC/MCAssembler.cpp lib/MC/MCMachOStreamer.cpp test/MC/MachO/symbol-indirect.s Message-ID: <200908260018.n7Q0IL9P004642@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 19:18:21 2009 New Revision: 80059 URL: http://llvm.org/viewvc/llvm-project?rev=80059&view=rev Log: llvm-mc: Improve indirect symbol support (add the indirect index table). Added: llvm/trunk/test/MC/MachO/symbol-indirect.s Modified: llvm/trunk/lib/MC/MCAssembler.cpp llvm/trunk/lib/MC/MCMachOStreamer.cpp Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=80059&r1=80058&r2=80059&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Tue Aug 25 19:18:21 2009 @@ -70,6 +70,13 @@ STF_PrivateExtern = 0x10 }; + /// IndirectSymbolFlags - Flags for encoding special values in the indirect + /// symbol entry. + enum IndirectSymbolFlags { + ISF_Local = 0x80000000, + ISF_Absolute = 0x40000000 + }; + /// MachSymbolData - Helper struct for containing some precomputed information /// on symbols. struct MachSymbolData { @@ -315,7 +322,8 @@ Write32(0); // FIXME: Value } - void BindIndirectSymbols(MCAssembler &Asm) { + void BindIndirectSymbols(MCAssembler &Asm, + DenseMap &SymbolMap) { // This is the point where 'as' creates actual symbols for indirect symbols // (in the following two passes). It would be easier for us to do this // sooner when we see the attribute, but that makes getting the order in the @@ -323,13 +331,6 @@ // // FIXME: Revisit this when the dust settles. - // FIXME: This should not be needed. - DenseMap SymbolMap; - - for (MCAssembler::symbol_iterator it = Asm.symbol_begin(), - ie = Asm.symbol_end(); it != ie; ++it) - SymbolMap[&it->getSymbol()] = it; - // Bind non lazy symbol pointers first. for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(), ie = Asm.indirect_symbol_end(); it != ie; ++it) { @@ -474,7 +475,16 @@ void WriteObject(MCAssembler &Asm) { unsigned NumSections = Asm.size(); - BindIndirectSymbols(Asm); + // Compute the symbol -> symbol data map. + // + // FIXME: This should not be here. + DenseMap SymbolMap; + for (MCAssembler::symbol_iterator it = Asm.symbol_begin(), + ie = Asm.symbol_end(); it != ie; ++it) + SymbolMap[&it->getSymbol()] = it; + + // Create symbol data for any indirect symbols. + BindIndirectSymbols(Asm, SymbolMap); // Compute symbol table information. SmallString<256> StringTable; @@ -567,11 +577,47 @@ // Write the symbol table data, if used. if (NumSymbols) { + // FIXME: We shouldn't need this index table. + DenseMap SymbolIndexMap; + for (unsigned i = 0, e = LocalSymbolData.size(); i != e; ++i) { + MCSymbol &Symbol = LocalSymbolData[i].SymbolData->getSymbol(); + SymbolIndexMap.insert(std::make_pair(&Symbol, SymbolIndexMap.size())); + } + for (unsigned i = 0, e = ExternalSymbolData.size(); i != e; ++i) { + MCSymbol &Symbol = ExternalSymbolData[i].SymbolData->getSymbol(); + SymbolIndexMap.insert(std::make_pair(&Symbol, SymbolIndexMap.size())); + } + for (unsigned i = 0, e = UndefinedSymbolData.size(); i != e; ++i) { + MCSymbol &Symbol = UndefinedSymbolData[i].SymbolData->getSymbol(); + SymbolIndexMap.insert(std::make_pair(&Symbol, SymbolIndexMap.size())); + } + // Write the indirect symbol entries. // // FIXME: We need the symbol index map for this. - for (unsigned i = 0, e = Asm.indirect_symbol_size(); i != e; ++i) - Write32(0); + for (MCAssembler::indirect_symbol_iterator + it = Asm.indirect_symbol_begin(), + ie = Asm.indirect_symbol_end(); it != ie; ++it) { + // Indirect symbols in the non lazy symbol pointer section have some + // special handling. + const MCSectionMachO &Section = + static_cast(it->SectionData->getSection()); + unsigned Type = + Section.getTypeAndAttributes() & MCSectionMachO::SECTION_TYPE; + if (Type == MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS) { + // If this symbol is defined and internal, mark it as such. + if (it->Symbol->isDefined() && + !SymbolMap.lookup(it->Symbol)->isExternal()) { + uint32_t Flags = ISF_Local; + if (it->Symbol->isAbsolute()) + Flags |= ISF_Absolute; + Write32(Flags); + continue; + } + } + + Write32(SymbolIndexMap[it->Symbol]); + } // FIXME: Check that offsets match computed ones. Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=80059&r1=80058&r2=80059&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Tue Aug 25 19:18:21 2009 @@ -168,6 +168,8 @@ // Indirect symbols are handled differently, to match how 'as' handles // them. This makes writing matching .o files easier. if (Attribute == MCStreamer::IndirectSymbol) { + // Note that we intentionally cannot use the symbol data here; this is + // important for matching the string table that 'as' generates. IndirectSymbolData ISD; ISD.Symbol = Symbol; ISD.SectionData = CurSectionData; Added: llvm/trunk/test/MC/MachO/symbol-indirect.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/symbol-indirect.s?rev=80059&view=auto ============================================================================== --- llvm/trunk/test/MC/MachO/symbol-indirect.s (added) +++ llvm/trunk/test/MC/MachO/symbol-indirect.s Tue Aug 25 19:18:21 2009 @@ -0,0 +1,273 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s + +// FIXME: We are missing a lot of diagnostics on this kind of stuff which the +// assembler has. + + .lazy_symbol_pointer + .indirect_symbol sym_lsp_B + .long 0 + + .globl sym_lsp_A + .indirect_symbol sym_lsp_A + .long 0 + +sym_lsp_C: + .indirect_symbol sym_lsp_C + .long 0 + +// FIXME: Enable this test once missing llvm-mc support is in place. +.if 0 + .indirect_symbol sym_lsp_D + .long sym_lsp_D +.endif + + .indirect_symbol sym_lsp_E + .long 0xFA + +// FIXME: Enable this test once missing llvm-mc support is in place. +.if 0 +sym_lsp_F = 10 + .indirect_symbol sym_lsp_F + .long 0 +.endif + + .globl sym_lsp_G +sym_lsp_G: + .indirect_symbol sym_lsp_G + .long 0 + + .non_lazy_symbol_pointer + .indirect_symbol sym_nlp_B + .long 0 + + .globl sym_nlp_A + .indirect_symbol sym_nlp_A + .long 0 + +sym_nlp_C: + .indirect_symbol sym_nlp_C + .long 0 + +// FIXME: Enable this test once missing llvm-mc support is in place. +.if 0 + .indirect_symbol sym_nlp_D + .long sym_nlp_D +.endif + + .indirect_symbol sym_nlp_E + .long 0xAF + +// FIXME: Enable this test once missing llvm-mc support is in place. +.if 0 +sym_nlp_F = 10 + .indirect_symbol sym_nlp_F + .long 0 +.endif + + .globl sym_nlp_G +sym_nlp_G: + .indirect_symbol sym_nlp_G + .long 0 + +// CHECK: ('cputype', 7) +// CHECK: ('cpusubtype', 3) +// CHECK: ('filetype', 1) +// CHECK: ('num_load_commands', 1) +// CHECK: ('load_commands_size', 364) +// CHECK: ('flag', 0) +// CHECK: ('load_commands', [ +// CHECK: # Load Command 0 +// CHECK: (('command', 1) +// CHECK: ('size', 260) +// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('vm_addr', 0) +// CHECK: ('vm_size', 40) +// CHECK: ('file_offset', 392) +// CHECK: ('file_size', 40) +// CHECK: ('maxprot', 7) +// CHECK: ('initprot', 7) +// CHECK: ('num_sections', 3) +// CHECK: ('flags', 0) +// CHECK: ('sections', [ +// CHECK: # Section 0 +// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 0) +// CHECK: ('offset', 392) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x80000000) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: # Section 1 +// CHECK: (('section_name', '__la_symbol_ptr\x00') +// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 20) +// CHECK: ('offset', 392) +// CHECK: ('alignment', 2) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x7) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: # Section 2 +// CHECK: (('section_name', '__nl_symbol_ptr\x00') +// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') + // FIXME: Enable this when fixed! +// CHECX: ('address', 20) +// CHECK: ('size', 20) +// CHECK: ('offset', 412) +// CHECK: ('alignment', 2) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x6) + // FIXME: Enable this when fixed! +// CHECX: ('reserved1', 5) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 1 +// CHECK: (('command', 2) +// CHECK: ('size', 24) +// CHECK: ('symoff', 472) +// CHECK: ('nsyms', 10) +// CHECK: ('stroff', 592) +// CHECK: ('strsize', 104) +// CHECK: ('_string_data', '\x00sym_lsp_A\x00sym_lsp_G\x00sym_nlp_A\x00sym_nlp_G\x00sym_nlp_B\x00sym_nlp_E\x00sym_lsp_B\x00sym_lsp_E\x00sym_lsp_C\x00sym_nlp_C\x00\x00\x00\x00') +// CHECK: ('_symbols', [ +// CHECK: # Symbol 0 +// CHECK: (('n_strx', 81) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) + // FIXME: Enable this when fixed! +// CHECX: ('n_value', 8) +// CHECK: ('_string', 'sym_lsp_C') +// CHECK: ), +// CHECK: # Symbol 1 +// CHECK: (('n_strx', 91) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 3) +// CHECK: ('n_desc', 0) + // FIXME: Enable this when fixed! +// CHECX: ('n_value', 28) +// CHECK: ('_string', 'sym_nlp_C') +// CHECK: ), +// CHECK: # Symbol 2 +// CHECK: (('n_strx', 11) +// CHECK: ('n_type', 0xf) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) + // FIXME: Enable this when fixed! +// CHECX: ('n_value', 16) +// CHECK: ('_string', 'sym_lsp_G') +// CHECK: ), +// CHECK: # Symbol 3 +// CHECK: (('n_strx', 31) +// CHECK: ('n_type', 0xf) +// CHECK: ('n_sect', 3) +// CHECK: ('n_desc', 0) + // FIXME: Enable this when fixed! +// CHECX: ('n_value', 36) +// CHECK: ('_string', 'sym_nlp_G') +// CHECK: ), +// CHECK: # Symbol 4 +// CHECK: (('n_strx', 1) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_lsp_A') +// CHECK: ), +// CHECK: # Symbol 5 +// CHECK: (('n_strx', 61) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 1) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_lsp_B') +// CHECK: ), +// CHECK: # Symbol 6 +// CHECK: (('n_strx', 71) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 1) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_lsp_E') +// CHECK: ), +// CHECK: # Symbol 7 +// CHECK: (('n_strx', 21) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_nlp_A') +// CHECK: ), +// CHECK: # Symbol 8 +// CHECK: (('n_strx', 41) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_nlp_B') +// CHECK: ), +// CHECK: # Symbol 9 +// CHECK: (('n_strx', 51) +// CHECK: ('n_type', 0x1) +// CHECK: ('n_sect', 0) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'sym_nlp_E') +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 2 +// CHECK: (('command', 11) +// CHECK: ('size', 80) +// CHECK: ('ilocalsym', 0) +// CHECK: ('nlocalsym', 2) +// CHECK: ('iextdefsym', 2) +// CHECK: ('nextdefsym', 2) +// CHECK: ('iundefsym', 4) +// CHECK: ('nundefsym', 6) +// CHECK: ('tocoff', 0) +// CHECK: ('ntoc', 0) +// CHECK: ('modtaboff', 0) +// CHECK: ('nmodtab', 0) +// CHECK: ('extrefsymoff', 0) +// CHECK: ('nextrefsyms', 0) +// CHECK: ('indirectsymoff', 432) +// CHECK: ('nindirectsyms', 10) +// CHECK: ('extreloff', 0) +// CHECK: ('nextrel', 0) +// CHECK: ('locreloff', 0) +// CHECK: ('nlocrel', 0) +// CHECK: ('_indirect_symbols', [ +// CHECK: # Indirect Symbol 0 +// CHECK: (('symbol_index', 5),), +// CHECK: # Indirect Symbol 1 +// CHECK: (('symbol_index', 4),), +// CHECK: # Indirect Symbol 2 +// CHECK: (('symbol_index', 0),), +// CHECK: # Indirect Symbol 3 +// CHECK: (('symbol_index', 6),), +// CHECK: # Indirect Symbol 4 +// CHECK: (('symbol_index', 2),), +// CHECK: # Indirect Symbol 5 +// CHECK: (('symbol_index', 8),), +// CHECK: # Indirect Symbol 6 +// CHECK: (('symbol_index', 7),), +// CHECK: # Indirect Symbol 7 +// CHECK: (('symbol_index', 2147483648),), +// CHECK: # Indirect Symbol 8 +// CHECK: (('symbol_index', 9),), +// CHECK: # Indirect Symbol 9 +// CHECK: (('symbol_index', 3),), +// CHECK: ]) +// CHECK: ), +// CHECK: ]) From dpatel at apple.com Tue Aug 25 19:39:51 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 26 Aug 2009 00:39:51 -0000 Subject: [llvm-commits] [llvm] r80061 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <200908260039.n7Q0dp98007400@zion.cs.uiuc.edu> Author: dpatel Date: Tue Aug 25 19:39:50 2009 New Revision: 80061 URL: http://llvm.org/viewvc/llvm-project?rev=80061&view=rev Log: Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute. Patch by Caroline Tice. Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=80061&r1=80060&r2=80061&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Aug 25 19:39:50 2009 @@ -173,7 +173,8 @@ enum { FlagPrivate = 1 << 0, FlagProtected = 1 << 1, - FlagFwdDecl = 1 << 2 + FlagFwdDecl = 1 << 2, + FlagClosure = 1 << 3 }; protected: @@ -226,6 +227,9 @@ bool isForwardDecl() const { return (getFlags() & FlagFwdDecl) != 0; } + bool isClosure() const { + return (getFlags() & FlagClosure) != 0; + } /// dump - print type. void dump() const; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=80061&r1=80060&r2=80061&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Aug 25 19:39:50 2009 @@ -695,10 +695,7 @@ Buffer.AddChild(ElemDie); } - // FIXME: We'd like an API to register additional attributes for the - // frontend to use while synthesizing, and then we'd use that api in clang - // instead of this. - if (Name == "__block_literal_generic") + if (CTy.isClosure()) AddUInt(&Buffer, dwarf::DW_AT_APPLE_block, dwarf::DW_FORM_flag, 1); unsigned RLang = CTy.getRunTimeLang(); From dpatel at apple.com Tue Aug 25 19:41:19 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 26 Aug 2009 00:41:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r80062 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <200908260041.n7Q0fJRH007596@zion.cs.uiuc.edu> Author: dpatel Date: Tue Aug 25 19:41:19 2009 New Revision: 80062 URL: http://llvm.org/viewvc/llvm-project?rev=80062&view=rev Log: set llvm::DIType::FlagClosure for BLOCK structs. Patch by Caroline Tice. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=80062&r1=80061&r2=80062&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue Aug 25 19:41:19 2009 @@ -584,13 +584,16 @@ if (TYPE_CONTEXT(type)) FwdName = GetNodeName(TYPE_CONTEXT(type)); FwdName = FwdName + GetNodeName(type); + unsigned Flags = llvm::DIType::FlagFwdDecl; + if (TYPE_BLOCK_IMPL_STRUCT(type)) + Flags |= llvm::DIType::FlagClosure; llvm::DICompositeType FwdDecl = DebugFactory.CreateCompositeType(Tag, findRegion(type), FwdName, getOrCreateCompileUnit(Loc.file), Loc.line, - 0, 0, 0, llvm::DIType::FlagFwdDecl, + 0, 0, 0, Flags, llvm::DIType(), llvm::DIArray(), RunTimeLang); @@ -699,7 +702,7 @@ getOrCreateCompileUnit(Loc.file), Loc.line, NodeSizeInBits(type), NodeAlignInBits(type), - 0, 0, llvm::DIType(), Elements, + 0, Flags, llvm::DIType(), Elements, RunTimeLang); // Now that we have a real decl for the struct, replace anything using the @@ -803,10 +806,17 @@ case POINTER_TYPE: case REFERENCE_TYPE: - case BLOCK_POINTER_TYPE: Ty = createPointerType(type); break; - + + case BLOCK_POINTER_TYPE: { + DEBUGASSERT (generic_block_literal_struct_type && + "Generic struct type for Blocks is missing!"); + tree tmp_type = build_pointer_type(generic_block_literal_struct_type); + Ty = createPointerType(tmp_type); + break; + } + case OFFSET_TYPE: { // gen_type_die(TYPE_OFFSET_BASETYPE(type), context_die); // gen_type_die(TREE_TYPE(type), context_die); From dalej at apple.com Tue Aug 25 20:08:21 2009 From: dalej at apple.com (Dale Johannesen) Date: Wed, 26 Aug 2009 01:08:21 -0000 Subject: [llvm-commits] [llvm] r80063 - in /llvm/trunk: docs/LangRef.html include/llvm-c/Core.h include/llvm/Attributes.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/Target/CppBackend/CPPBackend.cpp lib/VMCore/Attributes.cpp utils/llvm.grm utils/vim/llvm.vim Message-ID: <200908260108.n7Q18Mk0011167@zion.cs.uiuc.edu> Author: johannes Date: Tue Aug 25 20:08:21 2009 New Revision: 80063 URL: http://llvm.org/viewvc/llvm-project?rev=80063&view=rev Log: Add an 'inline hint' attribute to represent source code hints that it would be a good idea to inline a function ("inline" keyword). No functional change yet; FEs do not emit this and inliner does not use it. Modified: llvm/trunk/docs/LangRef.html llvm/trunk/include/llvm-c/Core.h llvm/trunk/include/llvm/Attributes.h llvm/trunk/lib/AsmParser/LLLexer.cpp llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/AsmParser/LLToken.h llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/VMCore/Attributes.cpp llvm/trunk/utils/llvm.grm llvm/trunk/utils/vim/llvm.vim Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Aug 25 20:08:21 2009 @@ -1042,6 +1042,11 @@ function into callers whenever possible, ignoring any active inlining size threshold for this caller. +
inlinehint
+
This attribute indicates that the source code contained a hint that inlining + this function is desirable (such as the "inline" keyword in C/C++). It + is just a hint; it imposes no requirements on the inliner.
+
noinline
This attribute indicates that the inliner should never inline this function in any situation. This attribute may not be used together with Modified: llvm/trunk/include/llvm-c/Core.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/include/llvm-c/Core.h (original) +++ llvm/trunk/include/llvm-c/Core.h Tue Aug 25 20:08:21 2009 @@ -109,7 +109,8 @@ LLVMNoCaptureAttribute = 1<<21, LLVMNoRedZoneAttribute = 1<<22, LLVMNoImplicitFloatAttribute = 1<<23, - LLVMNakedAttribute = 1<<24 + LLVMNakedAttribute = 1<<24, + LLVMInlineHintAttribute = 1<<25 } LLVMAttribute; typedef enum { Modified: llvm/trunk/include/llvm/Attributes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Attributes.h?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/include/llvm/Attributes.h (original) +++ llvm/trunk/include/llvm/Attributes.h Tue Aug 25 20:08:21 2009 @@ -57,7 +57,8 @@ const Attributes NoRedZone = 1<<22; /// disable redzone const Attributes NoImplicitFloat = 1<<23; /// disable implicit floating point /// instructions. -const Attributes Naked = 1<<24; ///< Naked function +const Attributes Naked = 1<<24; ///< Naked function +const Attributes InlineHint = 1<<25; ///< source said inlining was desirable /// @brief Attributes that only apply to function parameters. const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture; @@ -66,7 +67,7 @@ /// be used on return values or function parameters. const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly | NoInline | AlwaysInline | OptimizeForSize | StackProtect | StackProtectReq | - NoRedZone | NoImplicitFloat | Naked; + NoRedZone | NoImplicitFloat | Naked | InlineHint; /// @brief Parameter attributes that do not apply to vararg call arguments. const Attributes VarArgsIncompatible = StructRet; Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Tue Aug 25 20:08:21 2009 @@ -556,6 +556,7 @@ KEYWORD(readnone); KEYWORD(readonly); + KEYWORD(inlinehint); KEYWORD(noinline); KEYWORD(alwaysinline); KEYWORD(optsize); Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Aug 25 20:08:21 2009 @@ -907,6 +907,7 @@ case lltok::kw_noinline: Attrs |= Attribute::NoInline; break; case lltok::kw_readnone: Attrs |= Attribute::ReadNone; break; case lltok::kw_readonly: Attrs |= Attribute::ReadOnly; break; + case lltok::kw_inlinehint: Attrs |= Attribute::InlineHint; break; case lltok::kw_alwaysinline: Attrs |= Attribute::AlwaysInline; break; case lltok::kw_optsize: Attrs |= Attribute::OptimizeForSize; break; case lltok::kw_ssp: Attrs |= Attribute::StackProtect; break; Modified: llvm/trunk/lib/AsmParser/LLToken.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLToken.h (original) +++ llvm/trunk/lib/AsmParser/LLToken.h Tue Aug 25 20:08:21 2009 @@ -82,6 +82,7 @@ kw_readnone, kw_readonly, + kw_inlinehint, kw_noinline, kw_alwaysinline, kw_optsize, Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Tue Aug 25 20:08:21 2009 @@ -472,6 +472,7 @@ HANDLE_ATTR(Nest); HANDLE_ATTR(ReadNone); HANDLE_ATTR(ReadOnly); + HANDLE_ATTR(InlineHint); HANDLE_ATTR(NoInline); HANDLE_ATTR(AlwaysInline); HANDLE_ATTR(OptimizeForSize); Modified: llvm/trunk/lib/VMCore/Attributes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Attributes.cpp?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Attributes.cpp (original) +++ llvm/trunk/lib/VMCore/Attributes.cpp Tue Aug 25 20:08:21 2009 @@ -55,6 +55,8 @@ Result += "optsize "; if (Attrs & Attribute::NoInline) Result += "noinline "; + if (Attrs & Attribute::InlineHint) + Result += "inlinehint "; if (Attrs & Attribute::AlwaysInline) Result += "alwaysinline "; if (Attrs & Attribute::StackProtect) Modified: llvm/trunk/utils/llvm.grm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm.grm?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/utils/llvm.grm (original) +++ llvm/trunk/utils/llvm.grm Tue Aug 25 20:08:21 2009 @@ -161,6 +161,7 @@ | signext | readnone | readonly + | inlinehint | noinline | alwaysinline | optsize Modified: llvm/trunk/utils/vim/llvm.vim URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/llvm.vim?rev=80063&r1=80062&r2=80063&view=diff ============================================================================== --- llvm/trunk/utils/vim/llvm.vim (original) +++ llvm/trunk/utils/vim/llvm.vim Tue Aug 25 20:08:21 2009 @@ -51,7 +51,7 @@ syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn syn keyword llvmKeyword nocapture byval nest readnone readonly noalias -syn keyword llvmKeyword noinline alwaysinline optsize ssp sspreq +syn keyword llvmKeyword inlinehint noinline alwaysinline optsize ssp sspreq syn keyword llvmKeyword noredzone noimplicitfloat naked syn keyword llvmKeyword module asm align tail to syn keyword llvmKeyword addrspace section alias sideeffect c gc From daniel at zuster.org Tue Aug 25 21:48:04 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 02:48:04 -0000 Subject: [llvm-commits] [llvm] r80065 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp lib/MC/MCMachOStreamer.cpp test/MC/MachO/symbol-indirect.s test/MC/MachO/values.s Message-ID: <200908260248.n7Q2m5bW024052@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 21:48:04 2009 New Revision: 80065 URL: http://llvm.org/viewvc/llvm-project?rev=80065&view=rev Log: llvm-mc/Mach-O: Set addresses for symbols. Added: llvm/trunk/test/MC/MachO/values.s Modified: llvm/trunk/include/llvm/MC/MCAssembler.h llvm/trunk/lib/MC/MCAssembler.cpp llvm/trunk/lib/MC/MCMachOStreamer.cpp llvm/trunk/test/MC/MachO/symbol-indirect.s Modified: llvm/trunk/include/llvm/MC/MCAssembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=80065&r1=80064&r2=80065&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAssembler.h (original) +++ llvm/trunk/include/llvm/MC/MCAssembler.h Tue Aug 25 21:48:04 2009 @@ -39,6 +39,9 @@ private: FragmentType Kind; + /// Parent - The data for the section this fragment is in. + MCSectionData *Parent; + /// @name Assembler Backend Data /// @{ // @@ -54,7 +57,7 @@ /// @} protected: - MCFragment(FragmentType _Kind, MCSectionData *SD = 0); + MCFragment(FragmentType _Kind, MCSectionData *_Parent = 0); public: // Only for sentinel. @@ -63,6 +66,9 @@ FragmentType getKind() const { return Kind; } + MCSectionData *getParent() const { return Parent; } + void setParent(MCSectionData *Value) { Parent = Value; } + // FIXME: This should be abstract, fix sentinel. virtual uint64_t getMaxFileSize() const { assert(0 && "Invalid getMaxFileSize call!"); @@ -74,6 +80,8 @@ // // FIXME: This could all be kept private to the assembler implementation. + uint64_t getAddress() const; + unsigned getFileSize() const { assert(FileSize != ~UINT64_C(0) && "File size not set!"); return FileSize; @@ -255,6 +263,10 @@ // // FIXME: This could all be kept private to the assembler implementation. + /// Address - The computed address of this section. This is ~0 until + /// initialized. + uint64_t Address; + /// FileSize - The size of this section in the object file. This is ~0 until /// initialized. uint64_t FileSize; @@ -293,6 +305,12 @@ // // FIXME: This could all be kept private to the assembler implementation. + unsigned getAddress() const { + assert(Address != ~UINT64_C(0) && "Address not set!"); + return Address; + } + void setAddress(uint64_t Value) { Address = Value; } + unsigned getFileSize() const { assert(FileSize != ~UINT64_C(0) && "File size not set!"); return FileSize; Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=80065&r1=80064&r2=80065&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Tue Aug 25 21:48:04 2009 @@ -216,7 +216,7 @@ static_cast(SD.getSection()); WriteString(Section.getSectionName(), 16); WriteString(Section.getSegmentName(), 16); - Write32(0); // address + Write32(SD.getAddress()); // address Write32(SD.getFileSize()); // size Write32(FileOffset); @@ -287,7 +287,8 @@ } void WriteNlist32(MachSymbolData &MSD) { - MCSymbol &Symbol = MSD.SymbolData->getSymbol(); + MCSymbolData &Data = *MSD.SymbolData; + MCSymbol &Symbol = Data.getSymbol(); uint8_t Type = 0; // Set the N_TYPE bits. See . @@ -302,11 +303,11 @@ // FIXME: Set STAB bits. - if (MSD.SymbolData->isPrivateExtern()) + if (Data.isPrivateExtern()) Type |= STF_PrivateExtern; // Set external bit. - if (MSD.SymbolData->isExternal() || Symbol.isUndefined()) + if (Data.isExternal() || Symbol.isUndefined()) Type |= STF_External; // struct nlist (12 bytes) @@ -317,9 +318,18 @@ // The Mach-O streamer uses the lowest 16-bits of the flags for the 'desc' // value. - Write16(MSD.SymbolData->getFlags() & 0xFFFF); + Write16(Data.getFlags() & 0xFFFF); - Write32(0); // FIXME: Value + // Write the symbol address. + uint32_t Address = 0; + if (Symbol.isDefined()) { + if (Symbol.isAbsolute()) { + llvm_unreachable("FIXME: Not yet implemented!"); + } else { + Address = Data.getFragment()->getAddress() + Data.getOffset(); + } + } + Write32(Address); } void BindIndirectSymbols(MCAssembler &Asm, @@ -640,17 +650,23 @@ MCFragment::MCFragment() : Kind(FragmentType(~0)) { } -MCFragment::MCFragment(FragmentType _Kind, MCSectionData *SD) +MCFragment::MCFragment(FragmentType _Kind, MCSectionData *_Parent) : Kind(_Kind), + Parent(_Parent), FileSize(~UINT64_C(0)) { - if (SD) - SD->getFragmentList().push_back(this); + if (Parent) + Parent->getFragmentList().push_back(this); } MCFragment::~MCFragment() { } +uint64_t MCFragment::getAddress() const { + assert(getParent() && "Missing Section!"); + return getParent()->getAddress() + Offset; +} + /* *** */ MCSectionData::MCSectionData() : Section(*(MCSection*)0) {} @@ -658,6 +674,7 @@ MCSectionData::MCSectionData(const MCSection &_Section, MCAssembler *A) : Section(_Section), Alignment(1), + Address(~UINT64_C(0)), FileSize(~UINT64_C(0)) { if (A) @@ -824,8 +841,12 @@ void MCAssembler::Finish() { // Layout the sections and fragments. - for (iterator it = begin(), ie = end(); it != ie; ++it) + uint64_t Address = 0; + for (iterator it = begin(), ie = end(); it != ie; ++it) { + it->setAddress(Address); LayoutSection(*it); + Address += it->getFileSize(); + } // Write the object file. MachObjectWriter MOW(OS); Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=80065&r1=80064&r2=80065&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Tue Aug 25 21:48:04 2009 @@ -134,6 +134,7 @@ void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) { assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); + // FIXME: We should also use offsets into Fill fragments. MCDataFragment *F = dyn_cast_or_null(getCurrentFragment()); if (!F) F = new MCDataFragment(CurSectionData); Modified: llvm/trunk/test/MC/MachO/symbol-indirect.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/symbol-indirect.s?rev=80065&r1=80064&r2=80065&view=diff ============================================================================== --- llvm/trunk/test/MC/MachO/symbol-indirect.s (original) +++ llvm/trunk/test/MC/MachO/symbol-indirect.s Tue Aug 25 21:48:04 2009 @@ -117,8 +117,7 @@ // CHECK: # Section 2 // CHECK: (('section_name', '__nl_symbol_ptr\x00') // CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') - // FIXME: Enable this when fixed! -// CHECX: ('address', 20) +// CHECK: ('address', 20) // CHECK: ('size', 20) // CHECK: ('offset', 412) // CHECK: ('alignment', 2) @@ -145,8 +144,7 @@ // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 8) +// CHECK: ('n_value', 8) // CHECK: ('_string', 'sym_lsp_C') // CHECK: ), // CHECK: # Symbol 1 @@ -154,8 +152,7 @@ // CHECK: ('n_type', 0xe) // CHECK: ('n_sect', 3) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 28) +// CHECK: ('n_value', 28) // CHECK: ('_string', 'sym_nlp_C') // CHECK: ), // CHECK: # Symbol 2 @@ -163,8 +160,7 @@ // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 2) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 16) +// CHECK: ('n_value', 16) // CHECK: ('_string', 'sym_lsp_G') // CHECK: ), // CHECK: # Symbol 3 @@ -172,8 +168,7 @@ // CHECK: ('n_type', 0xf) // CHECK: ('n_sect', 3) // CHECK: ('n_desc', 0) - // FIXME: Enable this when fixed! -// CHECX: ('n_value', 36) +// CHECK: ('n_value', 36) // CHECK: ('_string', 'sym_nlp_G') // CHECK: ), // CHECK: # Symbol 4 Added: llvm/trunk/test/MC/MachO/values.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/values.s?rev=80065&view=auto ============================================================================== --- llvm/trunk/test/MC/MachO/values.s (added) +++ llvm/trunk/test/MC/MachO/values.s Tue Aug 25 21:48:04 2009 @@ -0,0 +1,135 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s + + .long 0 +text_def_int: + .long 0 + + .globl text_def_ext +text_def_ext: + .long 0 + + .data + .long 0 +data_def_int: + .long 0 + + .globl data_def_ext +data_def_ext: + .long 0 + +// CHECK: ('cputype', 7) +// CHECK: ('cpusubtype', 3) +// CHECK: ('filetype', 1) +// CHECK: ('num_load_commands', 1) +// CHECK: ('load_commands_size', 296) +// CHECK: ('flag', 0) +// CHECK: ('load_commands', [ +// CHECK: # Load Command 0 +// CHECK: (('command', 1) +// CHECK: ('size', 192) +// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('vm_addr', 0) +// CHECK: ('vm_size', 24) +// CHECK: ('file_offset', 324) +// CHECK: ('file_size', 24) +// CHECK: ('maxprot', 7) +// CHECK: ('initprot', 7) +// CHECK: ('num_sections', 2) +// CHECK: ('flags', 0) +// CHECK: ('sections', [ +// CHECK: # Section 0 +// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 12) +// CHECK: ('offset', 324) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x80000000) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: # Section 1 +// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 12) +// CHECK: ('size', 12) +// CHECK: ('offset', 336) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x0) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 1 +// CHECK: (('command', 2) +// CHECK: ('size', 24) +// CHECK: ('symoff', 348) +// CHECK: ('nsyms', 4) +// CHECK: ('stroff', 396) +// CHECK: ('strsize', 56) +// CHECK: ('_string_data', '\x00text_def_ext\x00data_def_ext\x00text_def_int\x00data_def_int\x00\x00\x00\x00') +// CHECK: ('_symbols', [ +// CHECK: # Symbol 0 +// CHECK: (('n_strx', 27) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 4) +// CHECK: ('_string', 'text_def_int') +// CHECK: ), +// CHECK: # Symbol 1 +// CHECK: (('n_strx', 40) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 16) +// CHECK: ('_string', 'data_def_int') +// CHECK: ), +// CHECK: # Symbol 2 +// CHECK: (('n_strx', 14) +// CHECK: ('n_type', 0xf) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 20) +// CHECK: ('_string', 'data_def_ext') +// CHECK: ), +// CHECK: # Symbol 3 +// CHECK: (('n_strx', 1) +// CHECK: ('n_type', 0xf) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 8) +// CHECK: ('_string', 'text_def_ext') +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 2 +// CHECK: (('command', 11) +// CHECK: ('size', 80) +// CHECK: ('ilocalsym', 0) +// CHECK: ('nlocalsym', 2) +// CHECK: ('iextdefsym', 2) +// CHECK: ('nextdefsym', 2) +// CHECK: ('iundefsym', 4) +// CHECK: ('nundefsym', 0) +// CHECK: ('tocoff', 0) +// CHECK: ('ntoc', 0) +// CHECK: ('modtaboff', 0) +// CHECK: ('nmodtab', 0) +// CHECK: ('extrefsymoff', 0) +// CHECK: ('nextrefsyms', 0) +// CHECK: ('indirectsymoff', 0) +// CHECK: ('nindirectsyms', 0) +// CHECK: ('extreloff', 0) +// CHECK: ('nextrel', 0) +// CHECK: ('locreloff', 0) +// CHECK: ('nlocrel', 0) +// CHECK: ('_indirect_symbols', [ +// CHECK: ]) +// CHECK: ), +// CHECK: ]) From daniel at zuster.org Tue Aug 25 23:13:32 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 04:13:32 -0000 Subject: [llvm-commits] [llvm] r80067 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp test/MC/MachO/section-align-1.s test/MC/MachO/section-align-2.s Message-ID: <200908260413.n7Q4DWNH002681@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 23:13:32 2009 New Revision: 80067 URL: http://llvm.org/viewvc/llvm-project?rev=80067&view=rev Log: llvm-mc/Mach-O: Add section padding where needed (to align the next section). Also, simplify some of Mach-O writer code which can now use section addresses. Added: llvm/trunk/test/MC/MachO/section-align-1.s llvm/trunk/test/MC/MachO/section-align-2.s Modified: llvm/trunk/include/llvm/MC/MCAssembler.h llvm/trunk/lib/MC/MCAssembler.cpp Modified: llvm/trunk/include/llvm/MC/MCAssembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=80067&r1=80066&r2=80067&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAssembler.h (original) +++ llvm/trunk/include/llvm/MC/MCAssembler.h Tue Aug 25 23:13:32 2009 @@ -82,7 +82,7 @@ uint64_t getAddress() const; - unsigned getFileSize() const { + uint64_t getFileSize() const { assert(FileSize != ~UINT64_C(0) && "File size not set!"); return FileSize; } @@ -267,6 +267,9 @@ /// initialized. uint64_t Address; + /// Size - The content size of this section. This is ~0 until initialized. + uint64_t Size; + /// FileSize - The size of this section in the object file. This is ~0 until /// initialized. uint64_t FileSize; @@ -305,13 +308,19 @@ // // FIXME: This could all be kept private to the assembler implementation. - unsigned getAddress() const { + uint64_t getAddress() const { assert(Address != ~UINT64_C(0) && "Address not set!"); return Address; } void setAddress(uint64_t Value) { Address = Value; } - unsigned getFileSize() const { + uint64_t getSize() const { + assert(Size != ~UINT64_C(0) && "File size not set!"); + return Size; + } + void setSize(uint64_t Value) { Size = Value; } + + uint64_t getFileSize() const { assert(FileSize != ~UINT64_C(0) && "File size not set!"); return FileSize; } @@ -414,7 +423,11 @@ /// LayoutSection - Assign offsets and sizes to the fragments in the section /// \arg SD, and update the section size. The section file offset should /// already have been computed. - void LayoutSection(MCSectionData &SD); + /// + /// \param NextAlign - The alignment for the section end address, which may + /// add padding bytes to the section (these are included in the section "file" + /// size, but not its regular size). + void LayoutSection(MCSectionData &SD, unsigned NextAlign); public: /// Construct a new assembler instance. Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=80067&r1=80066&r2=80067&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Tue Aug 25 23:13:32 2009 @@ -217,7 +217,7 @@ WriteString(Section.getSectionName(), 16); WriteString(Section.getSegmentName(), 16); Write32(SD.getAddress()); // address - Write32(SD.getFileSize()); // size + Write32(SD.getSize()); // size Write32(FileOffset); assert(isPowerOf2_32(SD.getAlignment()) && "Invalid alignment!"); @@ -507,11 +507,6 @@ if (NumSymbols) ComputeSymbolTable(Asm, StringTable, LocalSymbolData, ExternalSymbolData, UndefinedSymbolData); - - // Compute the file offsets for all the sections in advance, so that we can - // write things out in order. - SmallVector SectionFileOffsets; - SectionFileOffsets.resize(NumSections); // The section data starts after the header, the segment load command (and // section headers) and the symbol table. @@ -525,27 +520,22 @@ LoadCommandsSize += SymtabLoadCommandSize + DysymtabLoadCommandSize; } - uint64_t FileOffset = Header32Size + LoadCommandsSize; - uint64_t SectionDataStartOffset = FileOffset; + uint64_t SectionDataStart = Header32Size + LoadCommandsSize; + uint64_t SectionDataEnd = SectionDataStart; uint64_t SectionDataSize = 0; - unsigned Index = 0; - for (MCAssembler::iterator it = Asm.begin(), - ie = Asm.end(); it != ie; ++it, ++Index) { - SectionFileOffsets[Index] = FileOffset; - FileOffset += it->getFileSize(); - SectionDataSize += it->getFileSize(); + if (!Asm.getSectionList().empty()) { + MCSectionData &SD = Asm.getSectionList().back(); + SectionDataSize = SD.getAddress() + SD.getSize(); + SectionDataEnd = SectionDataStart + SD.getAddress() + SD.getFileSize(); } // Write the prolog, starting with the header and load command... WriteHeader32(NumLoadCommands, LoadCommandsSize); - WriteSegmentLoadCommand32(NumSections, SectionDataStartOffset, - SectionDataSize); + WriteSegmentLoadCommand32(NumSections, SectionDataStart, SectionDataSize); // ... and then the section headers. - Index = 0; - for (MCAssembler::iterator it = Asm.begin(), - ie = Asm.end(); it != ie; ++it, ++Index) - WriteSection32(*it, SectionFileOffsets[Index]); + for (MCAssembler::iterator it = Asm.begin(), ie = Asm.end(); it != ie; ++it) + WriteSection32(*it, SectionDataStart + it->getAddress()); // Write the symbol table load command, if used. if (NumSymbols) { @@ -563,11 +553,10 @@ // If used, the indirect symbols are written after the section data. if (NumIndirectSymbols) - IndirectSymbolOffset = SectionDataStartOffset + SectionDataSize; + IndirectSymbolOffset = SectionDataEnd; // The symbol table is written after the indirect symbol data. - uint64_t SymbolTableOffset = - SectionDataStartOffset + SectionDataSize + IndirectSymbolSize; + uint64_t SymbolTableOffset = SectionDataEnd + IndirectSymbolSize; // The string table is written after symbol table. uint64_t StringTableOffset = @@ -675,6 +664,7 @@ : Section(_Section), Alignment(1), Address(~UINT64_C(0)), + Size(~UINT64_C(0)), FileSize(~UINT64_C(0)) { if (A) @@ -701,26 +691,24 @@ MCAssembler::~MCAssembler() { } -void MCAssembler::LayoutSection(MCSectionData &SD) { - uint64_t Offset = 0; +void MCAssembler::LayoutSection(MCSectionData &SD, unsigned NextAlign) { + uint64_t Address = SD.getAddress(); for (MCSectionData::iterator it = SD.begin(), ie = SD.end(); it != ie; ++it) { MCFragment &F = *it; - F.setOffset(Offset); + F.setOffset(Address - SD.getAddress()); // Evaluate fragment size. switch (F.getKind()) { case MCFragment::FT_Align: { MCAlignFragment &AF = cast(F); - uint64_t AlignedOffset = RoundUpToAlignment(Offset, AF.getAlignment()); - uint64_t PaddingBytes = AlignedOffset - Offset; - - if (PaddingBytes > AF.getMaxBytesToEmit()) + uint64_t Size = RoundUpToAlignment(Address, AF.getAlignment()) - Address; + if (Size > AF.getMaxBytesToEmit()) AF.setFileSize(0); else - AF.setFileSize(PaddingBytes); + AF.setFileSize(Size); break; } @@ -735,22 +723,24 @@ if (!OF.getOffset().isAbsolute()) llvm_unreachable("FIXME: Not yet implemented!"); uint64_t OrgOffset = OF.getOffset().getConstant(); + uint64_t Offset = Address - SD.getAddress(); // FIXME: We need a way to communicate this error. if (OrgOffset < Offset) llvm_report_error("invalid .org offset '" + Twine(OrgOffset) + - "' (section offset '" + Twine(Offset) + "'"); + "' (at offset '" + Twine(Offset) + "'"); F.setFileSize(OrgOffset - Offset); break; } } - Offset += F.getFileSize(); + Address += F.getFileSize(); } - // FIXME: Pad section? - SD.setFileSize(Offset); + // Set the section sizes. + SD.setSize(Address - SD.getAddress()); + SD.setFileSize(RoundUpToAlignment(Address, NextAlign) - SD.getAddress()); } /// WriteFileData - Write the \arg F data to the output file. @@ -836,16 +826,32 @@ ie = SD.end(); it != ie; ++it) WriteFileData(OS, *it, MOW); + // Add section padding. + assert(SD.getFileSize() >= SD.getSize() && "Invalid section sizes!"); + MOW.WriteZeros(SD.getFileSize() - SD.getSize()); + assert(OS.tell() - Start == SD.getFileSize()); } void MCAssembler::Finish() { // Layout the sections and fragments. uint64_t Address = 0; - for (iterator it = begin(), ie = end(); it != ie; ++it) { - it->setAddress(Address); - LayoutSection(*it); - Address += it->getFileSize(); + for (iterator it = begin(), ie = end(); it != ie;) { + MCSectionData &SD = *it; + + // Select the amount of padding alignment we need, based on either the next + // sections alignment or the default alignment. + // + // FIXME: This should probably match the native word size. + unsigned NextAlign = 4; + ++it; + if (it != ie) + NextAlign = it->getAlignment(); + + // Layout the section fragments and its size. + SD.setAddress(Address); + LayoutSection(SD, NextAlign); + Address += SD.getFileSize(); } // Write the object file. Added: llvm/trunk/test/MC/MachO/section-align-1.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/section-align-1.s?rev=80067&view=auto ============================================================================== --- llvm/trunk/test/MC/MachO/section-align-1.s (added) +++ llvm/trunk/test/MC/MachO/section-align-1.s Tue Aug 25 23:13:32 2009 @@ -0,0 +1,87 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s + +name: + .byte 0 + + // Check that symbol table is aligned to 4 bytes. + + +// CHECK: ('cputype', 7) +// CHECK: ('cpusubtype', 3) +// CHECK: ('filetype', 1) +// CHECK: ('num_load_commands', 1) +// CHECK: ('load_commands_size', 228) +// CHECK: ('flag', 0) +// CHECK: ('load_commands', [ +// CHECK: # Load Command 0 +// CHECK: (('command', 1) +// CHECK: ('size', 124) +// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('vm_addr', 0) +// CHECK: ('vm_size', 1) +// CHECK: ('file_offset', 256) +// CHECK: ('file_size', 1) +// CHECK: ('maxprot', 7) +// CHECK: ('initprot', 7) +// CHECK: ('num_sections', 1) +// CHECK: ('flags', 0) +// CHECK: ('sections', [ +// CHECK: # Section 0 +// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 1) +// CHECK: ('offset', 256) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x80000000) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 1 +// CHECK: (('command', 2) +// CHECK: ('size', 24) +// CHECK: ('symoff', 260) +// CHECK: ('nsyms', 1) +// CHECK: ('stroff', 272) +// CHECK: ('strsize', 8) +// CHECK: ('_string_data', '\x00name\x00\x00\x00') +// CHECK: ('_symbols', [ +// CHECK: # Symbol 0 +// CHECK: (('n_strx', 1) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 1) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 0) +// CHECK: ('_string', 'name') +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 2 +// CHECK: (('command', 11) +// CHECK: ('size', 80) +// CHECK: ('ilocalsym', 0) +// CHECK: ('nlocalsym', 1) +// CHECK: ('iextdefsym', 1) +// CHECK: ('nextdefsym', 0) +// CHECK: ('iundefsym', 1) +// CHECK: ('nundefsym', 0) +// CHECK: ('tocoff', 0) +// CHECK: ('ntoc', 0) +// CHECK: ('modtaboff', 0) +// CHECK: ('nmodtab', 0) +// CHECK: ('extrefsymoff', 0) +// CHECK: ('nextrefsyms', 0) +// CHECK: ('indirectsymoff', 0) +// CHECK: ('nindirectsyms', 0) +// CHECK: ('extreloff', 0) +// CHECK: ('nextrel', 0) +// CHECK: ('locreloff', 0) +// CHECK: ('nlocrel', 0) +// CHECK: ('_indirect_symbols', [ +// CHECK: ]) +// CHECK: ), +// CHECK: ]) Added: llvm/trunk/test/MC/MachO/section-align-2.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/section-align-2.s?rev=80067&view=auto ============================================================================== --- llvm/trunk/test/MC/MachO/section-align-2.s (added) +++ llvm/trunk/test/MC/MachO/section-align-2.s Tue Aug 25 23:13:32 2009 @@ -0,0 +1,137 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s + + .byte 0 + + // There should be 3 padding bytes here. + + .data + .align 2 +foo: + .org 8 +bar: + .byte 0 + + .const +baz: + +// CHECK: ('cputype', 7) +// CHECK: ('cpusubtype', 3) +// CHECK: ('filetype', 1) +// CHECK: ('num_load_commands', 1) +// CHECK: ('load_commands_size', 364) +// CHECK: ('flag', 0) +// CHECK: ('load_commands', [ +// CHECK: # Load Command 0 +// CHECK: (('command', 1) +// CHECK: ('size', 260) +// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('vm_addr', 0) +// CHECK: ('vm_size', 13) +// CHECK: ('file_offset', 392) +// CHECK: ('file_size', 13) +// CHECK: ('maxprot', 7) +// CHECK: ('initprot', 7) +// CHECK: ('num_sections', 3) +// CHECK: ('flags', 0) +// CHECK: ('sections', [ +// CHECK: # Section 0 +// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 0) +// CHECK: ('size', 1) +// CHECK: ('offset', 392) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x80000000) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: # Section 1 +// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 4) +// CHECK: ('size', 9) +// CHECK: ('offset', 396) +// CHECK: ('alignment', 2) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x0) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: # Section 2 +// CHECK: (('section_name', '__const\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +// CHECK: ('address', 13) +// CHECK: ('size', 0) +// CHECK: ('offset', 405) +// CHECK: ('alignment', 0) +// CHECK: ('reloc_offset', 0) +// CHECK: ('num_reloc', 0) +// CHECK: ('flags', 0x0) +// CHECK: ('reserved1', 0) +// CHECK: ('reserved2', 0) +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 1 +// CHECK: (('command', 2) +// CHECK: ('size', 24) +// CHECK: ('symoff', 408) +// CHECK: ('nsyms', 3) +// CHECK: ('stroff', 444) +// CHECK: ('strsize', 16) +// CHECK: ('_string_data', '\x00foo\x00bar\x00baz\x00\x00\x00\x00') +// CHECK: ('_symbols', [ +// CHECK: # Symbol 0 +// CHECK: (('n_strx', 1) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 4) +// CHECK: ('_string', 'foo') +// CHECK: ), +// CHECK: # Symbol 1 +// CHECK: (('n_strx', 5) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 2) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 12) +// CHECK: ('_string', 'bar') +// CHECK: ), +// CHECK: # Symbol 2 +// CHECK: (('n_strx', 9) +// CHECK: ('n_type', 0xe) +// CHECK: ('n_sect', 3) +// CHECK: ('n_desc', 0) +// CHECK: ('n_value', 13) +// CHECK: ('_string', 'baz') +// CHECK: ), +// CHECK: ]) +// CHECK: ), +// CHECK: # Load Command 2 +// CHECK: (('command', 11) +// CHECK: ('size', 80) +// CHECK: ('ilocalsym', 0) +// CHECK: ('nlocalsym', 3) +// CHECK: ('iextdefsym', 3) +// CHECK: ('nextdefsym', 0) +// CHECK: ('iundefsym', 3) +// CHECK: ('nundefsym', 0) +// CHECK: ('tocoff', 0) +// CHECK: ('ntoc', 0) +// CHECK: ('modtaboff', 0) +// CHECK: ('nmodtab', 0) +// CHECK: ('extrefsymoff', 0) +// CHECK: ('nextrefsyms', 0) +// CHECK: ('indirectsymoff', 0) +// CHECK: ('nindirectsyms', 0) +// CHECK: ('extreloff', 0) +// CHECK: ('nextrel', 0) +// CHECK: ('locreloff', 0) +// CHECK: ('nlocrel', 0) +// CHECK: ('_indirect_symbols', [ +// CHECK: ]) +// CHECK: ), +// CHECK: ]) From sabre at nondot.org Tue Aug 25 23:21:30 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 26 Aug 2009 04:21:30 -0000 Subject: [llvm-commits] [llvm] r80068 - /llvm/trunk/include/llvm/Analysis/DebugInfo.h Message-ID: <200908260421.n7Q4LUuZ003742@zion.cs.uiuc.edu> Author: lattner Date: Tue Aug 25 23:21:30 2009 New Revision: 80068 URL: http://llvm.org/viewvc/llvm-project?rev=80068&view=rev Log: fix some funky indentation Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=80068&r1=80067&r2=80068&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Aug 25 23:21:30 2009 @@ -218,17 +218,17 @@ // carry this is just plain insane. uint64_t getOffsetInBits() const { return getUInt64Field(7); } unsigned getFlags() const { return getUnsignedField(8); } - bool isPrivate() const { return - (getFlags() & FlagPrivate) != 0; + bool isPrivate() const { + return (getFlags() & FlagPrivate) != 0; } - bool isProtected() const { + bool isProtected() const { return (getFlags() & FlagProtected) != 0; } - bool isForwardDecl() const { - return (getFlags() & FlagFwdDecl) != 0; + bool isForwardDecl() const { + return (getFlags() & FlagFwdDecl) != 0; } - bool isClosure() const { - return (getFlags() & FlagClosure) != 0; + bool isClosure() const { + return (getFlags() & FlagClosure) != 0; } /// dump - print type. From clattner at apple.com Tue Aug 25 23:24:35 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 25 Aug 2009 21:24:35 -0700 Subject: [llvm-commits] [llvm] r80040 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp In-Reply-To: <200908252227.n7PMRNxL022987@zion.cs.uiuc.edu> References: <200908252227.n7PMRNxL022987@zion.cs.uiuc.edu> Message-ID: On Aug 25, 2009, at 3:27 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Aug 25 17:27:22 2009 > New Revision: 80040 > > URL: http://llvm.org/viewvc/llvm-project?rev=80040&view=rev > Log: > Get rid of this horrible "benign race" by exploiting ManagedStatic > to initialize > the array on its first access. Thanks Owen, very nice! -Chris > > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=80040&r1=80039&r2=80040&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 25 > 17:27:22 2009 > @@ -5014,8 +5014,20 @@ > AddNodeIDNode(ID, this); > } > > +namespace { > + struct EVTArray { > + std::vector VTs; > + > + EVTArray() { > + VTs.reserve(MVT::LAST_VALUETYPE); > + for (unsigned i = 0; i < MVT::LAST_VALUETYPE; ++i) > + VTs.push_back(MVT((MVT::SimpleValueType)i)); > + } > + }; > +} > + > static ManagedStatic > EVTs; > -static EVT VTs[MVT::LAST_VALUETYPE]; > +static ManagedStatic SimpleVTArray; > static ManagedStatic > VTMutex; > > /// getValueTypeList - Return a pointer to the specified value type. > @@ -5025,12 +5037,7 @@ > sys::SmartScopedLock Lock(*VTMutex); > return &(*EVTs->insert(VT).first); > } else { > - // All writes to this location will have the same value, so > it's ok > - // to race on it. We only need to ensure that at least one > write has > - // succeeded before we return the pointer into the array. > - VTs[VT.getSimpleVT().SimpleTy] = VT; > - sys::MemoryFence(); > - return VTs + VT.getSimpleVT().SimpleTy; > + return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy]; > } > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From daniel at zuster.org Tue Aug 25 23:28:45 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 04:28:45 -0000 Subject: [llvm-commits] [llvm] r80069 - in /llvm/trunk/test: MC/MachO/symbol-indirect.s Scripts/macho-dump Message-ID: <200908260428.n7Q4SjQd004705@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Aug 25 23:28:45 2009 New Revision: 80069 URL: http://llvm.org/viewvc/llvm-project?rev=80069&view=rev Log: llvm-mc: Fix tests for python variations in int printing, sigh. Modified: llvm/trunk/test/MC/MachO/symbol-indirect.s llvm/trunk/test/Scripts/macho-dump Modified: llvm/trunk/test/MC/MachO/symbol-indirect.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/symbol-indirect.s?rev=80069&r1=80068&r2=80069&view=diff ============================================================================== --- llvm/trunk/test/MC/MachO/symbol-indirect.s (original) +++ llvm/trunk/test/MC/MachO/symbol-indirect.s Tue Aug 25 23:28:45 2009 @@ -244,25 +244,25 @@ // CHECK: ('nlocrel', 0) // CHECK: ('_indirect_symbols', [ // CHECK: # Indirect Symbol 0 -// CHECK: (('symbol_index', 5),), +// CHECK: (('symbol_index', 0x5),), // CHECK: # Indirect Symbol 1 -// CHECK: (('symbol_index', 4),), +// CHECK: (('symbol_index', 0x4),), // CHECK: # Indirect Symbol 2 -// CHECK: (('symbol_index', 0),), +// CHECK: (('symbol_index', 0x0),), // CHECK: # Indirect Symbol 3 -// CHECK: (('symbol_index', 6),), +// CHECK: (('symbol_index', 0x6),), // CHECK: # Indirect Symbol 4 -// CHECK: (('symbol_index', 2),), +// CHECK: (('symbol_index', 0x2),), // CHECK: # Indirect Symbol 5 -// CHECK: (('symbol_index', 8),), +// CHECK: (('symbol_index', 0x8),), // CHECK: # Indirect Symbol 6 -// CHECK: (('symbol_index', 7),), +// CHECK: (('symbol_index', 0x7),), // CHECK: # Indirect Symbol 7 -// CHECK: (('symbol_index', 2147483648),), +// CHECK: (('symbol_index', 0x80000000),), // CHECK: # Indirect Symbol 8 -// CHECK: (('symbol_index', 9),), +// CHECK: (('symbol_index', 0x9),), // CHECK: # Indirect Symbol 9 -// CHECK: (('symbol_index', 3),), +// CHECK: (('symbol_index', 0x3),), // CHECK: ]) // CHECK: ), // CHECK: ]) Modified: llvm/trunk/test/Scripts/macho-dump URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/macho-dump?rev=80069&r1=80068&r2=80069&view=diff ============================================================================== --- llvm/trunk/test/Scripts/macho-dump (original) +++ llvm/trunk/test/Scripts/macho-dump Tue Aug 25 23:28:45 2009 @@ -198,7 +198,7 @@ print " ('_indirect_symbols', [" for i in range(nindirectsyms): print " # Indirect Symbol %r" % i - print " (('symbol_index', %r),)," % f.read32() + print " (('symbol_index', %#x),)," % f.read32() print " ])" f.seek(prev_pos) From sabre at nondot.org Tue Aug 25 23:56:30 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 26 Aug 2009 04:56:30 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r80071 - /llvm-gcc-4.2/trunk/gcc/config/i386/t-darwin64 Message-ID: <200908260456.n7Q4uU3S008720@zion.cs.uiuc.edu> Author: lattner Date: Tue Aug 25 23:56:30 2009 New Revision: 80071 URL: http://llvm.org/viewvc/llvm-project?rev=80071&view=rev Log: "Current llvm-gcc-4.2 for trunk and the 2.6 release is unable to build the i386 multilib for the x86_64-apple-darwin target. The attached patch provides this support." Approved by Mike Stump, patch by Jack Howarth! Modified: llvm-gcc-4.2/trunk/gcc/config/i386/t-darwin64 Modified: llvm-gcc-4.2/trunk/gcc/config/i386/t-darwin64 URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/t-darwin64?rev=80071&r1=80070&r2=80071&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/t-darwin64 (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/t-darwin64 Tue Aug 25 23:56:30 2009 @@ -2,6 +2,14 @@ LIB2_SIDITI_CONV_FUNCS=yes LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c +# LLVM LOCAL begin +MULTILIB_OPTIONS = m32 +MULTILIB_DIRNAMES = i386 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib +# LLVM LOCAL end + # APPLE LOCAL begin gcov 5573505 # -pipe because there's an assembler bug, 4077127, which causes # it to not properly process the first # directive, causing temporary From sabre at nondot.org Wed Aug 26 00:00:16 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 26 Aug 2009 05:00:16 -0000 Subject: [llvm-commits] [llvm] r80072 - /llvm/trunk/include/llvm/ADT/Triple.h Message-ID: <200908260500.n7Q50GUK009192@zion.cs.uiuc.edu> Author: lattner Date: Wed Aug 26 00:00:16 2009 New Revision: 80072 URL: http://llvm.org/viewvc/llvm-project?rev=80072&view=rev Log: some mips and some sparc compilers apparently predefine mips and sparc respectively. Just overrule them :) Modified: llvm/trunk/include/llvm/ADT/Triple.h Modified: llvm/trunk/include/llvm/ADT/Triple.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=80072&r1=80071&r2=80072&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/Triple.h (original) +++ llvm/trunk/include/llvm/ADT/Triple.h Wed Aug 26 00:00:16 2009 @@ -13,6 +13,11 @@ #include "llvm/ADT/StringRef.h" #include +// Some system headers or GCC predefined macros conflict with identifiers in +// this file. Undefine them here. +#undef mips +#undef sparc + namespace llvm { class StringRef; class Twine; From dpatel at apple.com Wed Aug 26 00:01:19 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 26 Aug 2009 05:01:19 -0000 Subject: [llvm-commits] [llvm] r80073 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Support/ lib/Analysis/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/PIC16/ lib/Transforms/IPO/ lib/Transforms/Utils/ lib/VMCore/ test/DebugInfo/ test/FrontendC++/ test/FrontendObjC/ test/Transforms/SimplifyCFG/ Message-ID: <200908260501.n7Q51KT6009371@zion.cs.uiuc.edu> Author: dpatel Date: Wed Aug 26 00:01:18 2009 New Revision: 80073 URL: http://llvm.org/viewvc/llvm-project?rev=80073&view=rev Log: Revert 79977. It causes llvm-gcc bootstrap failures on some platforms. Added: llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll llvm/trunk/test/DebugInfo/2009-01-30-Method.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2009-01-30-Method.ll llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll llvm/trunk/test/DebugInfo/2009-03-02-sink.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/2009-03-02-sink.ll llvm/trunk/test/DebugInfo/dataOnly.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/dataOnly.ll llvm/trunk/test/DebugInfo/forwardDecl.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/forwardDecl.ll llvm/trunk/test/DebugInfo/printdbginfo.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/printdbginfo.ll llvm/trunk/test/DebugInfo/printdbginfo2.ll - copied unchanged from r79976, llvm/trunk/test/DebugInfo/printdbginfo2.ll llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp - copied unchanged from r79976, llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m - copied unchanged from r79976, llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m Modified: llvm/trunk/docs/SourceLevelDebugging.html llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/include/llvm/AutoUpgrade.h llvm/trunk/include/llvm/CodeGen/DwarfWriter.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/include/llvm/IntrinsicInst.h llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/include/llvm/Metadata.h llvm/trunk/include/llvm/Support/DebugLoc.h llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp llvm/trunk/lib/Analysis/DebugInfo.cpp llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp llvm/trunk/lib/VMCore/AutoUpgrade.cpp llvm/trunk/lib/VMCore/Metadata.cpp llvm/trunk/lib/VMCore/ValueTypes.cpp llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll Modified: llvm/trunk/docs/SourceLevelDebugging.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.html?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/docs/SourceLevelDebugging.html (original) +++ llvm/trunk/docs/SourceLevelDebugging.html Wed Aug 26 00:01:18 2009 @@ -122,8 +122,8 @@

The approach used by the LLVM implementation is to use a small set of intrinsic functions to define a mapping between LLVM program objects and the source-level objects. The - description of the source-level program is maintained in LLVM metadata - in an implementation-defined format + description of the source-level program is maintained in LLVM global + variables in an implementation-defined format (the C/C++ front-end currently uses working draft 7 of the DWARF 3 standard).

@@ -240,21 +240,31 @@

LLVM debugging information has been carefully designed to make it possible for the optimizer to optimize the program and debugging information without necessarily having to know anything about debugging information. In - particular, te use of metadadta avoids duplicated dubgging information from - the beginning, and the global dead code elimination pass automatically - deletes debugging information for a function if it decides to delete the - function.

+ particular, the global constant merging pass automatically eliminates + duplicated debugging information (often caused by header files), the global + dead code elimination pass automatically deletes debugging information for a + function if it decides to delete the function, and the linker eliminates + debug information when it merges linkonce functions.

To do this, most of the debugging information (descriptors for types, variables, functions, source files, etc) is inserted by the language - front-end in the form of LLVM metadata.

+ front-end in the form of LLVM global variables. These LLVM global variables + are no different from any other global variables, except that they have a web + of LLVM intrinsic functions that point to them. If the last references to a + particular piece of debugging information are deleted (for example, by the + -globaldce pass), the extraneous debug information will + automatically become dead and be removed by the optimizer.

Debug information is designed to be agnostic about the target debugger and debugging information representation (e.g. DWARF/Stabs/etc). It uses a - generic pass to decode the information that represents variables, types, - functions, namespaces, etc: this allows for arbitrary source-language - semantics and type-systems to be used, as long as there is a module - written for the target debugger to interpret the information.

+ generic machine debug information pass to decode the information that + represents variables, types, functions, namespaces, etc: this allows for + arbitrary source-language semantics and type-systems to be used, as long as + there is a module written for the target debugger to interpret the + information. In addition, debug global variables are declared in + the "llvm.metadata" section. All values declared in this section + are stripped away after target debug information is constructed and before + the program object is emitted.

To provide basic functionality, the LLVM debugger does have to make some assumptions about the source-level language being debugged, though it keeps @@ -278,7 +288,9 @@

In consideration of the complexity and volume of debug information, LLVM - provides a specification for well formed debug descriptors.

+ provides a specification for well formed debug global variables. The + constant value of each of these globals is one of a limited set of + structures, known as debug descriptors.

Consumers of LLVM debug information expect the descriptors for program objects to start in a canonical format, but the descriptors can include @@ -291,14 +303,17 @@ the range 0x1000 thru 0x2000 (there is a defined enum DW_TAG_user_base = 0x1000.)

-

The fields of debug descriptors used internally by LLVM +

The fields of debug descriptors used internally by LLVM (MachineModuleInfo) are restricted to only the simple data types int, uint, - bool, float, double, mdstring and - mdnode.

+ bool, float, double, i8* and + { }*. References to arbitrary values are handled using a + { }* and a cast to { }* expression; typically + references to other field descriptors, arrays of descriptors or global + variables.

-!1 = metadata !{
+%llvm.dbg.object.type = type {
   uint,   ;; A tag
   ...
 }
@@ -311,8 +326,8 @@
    of tags are loosely bound to the tag values of DWARF information entries.
    However, that does not restrict the use of the information supplied to DWARF
    targets.  To facilitate versioning of debug information, the tag is augmented
-   with the current debug version (LLVMDebugVersion = 7 << 16 or 0x70000 or
-   458752.)

+ with the current debug version (LLVMDebugVersion = 4 << 16 or 0x40000 or + 262144.)

The details of the various descriptors follow.

@@ -327,18 +342,17 @@
-!0 = metadata !{
-  i32,       ;; Tag = 17 + LLVMDebugVersion 
-             ;; (DW_TAG_compile_unit)
-  i32,       ;; Unused field. 
-  i32,       ;; DWARF language identifier (ex. DW_LANG_C89) 
-  metadata,  ;; Source file name
-  metadata,  ;; Source file directory (includes trailing slash)
-  metadata   ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
-  i1,        ;; True if this is a main compile unit. 
-  i1,        ;; True if this is optimized.
-  metadata,  ;; Flags
-  i32        ;; Runtime version
+%llvm.dbg.compile_unit.type = type {
+  i32,    ;; Tag = 17 + LLVMDebugVersion (DW_TAG_compile_unit)
+  {  }*,  ;; Compile unit anchor = cast = (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to {  }*)
+  i32,    ;; DWARF language identifier (ex. DW_LANG_C89) 
+  i8*,    ;; Source file name
+  i8*,    ;; Source file directory (includes trailing slash)
+  i8*     ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
+  i1,     ;; True if this is a main compile unit. 
+  i1,     ;; True if this is optimized.
+  i8*,    ;; Flags
+  i32     ;; Runtime version
 }
 
@@ -374,20 +388,19 @@
-!1 = metadata !{
-  i32,      ;; Tag = 52 + LLVMDebugVersion 
-            ;; (DW_TAG_variable)
-  i32,      ;; Unused field.
-  metadata, ;; Reference to context descriptor
-  metadata, ;; Name
-  metadata, ;; Display name (fully qualified C++ name)
-  metadata, ;; MIPS linkage name (for C++)
-  metadata, ;; Reference to compile unit where defined
-  i32,      ;; Line number where defined
-  metadata, ;; Reference to type descriptor
-  i1,       ;; True if the global is local to compile unit (static)
-  i1,       ;; True if the global is defined in the compile unit (not extern)
-  {  }*     ;; Reference to the global variable
+%llvm.dbg.global_variable.type = type {
+  i32,    ;; Tag = 52 + LLVMDebugVersion (DW_TAG_variable)
+  {  }*,  ;; Global variable anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to {  }*),  
+  {  }*,  ;; Reference to context descriptor
+  i8*,    ;; Name
+  i8*,    ;; Display name (fully qualified C++ name)
+  i8*,    ;; MIPS linkage name (for C++)
+  {  }*,  ;; Reference to compile unit where defined
+  i32,    ;; Line number where defined
+  {  }*,  ;; Reference to type descriptor
+  i1,     ;; True if the global is local to compile unit (static)
+  i1,     ;; True if the global is defined in the compile unit (not extern)
+  {  }*   ;; Reference to the global variable
 }
 
@@ -406,19 +419,18 @@
-!2 = metadata !{
-  i32,      ;; Tag = 46 + LLVMDebugVersion
-            ;; (DW_TAG_subprogram)
-  i32,      ;; Unused field.
-  metadata, ;; Reference to context descriptor
-  metadata, ;; Name
-  metadata, ;; Display name (fully qualified C++ name)
-  metadata, ;; MIPS linkage name (for C++)
-  metadata, ;; Reference to compile unit where defined
-  i32,      ;; Line number where defined
-  metadata, ;; Reference to type descriptor
-  i1,       ;; True if the global is local to compile unit (static)
-  i1        ;; True if the global is defined in the compile unit (not extern)
+%llvm.dbg.subprogram.type = type {
+  i32,    ;; Tag = 46 + LLVMDebugVersion (DW_TAG_subprogram)
+  {  }*,  ;; Subprogram anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to {  }*),  
+  {  }*,  ;; Reference to context descriptor
+  i8*,    ;; Name
+  i8*,    ;; Display name (fully qualified C++ name)
+  i8*,    ;; MIPS linkage name (for C++)
+  {  }*,  ;; Reference to compile unit where defined
+  i32,    ;; Line number where defined
+  {  }*,  ;; Reference to type descriptor
+  i1,     ;; True if the global is local to compile unit (static)
+  i1      ;; True if the global is defined in the compile unit (not extern)
 }
 
@@ -438,9 +450,9 @@
-!3 = metadata !{
-  i32,     ;; Tag = 13 + LLVMDebugVersion (DW_TAG_lexical_block)
-  metadata ;; Reference to context descriptor
+%llvm.dbg.block = type {
+  i32,    ;; Tag = 13 + LLVMDebugVersion (DW_TAG_lexical_block)
+  {  }*   ;; Reference to context descriptor
 }
 
@@ -460,18 +472,17 @@
-!4 = metadata !{
-  i32,      ;; Tag = 36 + LLVMDebugVersion 
-            ;; (DW_TAG_base_type)
-  metadata, ;; Reference to context (typically a compile unit)
-  metadata, ;; Name (may be "" for anonymous types)
-  metadata, ;; Reference to compile unit where defined (may be NULL)
-  i32,      ;; Line number where defined (may be 0)
-  i64,      ;; Size in bits
-  i64,      ;; Alignment in bits
-  i64,      ;; Offset in bits
-  i32,      ;; Flags
-  i32       ;; DWARF type encoding
+%llvm.dbg.basictype.type = type {
+  i32,    ;; Tag = 36 + LLVMDebugVersion (DW_TAG_base_type)
+  {  }*,  ;; Reference to context (typically a compile unit)
+  i8*,    ;; Name (may be "" for anonymous types)
+  {  }*,  ;; Reference to compile unit where defined (may be NULL)
+  i32,    ;; Line number where defined (may be 0)
+  i64,    ;; Size in bits
+  i64,    ;; Alignment in bits
+  i64,    ;; Offset in bits
+  i32,    ;; Flags
+  i32     ;; DWARF type encoding
 }
 
@@ -512,16 +523,16 @@
-!5 = metadata !{
-  i32,      ;; Tag (see below)
-  metadata, ;; Reference to context
-  metadata, ;; Name (may be "" for anonymous types)
-  metadata, ;; Reference to compile unit where defined (may be NULL)
-  i32,      ;; Line number where defined (may be 0)
-  i32,      ;; Size in bits
-  i32,      ;; Alignment in bits
-  i32,      ;; Offset in bits
-  metadata  ;; Reference to type derived from
+%llvm.dbg.derivedtype.type = type {
+  i32,    ;; Tag (see below)
+  {  }*,  ;; Reference to context
+  i8*,    ;; Name (may be "" for anonymous types)
+  {  }*,  ;; Reference to compile unit where defined (may be NULL)
+  i32,    ;; Line number where defined (may be 0)
+  i32,    ;; Size in bits
+  i32,    ;; Alignment in bits
+  i32,    ;; Offset in bits
+  {  }*   ;; Reference to type derived from
 }
 
@@ -580,19 +591,19 @@
-!6 = metadata !{
-  i32,      ;; Tag (see below)
-  metadata, ;; Reference to context
-  metadata, ;; Name (may be "" for anonymous types)
-  metadata, ;; Reference to compile unit where defined (may be NULL)
-  i32,      ;; Line number where defined (may be 0)
-  i64,      ;; Size in bits
-  i64,      ;; Alignment in bits
-  i64,      ;; Offset in bits
-  i32,      ;; Flags
-  metadata, ;; Reference to type derived from
-  metadata, ;; Reference to array of member descriptors
-  i32       ;; Runtime languages
+%llvm.dbg.compositetype.type = type {
+  i32,    ;; Tag (see below)
+  {  }*,  ;; Reference to context
+  i8*,    ;; Name (may be "" for anonymous types)
+  {  }*,  ;; Reference to compile unit where defined (may be NULL)
+  i32,    ;; Line number where defined (may be 0)
+  i64,    ;; Size in bits
+  i64,    ;; Alignment in bits
+  i64,    ;; Offset in bits
+  i32,    ;; Flags
+  {  }*,  ;; Reference to type derived from
+  {  }*,  ;; Reference to array of member descriptors
+  i32     ;; Runtime languages
 }
 
@@ -691,11 +702,10 @@
-!6 = metadata !{
-  i32,      ;; Tag = 40 + LLVMDebugVersion 
-            ;; (DW_TAG_enumerator)
-  metadata, ;; Name
-  i64       ;; Value
+%llvm.dbg.enumerator.type = type {
+  i32,    ;; Tag = 40 + LLVMDebugVersion (DW_TAG_enumerator)
+  i8*,    ;; Name
+  i64     ;; Value
 }
 
@@ -715,13 +725,13 @@
-!7 = metadata !{
-  i32,      ;; Tag (see below)
-  metadata, ;; Context
-  metadata, ;; Name
-  metadata, ;; Reference to compile unit where defined
-  i32,      ;; Line number where defined
-  metadata  ;; Type descriptor
+%llvm.dbg.variable.type = type {
+  i32,     ;; Tag (see below)
+  {  }*,   ;; Context
+  i8*,     ;; Name
+  {  }*,   ;; Reference to compile unit where defined
+  i32,     ;; Line number where defined
+  {  }*    ;; Type descriptor
 }
 
@@ -768,14 +778,14 @@
-  void %llvm.dbg.stoppoint( uint, uint, metadata)
+  void %llvm.dbg.stoppoint( uint, uint, { }* )
 

This intrinsic is used to provide correspondence between the source file and the generated code. The first argument is the line number (base 1), second argument is the column number (0 if unknown) and the third argument the - source %llvm.dbg.compile_unit. - Code following a call to this intrinsic will + source %llvm.dbg.compile_unit* + cast to a { }*. Code following a call to this intrinsic will have been defined in close proximity of the line, column and file. This information holds until the next call to %lvm.dbg.stoppoint.

@@ -789,7 +799,7 @@
-  void %llvm.dbg.func.start( metadata )
+  void %llvm.dbg.func.start( { }* )
 

This intrinsic is used to link the debug information @@ -813,7 +823,7 @@

-  void %llvm.dbg.region.start( metadata )
+  void %llvm.dbg.region.start( { }* )
 

This intrinsic is used to define the beginning of a declarative scope (ex. @@ -833,7 +843,7 @@

-  void %llvm.dbg.region.end( metadata )
+  void %llvm.dbg.region.end( { }* )
 

This intrinsic is used to define the end of a declarative scope (ex. block) @@ -854,14 +864,14 @@

-  void %llvm.dbg.declare( { } *, metadata )
+  void %llvm.dbg.declare( { } *, { }* )
 

This intrinsic provides information about a local element (ex. variable.) The first argument is the alloca for the variable, cast to a { }*. The second argument is the %llvm.dbg.variable containing - the description of the variable.

+ the description of the variable, also cast to a { }*.

@@ -945,29 +955,29 @@ ... - call void @llvm.dbg.func.start( metadata !0) + call void @llvm.dbg.func.start( %llvm.dbg.subprogram.type* @llvm.dbg.subprogram ) - call void @llvm.dbg.stoppoint( uint 2, uint 2, metadata !1) + call void @llvm.dbg.stoppoint( uint 2, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) call void @llvm.dbg.declare({}* %X, ...) call void @llvm.dbg.declare({}* %Y, ...) ;; Evaluate expression on line 2, assigning to X. - call void @llvm.dbg.stoppoint( uint 3, uint 2, metadata !1) + call void @llvm.dbg.stoppoint( uint 3, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) ;; Evaluate expression on line 3, assigning to Y. call void @llvm.region.start() - call void @llvm.dbg.stoppoint( uint 5, uint 4, metadata !1) + call void @llvm.dbg.stoppoint( uint 5, uint 4, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) call void @llvm.dbg.declare({}* %X, ...) ;; Evaluate expression on line 5, assigning to Z. - call void @llvm.dbg.stoppoint( uint 7, uint 2, metadata !1) + call void @llvm.dbg.stoppoint( uint 7, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) call void @llvm.region.end() - call void @llvm.dbg.stoppoint( uint 9, uint 2, metadata !1) + call void @llvm.dbg.stoppoint( uint 9, uint 2, %llvm.dbg.compile_unit* @llvm.dbg.compile_unit ) call void @llvm.region.end() @@ -1087,35 +1097,50 @@
 ...
 ;;
-;; Define the compile unit for the source file "/Users/mine/sources/MySource.cpp".
+;; Define types used.  In this case we need one for compile unit anchors and one
+;; for compile units.
+;;
+%llvm.dbg.anchor.type = type { uint, uint }
+%llvm.dbg.compile_unit.type = type { uint, {  }*, uint, uint, i8*, i8*, i8* }
+...
+;;
+;; Define the anchor for compile units.  Note that the second field of the
+;; anchor is 17, which is the same as the tag for compile units
+;; (17 = DW_TAG_compile_unit.)
 ;;
-!3 = metadata !{
-  i32 458769,    ;; Tag
-  i32 0,         ;; Unused
-  i32 4,         ;; Language Id
-  metadata !"MySource.cpp", 
-  metadata !"/Users/mine/sources", 
-  metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)", 
-  i1 true,       ;; Main Compile Unit
-  i1 false,      ;; Optimized compile unit
-  metadata !"",  ;; Compiler flags
-  i32 0}         ;; Runtime version
+%llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { uint 0, uint 17 }, section "llvm.metadata"
 
 ;;
+;; Define the compile unit for the source file "/Users/mine/sources/MySource.cpp".
+;;
+%llvm.dbg.compile_unit1 = internal constant %llvm.dbg.compile_unit.type {
+    uint add(uint 17, uint 262144), 
+    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to {  }*), 
+    uint 1, 
+    uint 1, 
+    i8* getelementptr ([13 x i8]* %str1, i32 0, i32 0), 
+    i8* getelementptr ([21 x i8]* %str2, i32 0, i32 0), 
+    i8* getelementptr ([33 x i8]* %str3, i32 0, i32 0) }, section "llvm.metadata"
+    
+;;
 ;; Define the compile unit for the header file "/Users/mine/sources/MyHeader.h".
 ;;
-!1 = metadata !{
-  i32 458769,    ;; Tag
-  i32 0,         ;; Unused
-  i32 4,         ;; Language Id
-  metadata !"MyHeader.h", 
-  metadata !"/Users/mine/sources", 
-  metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)", 
-  i1 false,      ;; Main Compile Unit
-  i1 false,      ;; Optimized compile unit
-  metadata !"",  ;; Compiler flags
-  i32 0}         ;; Runtime version
-
+%llvm.dbg.compile_unit2 = internal constant %llvm.dbg.compile_unit.type {
+    uint add(uint 17, uint 262144), 
+    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to {  }*), 
+    uint 1, 
+    uint 1, 
+    i8* getelementptr ([11 x i8]* %str4, int 0, int 0), 
+    i8* getelementptr ([21 x i8]* %str2, int 0, int 0), 
+    i8* getelementptr ([33 x i8]* %str3, int 0, int 0) }, section "llvm.metadata"
+
+;;
+;; Define each of the strings used in the compile units.
+;;
+%str1 = internal constant [13 x i8] c"MySource.cpp\00", section "llvm.metadata";
+%str2 = internal constant [21 x i8] c"/Users/mine/sources/\00", section "llvm.metadata";
+%str3 = internal constant [33 x i8] c"4.0.1 LLVM (LLVM research group)\00", section "llvm.metadata";
+%str4 = internal constant [11 x i8] c"MyHeader.h\00", section "llvm.metadata";
 ...
 
@@ -1142,51 +1167,65 @@
 ;;
+;; Define types used. One for global variable anchors, one for the global
+;; variable descriptor, one for the global's basic type and one for the global's
+;; compile unit.
+;;
+%llvm.dbg.anchor.type = type { uint, uint }
+%llvm.dbg.global_variable.type = type { uint, {  }*, {  }*, i8*, {  }*, uint, {  }*, bool, bool, {  }*, uint }
+%llvm.dbg.basictype.type = type { uint, {  }*, i8*, {  }*, int, uint, uint, uint, uint }
+%llvm.dbg.compile_unit.type = ...
+...
+;;
 ;; Define the global itself.
 ;;
 %MyGlobal = global int 100
 ...
 ;;
-;; List of debug info of globals
+;; Define the anchor for global variables.  Note that the second field of the
+;; anchor is 52, which is the same as the tag for global variables
+;; (52 = DW_TAG_variable.)
 ;;
-!llvm.dbg.gv = !{!0}
+%llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { uint 0, uint 52 }, section "llvm.metadata"
 
 ;;
 ;; Define the global variable descriptor.  Note the reference to the global
 ;; variable anchor and the global variable itself.
 ;;
-!0 = metadata !{
-  i32 458804,              ;; Tag
-  i32 0,                   ;; Unused
-  metadata !1,             ;; Context
-  metadata !"MyGlobal",    ;; Name
-  metadata !"MyGlobal",    ;; Display Name
-  metadata !"MyGlobal",    ;; Linkage Name
-  metadata !1,             ;; Compile Unit
-  i32 1,                   ;; Line Number
-  metadata !2,             ;; Type
-  i1 false,                ;; Is a local variable
-  i1 true,                 ;; Is this a definition
-  i32* @MyGlobal           ;; The global variable
-}
-
+%llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
+    uint add(uint 52, uint 262144), 
+    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to {  }*), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([9 x i8]* %str1, int 0, int 0), 
+    i8* getelementptr ([1 x i8]* %str2, int 0, int 0), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    uint 1,
+    {  }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to {  }*), 
+    bool false, 
+    bool true, 
+    {  }* cast (int* %MyGlobal to {  }*) }, section "llvm.metadata"
+    
 ;;
 ;; Define the basic type of 32 bit signed integer.  Note that since int is an
 ;; intrinsic type the source file is NULL and line 0.
 ;;    
-!2 = metadata !{
-  i32 458788,              ;; Tag
-  metadata !1,             ;; Context
-  metadata !"int",         ;; Name
-  metadata !1,             ;; Compile Unit
-  i32 0,                   ;; Line number
-  i64 32,                  ;; Size in Bits
-  i64 32,                  ;; Align in Bits
-  i64 0,                   ;; Offset in Bits
-  i32 0,                   ;; Flags
-  i32 5                    ;; Encoding
-}
-
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([4 x i8]* %str3, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 32, 
+    uint 32, 
+    uint 0, 
+    uint 5 }, section "llvm.metadata"
+
+;;
+;; Define the names of the global variable and basic type.
+;;
+%str1 = internal constant [9 x i8] c"MyGlobal\00", section "llvm.metadata"
+%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
+%str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
 
@@ -1214,27 +1253,46 @@
 ;;
+;; Define types used. One for subprogram anchors, one for the subprogram
+;; descriptor, one for the global's basic type and one for the subprogram's
+;; compile unit.
+;;
+%llvm.dbg.subprogram.type = type { uint, {  }*, {  }*, i8*, {  }*, bool, bool }
+%llvm.dbg.anchor.type = type { uint, uint }
+%llvm.dbg.compile_unit.type = ...
+	
+;;
 ;; Define the anchor for subprograms.  Note that the second field of the
 ;; anchor is 46, which is the same as the tag for subprograms
 ;; (46 = DW_TAG_subprogram.)
 ;;
-!0 = metadata !{
-  i32 458798,        ;; Tag
-  i32 0,             ;; Unused
-  metadata !1,       ;; Context
-  metadata !"main",  ;; Name
-  metadata !"main",  ;; Display name
-  metadata !"main",  ;; Linkage name
-  metadata !1,       ;; Compile unit
-  i32 1,             ;; Line number
-  metadata !2,       ;; Type
-  i1 false,          ;; Is local 
-  i1 true            ;; Is definition
-}
+%llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { uint 0, uint 46 }, section "llvm.metadata"
+
+;;
+;; Define the descriptor for the subprogram.  TODO - more details.
+;;
+%llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type {
+    uint add(uint 46, uint 262144), 
+    {  }* cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to {  }*), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([5 x i8]* %str1, int 0, int 0), 
+    i8* getelementptr ([1 x i8]* %str2, int 0, int 0), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*),
+    uint 1,
+    {  }* null, 
+    bool false, 
+    bool true }, section "llvm.metadata"
+
+;;
+;; Define the name of the subprogram.
+;;
+%str1 = internal constant [5 x i8] c"main\00", section "llvm.metadata"
+%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
+
 ;;
 ;; Define the subprogram itself.
 ;;
-define i32 @main(i32 %argc, i8** %argv) {
+int %main(int %argc, i8** %argv) {
 ...
 }
 
@@ -1262,18 +1320,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"bool",  ;; Name
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 8,             ;; Size in Bits
-  i64 8,             ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 2              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([5 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 32, 
+    uint 32, 
+    uint 0, 
+    uint 2 }, section "llvm.metadata"
+%str1 = internal constant [5 x i8] c"bool\00", section "llvm.metadata"
 
@@ -1288,18 +1345,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"char",  ;; Name
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 8,             ;; Size in Bits
-  i64 8,             ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 6              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([5 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 8, 
+    uint 8, 
+    uint 0, 
+    uint 6 }, section "llvm.metadata"
+%str1 = internal constant [5 x i8] c"char\00", section "llvm.metadata"
 
@@ -1314,18 +1370,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"unsigned char", 
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 8,             ;; Size in Bits
-  i64 8,             ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 8              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([14 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 8, 
+    uint 8, 
+    uint 0, 
+    uint 8 }, section "llvm.metadata"
+%str1 = internal constant [14 x i8] c"unsigned char\00", section "llvm.metadata"
 
@@ -1340,18 +1395,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"short int",
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 16,            ;; Size in Bits
-  i64 16,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 5              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([10 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 16, 
+    uint 16, 
+    uint 0, 
+    uint 5 }, section "llvm.metadata"
+%str1 = internal constant [10 x i8] c"short int\00", section "llvm.metadata"
 
@@ -1366,18 +1420,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"short unsigned int",
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 16,            ;; Size in Bits
-  i64 16,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 7              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([19 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 16, 
+    uint 16, 
+    uint 0, 
+    uint 7 }, section "llvm.metadata"
+%str1 = internal constant [19 x i8] c"short unsigned int\00", section "llvm.metadata"
 
@@ -1392,18 +1445,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"int",   ;; Name
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 32,            ;; Size in Bits
-  i64 32,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 5              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([4 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 32, 
+    uint 32, 
+    uint 0, 
+    uint 5 }, section "llvm.metadata"
+%str1 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
 
@@ -1417,18 +1469,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"unsigned int",
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 32,            ;; Size in Bits
-  i64 32,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 7              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([13 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 32, 
+    uint 32, 
+    uint 0, 
+    uint 7 }, section "llvm.metadata"
+%str1 = internal constant [13 x i8] c"unsigned int\00", section "llvm.metadata"
 
@@ -1443,18 +1494,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"long long int",
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 64,            ;; Size in Bits
-  i64 64,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 5              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([14 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 64, 
+    uint 64, 
+    uint 0, 
+    uint 5 }, section "llvm.metadata"
+%str1 = internal constant [14 x i8] c"long long int\00", section "llvm.metadata"
 
@@ -1469,18 +1519,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"long long unsigned int",
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 64,            ;; Size in Bits
-  i64 64,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 7              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([23 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 64, 
+    uint 64, 
+    uint 0, 
+    uint 7 }, section "llvm.metadata"
+%str1 = internal constant [23 x 8] c"long long unsigned int\00", section "llvm.metadata"
 
@@ -1495,18 +1544,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"float",
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 32,            ;; Size in Bits
-  i64 32,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 4              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    i8* getelementptr ([6 x i8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 32, 
+    uint 32, 
+    uint 0, 
+    uint 4 }, section "llvm.metadata"
+%str1 = internal constant [6 x i8] c"float\00", section "llvm.metadata"
 
@@ -1521,18 +1569,17 @@
-!2 = metadata !{
-  i32 458788,        ;; Tag
-  metadata !1,       ;; Context
-  metadata !"double",;; Name
-  metadata !1,       ;; Compile Unit
-  i32 0,             ;; Line number
-  i64 64,            ;; Size in Bits
-  i64 64,            ;; Align in Bits
-  i64 0,             ;; Offset in Bits
-  i32 0,             ;; Flags
-  i32 4              ;; Encoding
-}
+%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
+    uint add(uint 36, uint 262144), 
+    {  }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to {  }*), 
+    8* getelementptr ([7 x 8]* %str1, int 0, int 0), 
+    {  }* null, 
+    int 0, 
+    uint 64, 
+    uint 64, 
+    uint 0, 
+    uint 4 }, section "llvm.metadata"
+%str1 = internal constant [7 x 8] c"double\00", section "llvm.metadata"
 
@@ -1560,64 +1607,60 @@ ;; ;; Define the typedef "IntPtr". ;; -!2 = metadata !{ - i32 458774, ;; Tag - metadata !1, ;; Context - metadata !"IntPtr", ;; Name - metadata !3, ;; Compile unit - i32 0, ;; Line number - i64 0, ;; Size in bits - i64 0, ;; Align in bits - i64 0, ;; Offset in bits - i32 0, ;; Flags - metadata !4 ;; Derived From type -} +%llvm.dbg.derivedtype1 = internal constant %llvm.dbg.derivedtype.type { + uint add(uint 22, uint 262144), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + i8* getelementptr ([7 x 8]* %str1, int 0, int 0), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + int 1, + uint 0, + uint 0, + uint 0, + { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype2 to { }*) }, section "llvm.metadata" +%str1 = internal constant [7 x 8] c"IntPtr\00", section "llvm.metadata" ;; ;; Define the pointer type. ;; -!4 = metadata !{ - i32 458767, ;; Tag - metadata !1, ;; Context - metadata !"", ;; Name - metadata !1, ;; Compile unit - i32 0, ;; Line number - i64 64, ;; Size in bits - i64 64, ;; Align in bits - i64 0, ;; Offset in bits - i32 0, ;; Flags - metadata !5 ;; Derived From type -} +%llvm.dbg.derivedtype2 = internal constant %llvm.dbg.derivedtype.type { + uint add(uint 15, uint 262144), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + i8* null, + { }* null, + int 0, + uint 32, + uint 32, + uint 0, + { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype3 to { }*) }, section "llvm.metadata" + ;; ;; Define the const type. ;; -!5 = metadata !{ - i32 458790, ;; Tag - metadata !1, ;; Context - metadata !"", ;; Name - metadata !1, ;; Compile unit - i32 0, ;; Line number - i64 32, ;; Size in bits - i64 32, ;; Align in bits - i64 0, ;; Offset in bits - i32 0, ;; Flags - metadata !6 ;; Derived From type -} +%llvm.dbg.derivedtype3 = internal constant %llvm.dbg.derivedtype.type { + uint add(uint 38, uint 262144), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + i8* null, + { }* null, + int 0, + uint 0, + uint 0, + uint 0, + { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype1 to { }*) }, section "llvm.metadata" + ;; ;; Define the int type. ;; -!6 = metadata !{ - i32 458788, ;; Tag - metadata !1, ;; Context - metadata !"int", ;; Name - metadata !1, ;; Compile unit - i32 0, ;; Line number - i64 32, ;; Size in bits - i64 32, ;; Align in bits - i64 0, ;; Offset in bits - i32 0, ;; Flags - 5 ;; Encoding -} +%llvm.dbg.basictype1 = internal constant %llvm.dbg.basictype.type { + uint add(uint 36, uint 262144), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + 8* getelementptr ([4 x 8]* %str2, int 0, int 0), + { }* null, + int 0, + uint 32, + uint 32, + uint 0, + uint 5 }, section "llvm.metadata" +%str2 = internal constant [4 x 8] c"int\00", section "llvm.metadata"
@@ -1649,88 +1692,86 @@ ;; ;; Define basic type for unsigned int. ;; -!5 = metadata !{ - i32 458788, ;; Tag - metadata !1, ;; Context - metadata !"unsigned int", - metadata !1, ;; Compile Unit - i32 0, ;; Line number - i64 32, ;; Size in Bits - i64 32, ;; Align in Bits - i64 0, ;; Offset in Bits - i32 0, ;; Flags - i32 7 ;; Encoding -} +%llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { + uint add(uint 36, uint 262144), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + i8* getelementptr ([13 x i8]* %str1, int 0, int 0), + { }* null, + int 0, + uint 32, + uint 32, + uint 0, + uint 7 }, section "llvm.metadata" +%str1 = internal constant [13 x i8] c"unsigned int\00", section "llvm.metadata" + ;; ;; Define composite type for struct Color. ;; -!2 = metadata !{ - i32 458771, ;; Tag - metadata !1, ;; Context - metadata !"Color", ;; Name - metadata !1, ;; Compile unit - i32 1, ;; Line number - i64 96, ;; Size in bits - i64 32, ;; Align in bits - i64 0, ;; Offset in bits - i32 0, ;; Flags - null, ;; Derived From - metadata !3, ;; Elements - i32 0 ;; Runtime Language -} +%llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type { + uint add(uint 19, uint 262144), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + i8* getelementptr ([6 x i8]* %str2, int 0, int 0), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + int 1, + uint 96, + uint 32, + uint 0, + { }* null, + { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata" +%str2 = internal constant [6 x i8] c"Color\00", section "llvm.metadata" ;; ;; Define the Red field. ;; -!4 = metadata !{ - i32 458765, ;; Tag - metadata !1, ;; Context - metadata !"Red", ;; Name - metadata !1, ;; Compile Unit - i32 2, ;; Line number - i64 32, ;; Size in bits - i64 32, ;; Align in bits - i64 0, ;; Offset in bits - i32 0, ;; Flags - metadata !5 ;; Derived From type -} +%llvm.dbg.derivedtype1 = internal constant %llvm.dbg.derivedtype.type { + uint add(uint 13, uint 262144), + { }* null, + i8* getelementptr ([4 x i8]* %str3, int 0, int 0), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + int 2, + uint 32, + uint 32, + uint 0, + { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*) }, section "llvm.metadata" +%str3 = internal constant [4 x i8] c"Red\00", section "llvm.metadata" ;; ;; Define the Green field. ;; -!6 = metadata !{ - i32 458765, ;; Tag - metadata !1, ;; Context - metadata !"Green", ;; Name - metadata !1, ;; Compile Unit - i32 3, ;; Line number - i64 32, ;; Size in bits - i64 32, ;; Align in bits - i64 32, ;; Offset in bits - i32 0, ;; Flags - metadata !5 ;; Derived From type -} +%llvm.dbg.derivedtype2 = internal constant %llvm.dbg.derivedtype.type { + uint add(uint 13, uint 262144), + { }* null, + i8* getelementptr ([6 x i8]* %str4, int 0, int 0), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + int 3, + uint 32, + uint 32, + uint 32, + { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*) }, section "llvm.metadata" +%str4 = internal constant [6 x i8] c"Green\00", section "llvm.metadata" ;; ;; Define the Blue field. ;; -!7 = metadata !{ - i32 458765, ;; Tag - metadata !1, ;; Context - metadata !"Blue", ;; Name - metadata !1, ;; Compile Unit - i32 4, ;; Line number - i64 32, ;; Size in bits - i64 32, ;; Align in bits - i64 64, ;; Offset in bits - i32 0, ;; Flags - metadata !5 ;; Derived From type -} +%llvm.dbg.derivedtype3 = internal constant %llvm.dbg.derivedtype.type { + uint add(uint 13, uint 262144), + { }* null, + i8* getelementptr ([5 x i8]* %str5, int 0, int 0), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + int 4, + uint 32, + uint 32, + uint 64, + { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*) }, section "llvm.metadata" +%str5 = internal constant [5 x 8] c"Blue\00", section "llvm.metadata" ;; ;; Define the array of fields used by the composite type Color. ;; -!3 = metadata !{metadata !4, metadata !6, metadata !7} +%llvm.dbg.array = internal constant [3 x { }*] [ + { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype1 to { }*), + { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype2 to { }*), + { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype3 to { }*) ], section "llvm.metadata"
@@ -1762,41 +1803,53 @@ ;; ;; Define composite type for enum Trees ;; -!2 = metadata !{ - i32 458756, ;; Tag - metadata !1, ;; Context - metadata !"Trees", ;; Name - metadata !1, ;; Compile unit - i32 1, ;; Line number - i64 32, ;; Size in bits - i64 32, ;; Align in bits - i64 0, ;; Offset in bits - i32 0, ;; Flags - null, ;; Derived From type - metadata !3, ;; Elements - i32 0 ;; Runtime language -} - -;; -;; Define the array of enumerators used by composite type Trees. -;; -!3 = metadata !{metadata !4, metadata !5, metadata !6} +%llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type { + uint add(uint 4, uint 262144), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + i8* getelementptr ([6 x i8]* %str1, int 0, int 0), + { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), + int 1, + uint 32, + uint 32, + uint 0, + { }* null, + { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section "llvm.metadata" +%str1 = internal constant [6 x i8] c"Trees\00", section "llvm.metadata" ;; ;; Define Spruce enumerator. ;; -!4 = metadata !{i32 458792, metadata !"Spruce", i64 100} +%llvm.dbg.enumerator1 = internal constant %llvm.dbg.enumerator.type { + uint add(uint 40, uint 262144), + i8* getelementptr ([7 x i8]* %str2, int 0, int 0), + int 100 }, section "llvm.metadata" +%str2 = internal constant [7 x i8] c"Spruce\00", section "llvm.metadata" ;; ;; Define Oak enumerator. ;; -!5 = metadata !{i32 458792, metadata !"Oak", i64 200} +%llvm.dbg.enumerator2 = internal constant %llvm.dbg.enumerator.type { + uint add(uint 40, uint 262144), + i8* getelementptr ([4 x i8]* %str3, int 0, int 0), + int 200 }, section "llvm.metadata" +%str3 = internal constant [4 x i8] c"Oak\00", section "llvm.metadata" ;; ;; Define Maple enumerator. ;; -!6 = metadata !{i32 458792, metadata !"Maple", i64 300} +%llvm.dbg.enumerator3 = internal constant %llvm.dbg.enumerator.type { + uint add(uint 40, uint 262144), + i8* getelementptr ([6 x i8]* %str4, int 0, int 0), + int 300 }, section "llvm.metadata" +%str4 = internal constant [6 x i8] c"Maple\00", section "llvm.metadata" +;; +;; Define the array of enumerators used by composite type Trees. +;; +%llvm.dbg.array = internal constant [3 x { }*] [ + { }* cast (%llvm.dbg.enumerator.type* %llvm.dbg.enumerator1 to { }*), + { }* cast (%llvm.dbg.enumerator.type* %llvm.dbg.enumerator2 to { }*), + { }* cast (%llvm.dbg.enumerator.type* %llvm.dbg.enumerator3 to { }*) ], section "llvm.metadata"
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Wed Aug 26 00:01:18 2009 @@ -17,7 +17,6 @@ #ifndef LLVM_ANALYSIS_DEBUGINFO_H #define LLVM_ANALYSIS_DEBUGINFO_H -#include "llvm/Metadata.h" #include "llvm/Target/TargetMachine.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/DenseMap.h" @@ -45,12 +44,12 @@ class DIDescriptor { protected: - MDNode *DbgNode; + GlobalVariable *DbgGV; - /// DIDescriptor constructor. If the specified node is non-null, check + /// DIDescriptor constructor. If the specified GV is non-null, this checks /// to make sure that the tag in the descriptor matches 'RequiredTag'. If /// not, the debug info is corrupt and we ignore it. - DIDescriptor(MDNode *N, unsigned RequiredTag); + DIDescriptor(GlobalVariable *GV, unsigned RequiredTag); const std::string &getStringField(unsigned Elt, std::string &Result) const; unsigned getUnsignedField(unsigned Elt) const { @@ -61,18 +60,18 @@ template DescTy getFieldAs(unsigned Elt) const { - return DescTy(getDescriptorField(Elt).getNode()); + return DescTy(getDescriptorField(Elt).getGV()); } GlobalVariable *getGlobalVariableField(unsigned Elt) const; public: - explicit DIDescriptor() : DbgNode(0) {} - explicit DIDescriptor(MDNode *N) : DbgNode(N) {} + explicit DIDescriptor() : DbgGV(0) {} + explicit DIDescriptor(GlobalVariable *GV) : DbgGV(GV) {} - bool isNull() const { return DbgNode == 0; } + bool isNull() const { return DbgGV == 0; } - MDNode *getNode() const { return DbgNode; } + GlobalVariable *getGV() const { return DbgGV; } unsigned getVersion() const { return getUnsignedField(0) & LLVMDebugVersionMask; @@ -82,8 +81,8 @@ return getUnsignedField(0) & ~LLVMDebugVersionMask; } - /// ValidDebugInfo - Return true if N represents valid debug info value. - static bool ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel); + /// ValidDebugInfo - Return true if V represents valid debug info value. + static bool ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel); /// dump - print descriptor. void dump() const; @@ -92,8 +91,8 @@ /// DISubrange - This is used to represent ranges, for array bounds. class DISubrange : public DIDescriptor { public: - explicit DISubrange(MDNode *N = 0) - : DIDescriptor(N, dwarf::DW_TAG_subrange_type) {} + explicit DISubrange(GlobalVariable *GV = 0) + : DIDescriptor(GV, dwarf::DW_TAG_subrange_type) {} int64_t getLo() const { return (int64_t)getUInt64Field(1); } int64_t getHi() const { return (int64_t)getUInt64Field(2); } @@ -102,8 +101,7 @@ /// DIArray - This descriptor holds an array of descriptors. class DIArray : public DIDescriptor { public: - explicit DIArray(MDNode *N = 0) - : DIDescriptor(N) {} + explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {} unsigned getNumElements() const; DIDescriptor getElement(unsigned Idx) const { @@ -114,8 +112,8 @@ /// DICompileUnit - A wrapper for a compile unit. class DICompileUnit : public DIDescriptor { public: - explicit DICompileUnit(MDNode *N = 0) - : DIDescriptor(N, dwarf::DW_TAG_compile_unit) {} + explicit DICompileUnit(GlobalVariable *GV = 0) + : DIDescriptor(GV, dwarf::DW_TAG_compile_unit) {} unsigned getLanguage() const { return getUnsignedField(2); } const std::string &getFilename(std::string &F) const { @@ -156,8 +154,8 @@ /// type/precision or a file/line pair for location info. class DIEnumerator : public DIDescriptor { public: - explicit DIEnumerator(MDNode *N = 0) - : DIDescriptor(N, dwarf::DW_TAG_enumerator) {} + explicit DIEnumerator(GlobalVariable *GV = 0) + : DIDescriptor(GV, dwarf::DW_TAG_enumerator) {} const std::string &getName(std::string &F) const { return getStringField(1, F); @@ -178,11 +176,10 @@ }; protected: - DIType(MDNode *N, unsigned Tag) - : DIDescriptor(N, Tag) {} + DIType(GlobalVariable *GV, unsigned Tag) : DIDescriptor(GV, Tag) {} // This ctor is used when the Tag has already been validated by a derived // ctor. - DIType(MDNode *N, bool, bool) : DIDescriptor(N) {} + DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {} public: /// isDerivedType - Return true if the specified tag is legal for @@ -202,7 +199,7 @@ /// Verify - Verify that a type descriptor is well formed. bool Verify() const; public: - explicit DIType(MDNode *N); + explicit DIType(GlobalVariable *GV); explicit DIType() {} virtual ~DIType() {} @@ -238,8 +235,8 @@ /// DIBasicType - A basic type, like 'int' or 'float'. class DIBasicType : public DIType { public: - explicit DIBasicType(MDNode *N = 0) - : DIType(N, dwarf::DW_TAG_base_type) {} + explicit DIBasicType(GlobalVariable *GV) + : DIType(GV, dwarf::DW_TAG_base_type) {} unsigned getEncoding() const { return getUnsignedField(9); } @@ -251,13 +248,13 @@ /// a typedef, a pointer or reference, etc. class DIDerivedType : public DIType { protected: - explicit DIDerivedType(MDNode *N, bool, bool) - : DIType(N, true, true) {} + explicit DIDerivedType(GlobalVariable *GV, bool, bool) + : DIType(GV, true, true) {} public: - explicit DIDerivedType(MDNode *N = 0) - : DIType(N, true, true) { - if (DbgNode && !isDerivedType(getTag())) - DbgNode = 0; + explicit DIDerivedType(GlobalVariable *GV) + : DIType(GV, true, true) { + if (GV && !isDerivedType(getTag())) + DbgGV = 0; } DIType getTypeDerivedFrom() const { return getFieldAs(9); } @@ -279,10 +276,10 @@ /// FIXME: Why is this a DIDerivedType?? class DICompositeType : public DIDerivedType { public: - explicit DICompositeType(MDNode *N = 0) - : DIDerivedType(N, true, true) { - if (N && !isCompositeType(getTag())) - DbgNode = 0; + explicit DICompositeType(GlobalVariable *GV) + : DIDerivedType(GV, true, true) { + if (GV && !isCompositeType(getTag())) + DbgGV = 0; } DIArray getTypeArray() const { return getFieldAs(10); } @@ -298,8 +295,8 @@ /// DIGlobal - This is a common class for global variables and subprograms. class DIGlobal : public DIDescriptor { protected: - explicit DIGlobal(MDNode *N, unsigned RequiredTag) - : DIDescriptor(N, RequiredTag) {} + explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag) + : DIDescriptor(GV, RequiredTag) {} /// isSubprogram - Return true if the specified tag is legal for /// DISubprogram. @@ -342,8 +339,8 @@ /// DISubprogram - This is a wrapper for a subprogram (e.g. a function). class DISubprogram : public DIGlobal { public: - explicit DISubprogram(MDNode *N = 0) - : DIGlobal(N, dwarf::DW_TAG_subprogram) {} + explicit DISubprogram(GlobalVariable *GV = 0) + : DIGlobal(GV, dwarf::DW_TAG_subprogram) {} DICompositeType getType() const { return getFieldAs(8); } @@ -353,7 +350,7 @@ DICompositeType DCT(getFieldAs(8)); if (!DCT.isNull()) { DIArray A = DCT.getTypeArray(); - DIType T(A.getElement(0).getNode()); + DIType T(A.getElement(0).getGV()); return T.getName(F); } DIType T(getFieldAs(8)); @@ -374,8 +371,8 @@ /// DIGlobalVariable - This is a wrapper for a global variable. class DIGlobalVariable : public DIGlobal { public: - explicit DIGlobalVariable(MDNode *N = 0) - : DIGlobal(N, dwarf::DW_TAG_variable) {} + explicit DIGlobalVariable(GlobalVariable *GV = 0) + : DIGlobal(GV, dwarf::DW_TAG_variable) {} GlobalVariable *getGlobal() const { return getGlobalVariableField(11); } @@ -390,10 +387,10 @@ /// global etc). class DIVariable : public DIDescriptor { public: - explicit DIVariable(MDNode *N = 0) - : DIDescriptor(N) { - if (DbgNode && !isVariable(getTag())) - DbgNode = 0; + explicit DIVariable(GlobalVariable *GV = 0) + : DIDescriptor(GV) { + if (GV && !isVariable(getTag())) + DbgGV = 0; } DIDescriptor getContext() const { return getDescriptorField(1); } @@ -417,8 +414,8 @@ /// DIBlock - This is a wrapper for a block (e.g. a function, scope, etc). class DIBlock : public DIDescriptor { public: - explicit DIBlock(MDNode *N = 0) - : DIDescriptor(N, dwarf::DW_TAG_lexical_block) {} + explicit DIBlock(GlobalVariable *GV = 0) + : DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {} DIDescriptor getContext() const { return getDescriptorField(1); } }; @@ -545,6 +542,10 @@ private: Constant *GetTagConstant(unsigned TAG); + Constant *GetStringConstant(const std::string &String); + + /// getCastToEmpty - Return the descriptor as a Constant* with type '{}*'. + Constant *getCastToEmpty(DIDescriptor D); }; /// Finds the stoppoint coressponding to this instruction, that is the @@ -606,6 +607,7 @@ /// isInlinedFnEnd - Return true if REI is ending an inlined function. bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function *CurrentFn); + /// DebugInfoFinder - This object collects DebugInfo from a module. class DebugInfoFinder { @@ -649,7 +651,7 @@ bool addType(DIType DT); public: - typedef SmallVector::iterator iterator; + typedef SmallVector::iterator iterator; iterator compile_unit_begin() { return CUs.begin(); } iterator compile_unit_end() { return CUs.end(); } iterator subprogram_begin() { return SPs.begin(); } @@ -665,11 +667,12 @@ unsigned type_count() { return TYs.size(); } private: - SmallVector CUs; // Compile Units - SmallVector SPs; // Subprograms - SmallVector GVs; // Global Variables; - SmallVector TYs; // Types - SmallPtrSet NodesSeen; + SmallVector CUs; // Compile Units + SmallVector SPs; // Subprograms + SmallVector GVs; // Global Variables + SmallVector TYs; // Types + SmallPtrSet NodesSeen; + }; } // end namespace llvm Modified: llvm/trunk/include/llvm/AutoUpgrade.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/AutoUpgrade.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/AutoUpgrade.h (original) +++ llvm/trunk/include/llvm/AutoUpgrade.h Wed Aug 26 00:01:18 2009 @@ -15,7 +15,6 @@ #define LLVM_AUTOUPGRADE_H namespace llvm { - class Module; class Function; class CallInst; @@ -35,9 +34,6 @@ /// so that it can update all calls to the old function. void UpgradeCallsToIntrinsic(Function* F); - /// This function checks debug info intrinsics. If an intrinsic is invalid - /// then this function simply removes the intrinsic. - void CheckDebugInfoIntrinsics(Module *M); } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Wed Aug 26 00:01:18 2009 @@ -33,7 +33,7 @@ class MachineInstr; class Value; class Module; -class MDNode; +class GlobalVariable; class MCAsmInfo; class raw_ostream; class Instruction; @@ -88,17 +88,17 @@ unsigned RecordSourceLine(unsigned Line, unsigned Col, DICompileUnit CU); /// RecordRegionStart - Indicate the start of a region. - unsigned RecordRegionStart(MDNode *N); + unsigned RecordRegionStart(GlobalVariable *V); /// RecordRegionEnd - Indicate the end of a region. - unsigned RecordRegionEnd(MDNode *N); + unsigned RecordRegionEnd(GlobalVariable *V); /// getRecordSourceLineCount - Count source lines. unsigned getRecordSourceLineCount(); /// RecordVariable - Indicate the declaration of a local variable. /// - void RecordVariable(MDNode *N, unsigned FrameIndex); + void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should /// be emitted. Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Wed Aug 26 00:01:18 2009 @@ -327,7 +327,7 @@ /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given /// source file, line, and column. If none currently exists, create a new /// DebugLocTuple, and insert it into the DebugIdMap. - unsigned getOrCreateDebugLocID(MDNode *CompileUnit, + unsigned getOrCreateDebugLocID(GlobalVariable *CompileUnit, unsigned Line, unsigned Col); /// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Aug 26 00:01:18 2009 @@ -322,7 +322,7 @@ SDValue getValueType(EVT); SDValue getRegister(unsigned Reg, EVT VT); SDValue getDbgStopPoint(DebugLoc DL, SDValue Root, - unsigned Line, unsigned Col, MDNode *CU); + unsigned Line, unsigned Col, Value *CU); SDValue getLabel(unsigned Opcode, DebugLoc dl, SDValue Root, unsigned LabelID); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Wed Aug 26 00:01:18 2009 @@ -2015,10 +2015,10 @@ SDUse Chain; unsigned Line; unsigned Column; - MDNode *CU; + Value *CU; friend class SelectionDAG; DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c, - MDNode *cu) + Value *cu) : SDNode(ISD::DBG_STOPPOINT, DebugLoc::getUnknownLoc(), getSDVTList(MVT::Other)), Line(l), Column(c), CU(cu) { InitOperands(&Chain, ch); @@ -2026,7 +2026,7 @@ public: unsigned getLine() const { return Line; } unsigned getColumn() const { return Column; } - MDNode *getCompileUnit() const { return CU; } + Value *getCompileUnit() const { return CU; } static bool classof(const DbgStopPointSDNode *) { return true; } static bool classof(const SDNode *N) { Modified: llvm/trunk/include/llvm/IntrinsicInst.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicInst.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicInst.h (original) +++ llvm/trunk/include/llvm/IntrinsicInst.h Wed Aug 26 00:01:18 2009 @@ -25,7 +25,6 @@ #define LLVM_INTRINSICINST_H #include "llvm/Constants.h" -#include "llvm/Metadata.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" @@ -86,8 +85,8 @@ struct DbgStopPointInst : public DbgInfoIntrinsic { Value *getLineValue() const { return const_cast(getOperand(1)); } Value *getColumnValue() const { return const_cast(getOperand(2)); } - MDNode *getContext() const { - return cast(getOperand(3)); + Value *getContext() const { + return StripCast(getOperand(3)); } unsigned getLine() const { @@ -113,7 +112,7 @@ /// DbgFuncStartInst - This represents the llvm.dbg.func.start instruction. /// struct DbgFuncStartInst : public DbgInfoIntrinsic { - MDNode *getSubprogram() const { return cast(getOperand(1)); } + Value *getSubprogram() const { return StripCast(getOperand(1)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgFuncStartInst *) { return true; } @@ -128,7 +127,7 @@ /// DbgRegionStartInst - This represents the llvm.dbg.region.start /// instruction. struct DbgRegionStartInst : public DbgInfoIntrinsic { - MDNode *getContext() const { return cast(getOperand(1)); } + Value *getContext() const { return StripCast(getOperand(1)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgRegionStartInst *) { return true; } @@ -143,7 +142,7 @@ /// DbgRegionEndInst - This represents the llvm.dbg.region.end instruction. /// struct DbgRegionEndInst : public DbgInfoIntrinsic { - MDNode *getContext() const { return cast(getOperand(1)); } + Value *getContext() const { return StripCast(getOperand(1)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgRegionEndInst *) { return true; } @@ -159,7 +158,7 @@ /// struct DbgDeclareInst : public DbgInfoIntrinsic { Value *getAddress() const { return getOperand(1); } - MDNode *getVariable() const { return cast(getOperand(2)); } + Value *getVariable() const { return StripCast(getOperand(2)); } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DbgDeclareInst *) { return true; } Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Wed Aug 26 00:01:18 2009 @@ -110,7 +110,6 @@ def llvm_anyptr_ty : LLVMAnyPointerType; // (space)i8* def llvm_empty_ty : LLVMType; // { } def llvm_descriptor_ty : LLVMPointerType; // { }* -def llvm_metadata_ty : LLVMType; // !{...} def llvm_v2i8_ty : LLVMType; // 2 x i8 def llvm_v4i8_ty : LLVMType; // 4 x i8 @@ -279,12 +278,12 @@ let Properties = [IntrNoMem] in { def int_dbg_stoppoint : Intrinsic<[llvm_void_ty], [llvm_i32_ty, llvm_i32_ty, - llvm_metadata_ty]>; - def int_dbg_region_start : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>; - def int_dbg_region_end : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>; - def int_dbg_func_start : Intrinsic<[llvm_void_ty], [llvm_metadata_ty]>; + llvm_descriptor_ty]>; + def int_dbg_region_start : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>; + def int_dbg_region_end : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>; + def int_dbg_func_start : Intrinsic<[llvm_void_ty], [llvm_descriptor_ty]>; def int_dbg_declare : Intrinsic<[llvm_void_ty], - [llvm_descriptor_ty, llvm_metadata_ty]>; + [llvm_descriptor_ty, llvm_descriptor_ty]>; } //===------------------ Exception Handling Intrinsics----------------------===// Modified: llvm/trunk/include/llvm/Metadata.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/Metadata.h (original) +++ llvm/trunk/include/llvm/Metadata.h Wed Aug 26 00:01:18 2009 @@ -110,6 +110,7 @@ unsigned getNumOperands() { return User::getNumOperands(); } SmallVector Node; + friend struct ConstantCreator >; protected: explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned NumVals); Modified: llvm/trunk/include/llvm/Support/DebugLoc.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/DebugLoc.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/DebugLoc.h (original) +++ llvm/trunk/include/llvm/Support/DebugLoc.h Wed Aug 26 00:01:18 2009 @@ -19,19 +19,19 @@ #include namespace llvm { - class MDNode; + class GlobalVariable; /// DebugLocTuple - Debug location tuple of filename id, line and column. /// struct DebugLocTuple { - MDNode *CompileUnit; + GlobalVariable *CompileUnit; unsigned Line, Col; DebugLocTuple() : CompileUnit(0), Line(~0U), Col(~0U) {}; - DebugLocTuple(MDNode *n, unsigned l, unsigned c) - : CompileUnit(n), Line(l), Col(c) {}; + DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c) + : CompileUnit(v), Line(l), Col(c) {}; bool operator==(const DebugLocTuple &DLT) const { return CompileUnit == DLT.CompileUnit && @@ -69,10 +69,10 @@ return DebugLocTuple(0, ~0U, ~0U); } static inline DebugLocTuple getTombstoneKey() { - return DebugLocTuple((MDNode*)~1U, ~1U, ~1U); + return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U); } static unsigned getHashValue(const DebugLocTuple &Val) { - return DenseMapInfo::getHashValue(Val.CompileUnit) ^ + return DenseMapInfo::getHashValue(Val.CompileUnit) ^ DenseMapInfo::getHashValue(Val.Line) ^ DenseMapInfo::getHashValue(Val.Col); } Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Wed Aug 26 00:01:18 2009 @@ -90,7 +90,7 @@ } void PrintDbgInfo::printFuncStart(const DbgFuncStartInst *FS) { - DISubprogram Subprogram(FS->getSubprogram()); + DISubprogram Subprogram(cast(FS->getSubprogram())); std::string Res1, Res2; Out << "; fully qualified function name: " << Subprogram.getDisplayName(Res1) << " return type: " << Subprogram.getReturnTypeName(Res2) Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Wed Aug 26 00:01:18 2009 @@ -21,7 +21,6 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/Analysis/ValueTracking.h" -#include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/DebugLoc.h" #include "llvm/Support/raw_ostream.h" @@ -33,12 +32,18 @@ //===----------------------------------------------------------------------===// /// ValidDebugInfo - Return true if V represents valid debug info value. -/// FIXME : Add DIDescriptor.isValid() -bool DIDescriptor::ValidDebugInfo(MDNode *N, CodeGenOpt::Level OptLevel) { - if (!N) +bool DIDescriptor::ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel) { + if (!V) return false; - DIDescriptor DI(N); + GlobalVariable *GV = dyn_cast(V->stripPointerCasts()); + if (!GV) + return false; + + if (!GV->hasInternalLinkage () && !GV->hasLinkOnceLinkage()) + return false; + + DIDescriptor DI(GV); // Check current version. Allow Version6 for now. unsigned Version = DI.getVersion(); @@ -48,13 +53,13 @@ unsigned Tag = DI.getTag(); switch (Tag) { case DW_TAG_variable: - assert(DIVariable(N).Verify() && "Invalid DebugInfo value"); + assert(DIVariable(GV).Verify() && "Invalid DebugInfo value"); break; case DW_TAG_compile_unit: - assert(DICompileUnit(N).Verify() && "Invalid DebugInfo value"); + assert(DICompileUnit(GV).Verify() && "Invalid DebugInfo value"); break; case DW_TAG_subprogram: - assert(DISubprogram(N).Verify() && "Invalid DebugInfo value"); + assert(DISubprogram(GV).Verify() && "Invalid DebugInfo value"); break; case DW_TAG_lexical_block: // FIXME: This interfers with the quality of generated code during @@ -69,58 +74,67 @@ return true; } -DIDescriptor::DIDescriptor(MDNode *N, unsigned RequiredTag) { - DbgNode = N; +DIDescriptor::DIDescriptor(GlobalVariable *GV, unsigned RequiredTag) { + DbgGV = GV; // If this is non-null, check to see if the Tag matches. If not, set to null. - if (N && getTag() != RequiredTag) { - DbgNode = 0; - } + if (GV && getTag() != RequiredTag) + DbgGV = 0; } const std::string & DIDescriptor::getStringField(unsigned Elt, std::string &Result) const { - Result.clear(); - if (DbgNode == 0) + if (DbgGV == 0) { + Result.clear(); return Result; + } + + Constant *C = DbgGV->getInitializer(); + if (C == 0 || Elt >= C->getNumOperands()) { + Result.clear(); + return Result; + } + + // Fills in the string if it succeeds + if (!GetConstantStringInfo(C->getOperand(Elt), Result)) + Result.clear(); - if (Elt < DbgNode->getNumElements()) - if (MDString *MDS = dyn_cast_or_null(DbgNode->getElement(Elt))) { - Result.assign(MDS->begin(), MDS->begin() + MDS->length()); - return Result; - } - return Result; } uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const { - if (DbgNode == 0) + if (DbgGV == 0) return 0; + if (!DbgGV->hasInitializer()) return 0; + + Constant *C = DbgGV->getInitializer(); + if (C == 0 || Elt >= C->getNumOperands()) return 0; - if (Elt < DbgNode->getNumElements()) - if (ConstantInt *CI = dyn_cast(DbgNode->getElement(Elt))) - return CI->getZExtValue(); - + if (ConstantInt *CI = dyn_cast(C->getOperand(Elt))) + return CI->getZExtValue(); return 0; } DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { - if (DbgNode == 0) - return DIDescriptor(); + if (DbgGV == 0) return DIDescriptor(); - if (Elt < DbgNode->getNumElements() && DbgNode->getElement(Elt)) - return DIDescriptor(dyn_cast(DbgNode->getElement(Elt))); + Constant *C = DbgGV->getInitializer(); + if (C == 0 || Elt >= C->getNumOperands()) + return DIDescriptor(); - return DIDescriptor(); + C = C->getOperand(Elt); + return DIDescriptor(dyn_cast(C->stripPointerCasts())); } GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const { - if (DbgNode == 0) + if (DbgGV == 0) return 0; + + Constant *C = DbgGV->getInitializer(); + if (C == 0 || Elt >= C->getNumOperands()) return 0; - if (Elt < DbgNode->getNumElements()) - return dyn_cast(DbgNode->getElement(Elt)); - return 0; + C = C->getOperand(Elt); + return dyn_cast(C->stripPointerCasts()); } //===----------------------------------------------------------------------===// @@ -128,13 +142,12 @@ //===----------------------------------------------------------------------===// // Needed by DIVariable::getType(). -DIType::DIType(MDNode *N) : DIDescriptor(N) { - if (!N) return; +DIType::DIType(GlobalVariable *GV) : DIDescriptor(GV) { + if (!GV) return; unsigned tag = getTag(); if (tag != dwarf::DW_TAG_base_type && !DIDerivedType::isDerivedType(tag) && - !DICompositeType::isCompositeType(tag)) { - DbgNode = 0; - } + !DICompositeType::isCompositeType(tag)) + DbgGV = 0; } /// isDerivedType - Return true if the specified tag is legal for @@ -151,8 +164,9 @@ case dwarf::DW_TAG_inheritance: return true; default: - // CompositeTypes are currently modelled as DerivedTypes. - return isCompositeType(Tag); + // FIXME: Even though it doesn't make sense, CompositeTypes are current + // modelled as DerivedTypes, this should return true for them as well. + return false; } } @@ -186,8 +200,10 @@ } unsigned DIArray::getNumElements() const { - assert (DbgNode && "Invalid DIArray"); - return DbgNode->getNumElements(); + assert (DbgGV && "Invalid DIArray"); + Constant *C = DbgGV->getInitializer(); + assert (C && "Invalid DIArray initializer"); + return C->getNumOperands(); } /// replaceAllUsesWith - Replace all uses of debug info referenced by @@ -198,8 +214,8 @@ return; assert (!D.isNull() && "Can not replace with null"); - DbgNode->replaceAllUsesWith(D.getNode()); - delete DbgNode; + getGV()->replaceAllUsesWith(D.getGV()); + getGV()->eraseFromParent(); } /// Verify - Verify that a compile unit is well formed. @@ -325,8 +341,8 @@ /// dump - Print descriptor. void DIDescriptor::dump() const { - errs() << "[" << dwarf::TagString(getTag()) << "] "; - errs().write_hex((intptr_t)DbgNode) << ']'; + errs() << "[" << dwarf::TagString(getTag()) << "] [GV:"; + errs().write_hex((intptr_t)DbgGV) << ']'; } /// dump - Print compile unit. @@ -367,11 +383,11 @@ errs() << " [fwd] "; if (isBasicType(Tag)) - DIBasicType(DbgNode).dump(); + DIBasicType(DbgGV).dump(); else if (isDerivedType(Tag)) - DIDerivedType(DbgNode).dump(); + DIDerivedType(DbgGV).dump(); else if (isCompositeType(Tag)) - DICompositeType(DbgNode).dump(); + DICompositeType(DbgGV).dump(); else { errs() << "Invalid DIType\n"; return; @@ -418,7 +434,7 @@ errs() << " [def] "; if (isGlobalVariable(Tag)) - DIGlobalVariable(DbgNode).dump(); + DIGlobalVariable(DbgGV).dump(); errs() << "\n"; } @@ -458,12 +474,43 @@ EmptyStructPtr = PointerType::getUnqual(StructType::get(VMContext)); } +/// getCastToEmpty - Return this descriptor as a Constant* with type '{}*'. +/// This is only valid when the descriptor is non-null. +Constant *DIFactory::getCastToEmpty(DIDescriptor D) { + if (D.isNull()) return llvm::Constant::getNullValue(EmptyStructPtr); + return ConstantExpr::getBitCast(D.getGV(), EmptyStructPtr); +} + Constant *DIFactory::GetTagConstant(unsigned TAG) { assert((TAG & LLVMDebugVersionMask) == 0 && "Tag too large for debug encoding!"); return ConstantInt::get(Type::getInt32Ty(VMContext), TAG | LLVMDebugVersion); } +Constant *DIFactory::GetStringConstant(const std::string &String) { + // Check string cache for previous edition. + Constant *&Slot = StringCache[String]; + + // Return Constant if previously defined. + if (Slot) return Slot; + + const PointerType *DestTy = PointerType::getUnqual(Type::getInt8Ty(VMContext)); + + // If empty string then use a i8* null instead. + if (String.empty()) + return Slot = ConstantPointerNull::get(DestTy); + + // Construct string as an llvm constant. + Constant *ConstStr = ConstantArray::get(VMContext, String); + + // Otherwise create and return a new string global. + GlobalVariable *StrGV = new GlobalVariable(M, ConstStr->getType(), true, + GlobalVariable::InternalLinkage, + ConstStr, ".str"); + StrGV->setSection("llvm.metadata"); + return Slot = ConstantExpr::getBitCast(StrGV, DestTy); +} + //===----------------------------------------------------------------------===// // DIFactory: Primary Constructors //===----------------------------------------------------------------------===// @@ -471,27 +518,50 @@ /// GetOrCreateArray - Create an descriptor for an array of descriptors. /// This implicitly uniques the arrays created. DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys) { - SmallVector Elts; + SmallVector Elts; - if (NumTys == 0) - Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext))); - else - for (unsigned i = 0; i != NumTys; ++i) - Elts.push_back(Tys[i].getNode()); + for (unsigned i = 0; i != NumTys; ++i) + Elts.push_back(getCastToEmpty(Tys[i])); - return DIArray(MDNode::get(VMContext,Elts.data(), Elts.size())); + Constant *Init = ConstantArray::get(ArrayType::get(EmptyStructPtr, + Elts.size()), + Elts.data(), Elts.size()); + // If we already have this array, just return the uniqued version. + DIDescriptor &Entry = SimpleConstantCache[Init]; + if (!Entry.isNull()) return DIArray(Entry.getGV()); + + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.array"); + GV->setSection("llvm.metadata"); + Entry = DIDescriptor(GV); + return DIArray(GV); } /// GetOrCreateSubrange - Create a descriptor for a value range. This /// implicitly uniques the values returned. DISubrange DIFactory::GetOrCreateSubrange(int64_t Lo, int64_t Hi) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(dwarf::DW_TAG_subrange_type), ConstantInt::get(Type::getInt64Ty(VMContext), Lo), ConstantInt::get(Type::getInt64Ty(VMContext), Hi) }; - return DISubrange(MDNode::get(VMContext, &Elts[0], 3)); + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + // If we already have this range, just return the uniqued version. + DIDescriptor &Entry = SimpleConstantCache[Init]; + if (!Entry.isNull()) return DISubrange(Entry.getGV()); + + M.addTypeName("llvm.dbg.subrange.type", Init->getType()); + + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.subrange"); + GV->setSection("llvm.metadata"); + Entry = DIDescriptor(GV); + return DISubrange(GV); } @@ -506,31 +576,47 @@ bool isOptimized, const char *Flags, unsigned RunTimeVer) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(dwarf::DW_TAG_compile_unit), - llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), + llvm::Constant::getNullValue(EmptyStructPtr), ConstantInt::get(Type::getInt32Ty(VMContext), LangID), - MDString::get(VMContext, Filename), - MDString::get(VMContext, Directory), - MDString::get(VMContext, Producer), + GetStringConstant(Filename), + GetStringConstant(Directory), + GetStringConstant(Producer), ConstantInt::get(Type::getInt1Ty(VMContext), isMain), ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized), - MDString::get(VMContext, Flags), + GetStringConstant(Flags), ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer) }; - - return DICompileUnit(MDNode::get(VMContext, &Elts[0], 10)); + + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.compile_unit.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.compile_unit"); + GV->setSection("llvm.metadata"); + return DICompileUnit(GV); } /// CreateEnumerator - Create a single enumerator value. DIEnumerator DIFactory::CreateEnumerator(const std::string &Name, uint64_t Val){ - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(dwarf::DW_TAG_enumerator), - MDString::get(VMContext, Name), + GetStringConstant(Name), ConstantInt::get(Type::getInt64Ty(VMContext), Val) }; - - return DIEnumerator(MDNode::get(VMContext, &Elts[0], 3)); + + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.enumerator.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.enumerator"); + GV->setSection("llvm.metadata"); + return DIEnumerator(GV); } @@ -543,11 +629,11 @@ uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, unsigned Encoding) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(dwarf::DW_TAG_base_type), - Context.getNode(), - MDString::get(VMContext, Name), - CompileUnit.getNode(), + getCastToEmpty(Context), + GetStringConstant(Name), + getCastToEmpty(CompileUnit), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), @@ -556,7 +642,15 @@ ConstantInt::get(Type::getInt32Ty(VMContext), Encoding) }; - return DIBasicType(MDNode::get(VMContext, &Elts[0], 10)); + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.basictype.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.basictype"); + GV->setSection("llvm.metadata"); + return DIBasicType(GV); } /// CreateDerivedType - Create a derived type like const qualified type, @@ -571,20 +665,28 @@ uint64_t OffsetInBits, unsigned Flags, DIType DerivedFrom) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(Tag), - Context.getNode(), - MDString::get(VMContext, Name), - CompileUnit.getNode(), + getCastToEmpty(Context), + GetStringConstant(Name), + getCastToEmpty(CompileUnit), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits), ConstantInt::get(Type::getInt32Ty(VMContext), Flags), - DerivedFrom.getNode(), + getCastToEmpty(DerivedFrom) }; - - return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10)); + + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.derivedtype.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.derivedtype"); + GV->setSection("llvm.metadata"); + return DIDerivedType(GV); } /// CreateCompositeType - Create a composite type like array, struct, etc. @@ -601,22 +703,30 @@ DIArray Elements, unsigned RuntimeLang) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(Tag), - Context.getNode(), - MDString::get(VMContext, Name), - CompileUnit.getNode(), + getCastToEmpty(Context), + GetStringConstant(Name), + getCastToEmpty(CompileUnit), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits), ConstantInt::get(Type::getInt32Ty(VMContext), Flags), - DerivedFrom.getNode(), - Elements.getNode(), + getCastToEmpty(DerivedFrom), + getCastToEmpty(Elements), ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang) }; - - return DICompositeType(MDNode::get(VMContext, &Elts[0], 12)); + + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.composite.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.composite"); + GV->setSection("llvm.metadata"); + return DICompositeType(GV); } @@ -632,21 +742,29 @@ bool isLocalToUnit, bool isDefinition) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(dwarf::DW_TAG_subprogram), - llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), - Context.getNode(), - MDString::get(VMContext, Name), - MDString::get(VMContext, DisplayName), - MDString::get(VMContext, LinkageName), - CompileUnit.getNode(), + llvm::Constant::getNullValue(EmptyStructPtr), + getCastToEmpty(Context), + GetStringConstant(Name), + GetStringConstant(DisplayName), + GetStringConstant(LinkageName), + getCastToEmpty(CompileUnit), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), - Type.getNode(), + getCastToEmpty(Type), ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition) }; - return DISubprogram(MDNode::get(VMContext, &Elts[0], 11)); + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.subprogram.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.subprogram"); + GV->setSection("llvm.metadata"); + return DISubprogram(GV); } /// CreateGlobalVariable - Create a new descriptor for the specified global. @@ -657,29 +775,30 @@ DICompileUnit CompileUnit, unsigned LineNo, DIType Type,bool isLocalToUnit, bool isDefinition, llvm::GlobalVariable *Val) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(dwarf::DW_TAG_variable), - llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), - Context.getNode(), - MDString::get(VMContext, Name), - MDString::get(VMContext, DisplayName), - MDString::get(VMContext, LinkageName), - CompileUnit.getNode(), + llvm::Constant::getNullValue(EmptyStructPtr), + getCastToEmpty(Context), + GetStringConstant(Name), + GetStringConstant(DisplayName), + GetStringConstant(LinkageName), + getCastToEmpty(CompileUnit), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), - Type.getNode(), + getCastToEmpty(Type), ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition), - Val + ConstantExpr::getBitCast(Val, EmptyStructPtr) }; - - Value *const *Vs = &Elts[0]; - MDNode *Node = MDNode::get(VMContext,Vs, 12); - - // Create a named metadata so that we do not lose this mdnode. - NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv"); - NMD->addElement(Node); - - return DIGlobalVariable(Node); + + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.global_variable.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::LinkOnceAnyLinkage, + Init, "llvm.dbg.global_variable"); + GV->setSection("llvm.metadata"); + return DIGlobalVariable(GV); } @@ -688,28 +807,44 @@ const std::string &Name, DICompileUnit CompileUnit, unsigned LineNo, DIType Type) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(Tag), - Context.getNode(), - MDString::get(VMContext, Name), - CompileUnit.getNode(), + getCastToEmpty(Context), + GetStringConstant(Name), + getCastToEmpty(CompileUnit), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), - Type.getNode(), + getCastToEmpty(Type) }; - return DIVariable(MDNode::get(VMContext, &Elts[0], 6)); + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.variable.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.variable"); + GV->setSection("llvm.metadata"); + return DIVariable(GV); } /// CreateBlock - This creates a descriptor for a lexical block with the /// specified parent VMContext. DIBlock DIFactory::CreateBlock(DIDescriptor Context) { - Value *Elts[] = { + Constant *Elts[] = { GetTagConstant(dwarf::DW_TAG_lexical_block), - Context.getNode() + getCastToEmpty(Context) }; - - return DIBlock(MDNode::get(VMContext, &Elts[0], 2)); + + Constant *Init = ConstantStruct::get(VMContext, Elts, + sizeof(Elts)/sizeof(Elts[0])); + + M.addTypeName("llvm.dbg.block.type", Init->getType()); + GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, + GlobalValue::InternalLinkage, + Init, "llvm.dbg.block"); + GV->setSection("llvm.metadata"); + return DIBlock(GV); } @@ -731,7 +866,7 @@ Value *Args[] = { ConstantInt::get(llvm::Type::getInt32Ty(VMContext), LineNo), ConstantInt::get(llvm::Type::getInt32Ty(VMContext), ColNo), - CU.getNode() + getCastToEmpty(CU) }; CallInst::Create(StopPointFn, Args, Args+3, "", BB); } @@ -744,7 +879,7 @@ FuncStartFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_func_start); // Call llvm.dbg.func.start which also implicitly sets a stoppoint. - CallInst::Create(FuncStartFn, SP.getNode(), "", BB); + CallInst::Create(FuncStartFn, getCastToEmpty(SP), "", BB); } /// InsertRegionStart - Insert a new llvm.dbg.region.start intrinsic call to @@ -755,7 +890,7 @@ RegionStartFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_region_start); // Call llvm.dbg.func.start. - CallInst::Create(RegionStartFn, D.getNode(), "", BB); + CallInst::Create(RegionStartFn, getCastToEmpty(D), "", BB); } /// InsertRegionEnd - Insert a new llvm.dbg.region.end intrinsic call to @@ -766,7 +901,7 @@ RegionEndFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_region_end); // Call llvm.dbg.region.end. - CallInst::Create(RegionEndFn, D.getNode(), "", BB); + CallInst::Create(RegionEndFn, getCastToEmpty(D), "", BB); } /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. @@ -777,19 +912,17 @@ if (!DeclareFn) DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); - Value *Args[] = { Storage, D.getNode() }; + Value *Args[] = { Storage, getCastToEmpty(D) }; CallInst::Create(DeclareFn, Args, Args+2, "", BB); } - //===----------------------------------------------------------------------===// // DebugInfoFinder implementations. //===----------------------------------------------------------------------===// /// processModule - Process entire module and collect debug info. void DebugInfoFinder::processModule(Module &M) { - - + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI) for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE; @@ -805,13 +938,15 @@ else if (DbgDeclareInst *DDI = dyn_cast(BI)) processDeclare(DDI); } - - NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv"); - if (!NMD) - return; - - for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { - DIGlobalVariable DIG(cast(NMD->getElement(i))); + + for (Module::global_iterator GVI = M.global_begin(), GVE = M.global_end(); + GVI != GVE; ++GVI) { + GlobalVariable *GV = GVI; + if (!GV->hasName() || !GV->isConstant() + || strncmp(GV->getName().data(), "llvm.dbg.global_variable", 24) + || !GV->hasInitializer()) + continue; + DIGlobalVariable DIG(GV); if (addGlobalVariable(DIG)) { addCompileUnit(DIG.getCompileUnit()); processType(DIG.getType()); @@ -826,20 +961,20 @@ addCompileUnit(DT.getCompileUnit()); if (DT.isCompositeType(DT.getTag())) { - DICompositeType DCT(DT.getNode()); + DICompositeType DCT(DT.getGV()); processType(DCT.getTypeDerivedFrom()); DIArray DA = DCT.getTypeArray(); if (!DA.isNull()) for (unsigned i = 0, e = DA.getNumElements(); i != e; ++i) { DIDescriptor D = DA.getElement(i); - DIType TypeE = DIType(D.getNode()); + DIType TypeE = DIType(D.getGV()); if (!TypeE.isNull()) processType(TypeE); else - processSubprogram(DISubprogram(D.getNode())); + processSubprogram(DISubprogram(D.getGV())); } } else if (DT.isDerivedType(DT.getTag())) { - DIDerivedType DDT(DT.getNode()); + DIDerivedType DDT(DT.getGV()); if (!DDT.isNull()) processType(DDT.getTypeDerivedFrom()); } @@ -857,35 +992,35 @@ /// processStopPoint - Process DbgStopPointInst. void DebugInfoFinder::processStopPoint(DbgStopPointInst *SPI) { - MDNode *Context = dyn_cast(SPI->getContext()); + GlobalVariable *Context = dyn_cast(SPI->getContext()); addCompileUnit(DICompileUnit(Context)); } /// processFuncStart - Process DbgFuncStartInst. void DebugInfoFinder::processFuncStart(DbgFuncStartInst *FSI) { - MDNode *SP = dyn_cast(FSI->getSubprogram()); + GlobalVariable *SP = dyn_cast(FSI->getSubprogram()); processSubprogram(DISubprogram(SP)); } /// processRegionStart - Process DbgRegionStart. void DebugInfoFinder::processRegionStart(DbgRegionStartInst *DRS) { - MDNode *SP = dyn_cast(DRS->getContext()); + GlobalVariable *SP = dyn_cast(DRS->getContext()); processSubprogram(DISubprogram(SP)); } /// processRegionEnd - Process DbgRegionEnd. void DebugInfoFinder::processRegionEnd(DbgRegionEndInst *DRE) { - MDNode *SP = dyn_cast(DRE->getContext()); + GlobalVariable *SP = dyn_cast(DRE->getContext()); processSubprogram(DISubprogram(SP)); } /// processDeclare - Process DbgDeclareInst. void DebugInfoFinder::processDeclare(DbgDeclareInst *DDI) { - DIVariable DV(cast(DDI->getVariable())); + DIVariable DV(cast(DDI->getVariable())); if (DV.isNull()) return; - if (!NodesSeen.insert(DV.getNode())) + if (!NodesSeen.insert(DV.getGV())) return; addCompileUnit(DV.getCompileUnit()); @@ -897,10 +1032,10 @@ if (DT.isNull()) return false; - if (!NodesSeen.insert(DT.getNode())) + if (!NodesSeen.insert(DT.getGV())) return false; - TYs.push_back(DT.getNode()); + TYs.push_back(DT.getGV()); return true; } @@ -909,10 +1044,10 @@ if (CU.isNull()) return false; - if (!NodesSeen.insert(CU.getNode())) + if (!NodesSeen.insert(CU.getGV())) return false; - CUs.push_back(CU.getNode()); + CUs.push_back(CU.getGV()); return true; } @@ -921,10 +1056,10 @@ if (DIG.isNull()) return false; - if (!NodesSeen.insert(DIG.getNode())) + if (!NodesSeen.insert(DIG.getGV())) return false; - GVs.push_back(DIG.getNode()); + GVs.push_back(DIG.getGV()); return true; } @@ -933,10 +1068,10 @@ if (SP.isNull()) return false; - if (!NodesSeen.insert(SP.getNode())) + if (!NodesSeen.insert(SP.getGV())) return false; - SPs.push_back(SP.getNode()); + SPs.push_back(SP.getGV()); return true; } @@ -989,17 +1124,31 @@ Value *findDbgGlobalDeclare(GlobalVariable *V) { const Module *M = V->getParent(); - NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.gv"); - if (!NMD) - return 0; - for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { - DIGlobalVariable DIG(cast_or_null(NMD->getElement(i))); - if (DIG.isNull()) - continue; - if (DIG.getGlobal() == V) - return DIG.getNode(); + const Type *Ty = M->getTypeByName("llvm.dbg.global_variable.type"); + if (!Ty) return 0; + + Ty = PointerType::get(Ty, 0); + + Value *Val = V->stripPointerCasts(); + for (Value::use_iterator I = Val->use_begin(), E = Val->use_end(); + I != E; ++I) { + if (ConstantExpr *CE = dyn_cast(I)) { + if (CE->getOpcode() == Instruction::BitCast) { + Value *VV = CE; + + while (VV->hasOneUse()) + VV = *VV->use_begin(); + + if (VV->getType() == Ty) + return VV; + } + } } + + if (Val->getType() == Ty) + return Val; + return 0; } @@ -1036,7 +1185,7 @@ if (GlobalVariable *GV = dyn_cast(const_cast(V))) { Value *DIGV = findDbgGlobalDeclare(GV); if (!DIGV) return false; - DIGlobalVariable Var(cast(DIGV)); + DIGlobalVariable Var(cast(DIGV)); Var.getDisplayName(DisplayName); LineNo = Var.getLineNumber(); @@ -1045,7 +1194,7 @@ } else { const DbgDeclareInst *DDI = findDbgDeclare(V); if (!DDI) return false; - DIVariable Var(cast(DDI->getVariable())); + DIVariable Var(cast(DDI->getVariable())); Var.getName(DisplayName); LineNo = Var.getLineNumber(); @@ -1103,7 +1252,7 @@ Value *Context = SPI.getContext(); // If this location is already tracked then use it. - DebugLocTuple Tuple(cast(Context), SPI.getLine(), + DebugLocTuple Tuple(cast(Context), SPI.getLine(), SPI.getColumn()); DenseMap::iterator II = DebugLocInfo.DebugIdMap.find(Tuple); @@ -1125,12 +1274,12 @@ DebugLoc DL; Value *SP = FSI.getSubprogram(); - DISubprogram Subprogram(cast(SP)); + DISubprogram Subprogram(cast(SP)); unsigned Line = Subprogram.getLineNumber(); DICompileUnit CU(Subprogram.getCompileUnit()); // If this location is already tracked then use it. - DebugLocTuple Tuple(CU.getNode(), Line, /* Column */ 0); + DebugLocTuple Tuple(CU.getGV(), Line, /* Column */ 0); DenseMap::iterator II = DebugLocInfo.DebugIdMap.find(Tuple); if (II != DebugLocInfo.DebugIdMap.end()) @@ -1146,7 +1295,7 @@ /// isInlinedFnStart - Return true if FSI is starting an inlined function. bool isInlinedFnStart(DbgFuncStartInst &FSI, const Function *CurrentFn) { - DISubprogram Subprogram(cast(FSI.getSubprogram())); + DISubprogram Subprogram(cast(FSI.getSubprogram())); if (Subprogram.describes(CurrentFn)) return false; @@ -1155,10 +1304,11 @@ /// isInlinedFnEnd - Return true if REI is ending an inlined function. bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function *CurrentFn) { - DISubprogram Subprogram(cast(REI.getContext())); + DISubprogram Subprogram(cast(REI.getContext())); if (Subprogram.isNull() || Subprogram.describes(CurrentFn)) return false; return true; } + } Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Aug 26 00:01:18 2009 @@ -98,8 +98,6 @@ for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ) UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove - // Check debug info intrinsics. - CheckDebugInfoIntrinsics(M); return false; } Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed Aug 26 00:01:18 2009 @@ -16,7 +16,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/InlineAsm.h" -#include "llvm/IntrinsicInst.h" +#include "llvm/Instructions.h" #include "llvm/LLVMContext.h" #include "llvm/Metadata.h" #include "llvm/Module.h" @@ -2192,10 +2192,7 @@ } } std::vector >().swap(UpgradedIntrinsics); - - // Check debug info intrinsics. - CheckDebugInfoIntrinsics(TheModule); - + return TheModule; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Aug 26 00:01:18 2009 @@ -1739,10 +1739,11 @@ // Print source line info. O.PadToColumn(MAI->getCommentColumn()); O << MAI->getCommentString() << " SrcLine "; - if (DLT.CompileUnit) { - std::string Str; - DICompileUnit CU(DLT.CompileUnit); - O << CU.getFilename(Str) << " "; + if (DLT.CompileUnit->hasInitializer()) { + Constant *Name = DLT.CompileUnit->getInitializer(); + if (ConstantArray *NameString = dyn_cast(Name)) + if (NameString->isString()) + O << NameString->getAsString() << " "; } O << DLT.Line; if (DLT.Col != 0) @@ -1760,10 +1761,11 @@ // Print source line info O.PadToColumn(MAI->getCommentColumn()); O << MAI->getCommentString() << " SrcLine "; - if (DLT.CompileUnit) { - std::string Str; - DICompileUnit CU(DLT.CompileUnit); - O << CU.getFilename(Str) << " "; + if (DLT.CompileUnit->hasInitializer()) { + Constant *Name = DLT.CompileUnit->getInitializer(); + if (ConstantArray *NameString = dyn_cast(Name)) + if (NameString->isString()) + O << NameString->getAsString() << " "; } O << DLT.Line; if (DLT.Col != 0) Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Aug 26 00:01:18 2009 @@ -10,7 +10,7 @@ // This file contains support for writing dwarf debug info into asm files. // //===----------------------------------------------------------------------===// -#define DEBUG_TYPE "dwarfdebug" + #include "DwarfDebug.h" #include "llvm/Module.h" #include "llvm/CodeGen/MachineFunction.h" @@ -24,7 +24,6 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Timer.h" -#include "llvm/Support/Debug.h" #include "llvm/System/Path.h" using namespace llvm; @@ -57,13 +56,11 @@ /// GVToDieMap - Tracks the mapping of unit level debug informaton /// variables to debug information entries. - /// FIXME : Rename GVToDieMap -> NodeToDieMap - std::map GVToDieMap; + std::map GVToDieMap; /// GVToDIEEntryMap - Tracks the mapping of unit level debug informaton /// descriptors to debug information entries using a DIEEntry proxy. - /// FIXME : Rename - std::map GVToDIEEntryMap; + std::map GVToDIEEntryMap; /// Globals - A map of globally visible named entities for this unit. /// @@ -92,12 +89,12 @@ /// getDieMapSlotFor - Returns the debug information entry map slot for the /// specified debug variable. - DIE *&getDieMapSlotFor(MDNode *N) { return GVToDieMap[N]; } + DIE *&getDieMapSlotFor(GlobalVariable *GV) { return GVToDieMap[GV]; } /// getDIEEntrySlotFor - Returns the debug information entry proxy slot for /// the specified debug variable. - DIEEntry *&getDIEEntrySlotFor(MDNode *N) { - return GVToDIEEntryMap[N]; + DIEEntry *&getDIEEntrySlotFor(GlobalVariable *GV) { + return GVToDIEEntryMap[GV]; } /// AddDie - Adds or interns the DIE to the compile unit. @@ -242,7 +239,7 @@ for (unsigned j = 0, M = Values.size(); j < M; ++j) delete Values[j]; - for (DenseMap::iterator + for (DenseMap::iterator I = AbstractInstanceRootMap.begin(), E = AbstractInstanceRootMap.end(); I != E;++I) delete I->second; @@ -534,7 +531,7 @@ return; // Check for pre-existence. - DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getNode()); + DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getGV()); // If it exists then use the existing value. if (Slot) { @@ -548,20 +545,19 @@ // Construct type. DIE Buffer(dwarf::DW_TAG_base_type); if (Ty.isBasicType(Ty.getTag())) - ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getNode())); - else if (Ty.isCompositeType(Ty.getTag())) - ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getNode())); + ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getGV())); + else if (Ty.isDerivedType(Ty.getTag())) + ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getGV())); else { - assert(Ty.isDerivedType(Ty.getTag()) && "Unknown kind of DIType"); - ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getNode())); - + assert(Ty.isCompositeType(Ty.getTag()) && "Unknown kind of DIType"); + ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV())); } // Add debug information entry to entity and appropriate context. DIE *Die = NULL; DIDescriptor Context = Ty.getContext(); if (!Context.isNull()) - Die = DW_Unit->getDieMapSlotFor(Context.getNode()); + Die = DW_Unit->getDieMapSlotFor(Context.getGV()); if (Die) { DIE *Child = new DIE(Buffer); @@ -646,7 +642,7 @@ // Add enumerators to enumeration type. for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIE *ElemDie = NULL; - DIEnumerator Enum(Elements.getElement(i).getNode()); + DIEnumerator Enum(Elements.getElement(i).getGV()); ElemDie = ConstructEnumTypeDIE(DW_Unit, &Enum); Buffer.AddChild(ElemDie); } @@ -656,7 +652,7 @@ // Add return type. DIArray Elements = CTy.getTypeArray(); DIDescriptor RTy = Elements.getElement(0); - AddType(DW_Unit, &Buffer, DIType(RTy.getNode())); + AddType(DW_Unit, &Buffer, DIType(RTy.getGV())); // Add prototype flag. AddUInt(&Buffer, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag, 1); @@ -665,7 +661,7 @@ for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter); DIDescriptor Ty = Elements.getElement(i); - AddType(DW_Unit, Arg, DIType(Ty.getNode())); + AddType(DW_Unit, Arg, DIType(Ty.getGV())); Buffer.AddChild(Arg); } } @@ -683,15 +679,13 @@ // Add elements to structure type. for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); - if (Element.isNull()) - continue; DIE *ElemDie = NULL; if (Element.getTag() == dwarf::DW_TAG_subprogram) ElemDie = CreateSubprogramDIE(DW_Unit, - DISubprogram(Element.getNode())); + DISubprogram(Element.getGV())); else ElemDie = CreateMemberDIE(DW_Unit, - DIDerivedType(Element.getNode())); + DIDerivedType(Element.getGV())); Buffer.AddChild(ElemDie); } @@ -768,7 +762,7 @@ for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); if (Element.getTag() == dwarf::DW_TAG_subrange_type) - ConstructSubrangeDIE(Buffer, DISubrange(Element.getNode()), IndexTy); + ConstructSubrangeDIE(Buffer, DISubrange(Element.getGV()), IndexTy); } } @@ -895,7 +889,7 @@ if (Args.isNull() || SPTag != dwarf::DW_TAG_subroutine_type) AddType(DW_Unit, SPDie, SPTy); else - AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getNode())); + AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV())); } if (!SP.isDefinition()) { @@ -906,7 +900,7 @@ if (SPTag == dwarf::DW_TAG_subroutine_type) for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter); - AddType(DW_Unit, Arg, DIType(Args.getElement(i).getNode())); + AddType(DW_Unit, Arg, DIType(Args.getElement(i).getGV())); AddUInt(Arg, dwarf::DW_AT_artificial, dwarf::DW_FORM_flag, 1); // ?? SPDie->AddChild(Arg); } @@ -916,7 +910,7 @@ AddUInt(SPDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1); // DW_TAG_inlined_subroutine may refer to this DIE. - DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getNode()); + DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getGV()); Slot = SPDie; return SPDie; } @@ -925,7 +919,7 @@ /// CompileUnit &DwarfDebug::FindCompileUnit(DICompileUnit Unit) const { DenseMap::const_iterator I = - CompileUnitMap.find(Unit.getNode()); + CompileUnitMap.find(Unit.getGV()); assert(I != CompileUnitMap.end() && "Missing compile unit."); return *I->second; } @@ -978,26 +972,26 @@ /// getOrCreateScope - Returns the scope associated with the given descriptor. /// -DbgScope *DwarfDebug::getOrCreateScope(MDNode *N) { - DbgScope *&Slot = DbgScopeMap[N]; +DbgScope *DwarfDebug::getOrCreateScope(GlobalVariable *V) { + DbgScope *&Slot = DbgScopeMap[V]; if (Slot) return Slot; DbgScope *Parent = NULL; - DIBlock Block(N); + DIBlock Block(V); // Don't create a new scope if we already created one for an inlined function. - DenseMap::iterator - II = AbstractInstanceRootMap.find(N); + DenseMap::iterator + II = AbstractInstanceRootMap.find(V); if (II != AbstractInstanceRootMap.end()) return LexicalScopeStack.back(); if (!Block.isNull()) { DIDescriptor ParentDesc = Block.getContext(); Parent = - ParentDesc.isNull() ? NULL : getOrCreateScope(ParentDesc.getNode()); + ParentDesc.isNull() ? NULL : getOrCreateScope(ParentDesc.getGV()); } - Slot = new DbgScope(Parent, DIDescriptor(N)); + Slot = new DbgScope(Parent, DIDescriptor(V)); if (Parent) Parent->AddScope(Slot); @@ -1106,10 +1100,10 @@ return; // Get the subprogram debug information entry. - DISubprogram SPD(Desc.getNode()); + DISubprogram SPD(Desc.getGV()); // Get the subprogram die. - DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getNode()); + DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getGV()); assert(SPDie && "Missing subprogram descriptor"); if (!AbstractScope) { @@ -1182,8 +1176,8 @@ return SrcId; } -void DwarfDebug::ConstructCompileUnit(MDNode *N) { - DICompileUnit DIUnit(N); +void DwarfDebug::ConstructCompileUnit(GlobalVariable *GV) { + DICompileUnit DIUnit(GV); std::string Dir, FN, Prod; unsigned ID = GetOrCreateSourceID(DIUnit.getDirectory(Dir), DIUnit.getFilename(FN)); @@ -1220,15 +1214,15 @@ ModuleCU = Unit; } - CompileUnitMap[DIUnit.getNode()] = Unit; + CompileUnitMap[DIUnit.getGV()] = Unit; CompileUnits.push_back(Unit); } -void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) { - DIGlobalVariable DI_GV(N); +void DwarfDebug::ConstructGlobalVariableDIE(GlobalVariable *GV) { + DIGlobalVariable DI_GV(GV); // Check for pre-existence. - DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getNode()); + DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getGV()); if (Slot) return; @@ -1254,11 +1248,11 @@ return; } -void DwarfDebug::ConstructSubprogram(MDNode *N) { - DISubprogram SP(N); +void DwarfDebug::ConstructSubprogram(GlobalVariable *GV) { + DISubprogram SP(GV); // Check for pre-existence. - DIE *&Slot = ModuleCU->getDieMapSlotFor(N); + DIE *&Slot = ModuleCU->getDieMapSlotFor(GV); if (Slot) return; @@ -1541,9 +1535,6 @@ /// correspondence to the source line list. unsigned DwarfDebug::RecordSourceLine(unsigned Line, unsigned Col, DICompileUnit CU) { - if (!MMI) - return 0; - if (TimePassesIsEnabled) DebugTimer->startTimer(); @@ -1578,11 +1569,11 @@ } /// RecordRegionStart - Indicate the start of a region. -unsigned DwarfDebug::RecordRegionStart(MDNode *N) { +unsigned DwarfDebug::RecordRegionStart(GlobalVariable *V) { if (TimePassesIsEnabled) DebugTimer->startTimer(); - DbgScope *Scope = getOrCreateScope(N); + DbgScope *Scope = getOrCreateScope(V); unsigned ID = MMI->NextLabelID(); if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); LexicalScopeStack.push_back(Scope); @@ -1594,11 +1585,11 @@ } /// RecordRegionEnd - Indicate the end of a region. -unsigned DwarfDebug::RecordRegionEnd(MDNode *N) { +unsigned DwarfDebug::RecordRegionEnd(GlobalVariable *V) { if (TimePassesIsEnabled) DebugTimer->startTimer(); - DbgScope *Scope = getOrCreateScope(N); + DbgScope *Scope = getOrCreateScope(V); unsigned ID = MMI->NextLabelID(); Scope->setEndLabelID(ID); // FIXME : region.end() may not be in the last basic block. @@ -1615,36 +1606,41 @@ } /// RecordVariable - Indicate the declaration of a local variable. -void DwarfDebug::RecordVariable(MDNode *N, unsigned FrameIndex) { +void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { if (TimePassesIsEnabled) DebugTimer->startTimer(); - DIDescriptor Desc(N); + DIDescriptor Desc(GV); DbgScope *Scope = NULL; bool InlinedFnVar = false; - if (Desc.getTag() == dwarf::DW_TAG_variable) - Scope = getOrCreateScope(DIGlobalVariable(N).getContext().getNode()); - else { + if (Desc.getTag() == dwarf::DW_TAG_variable) { + // GV is a global variable. + DIGlobalVariable DG(GV); + Scope = getOrCreateScope(DG.getContext().getGV()); + } else { bool InlinedVar = false; - MDNode *Context = DIVariable(N).getContext().getNode(); - DISubprogram SP(Context); + DIVariable DV(GV); + GlobalVariable *V = DV.getContext().getGV(); + DISubprogram SP(V); if (!SP.isNull()) { // SP is inserted into DbgAbstractScopeMap when inlined function // start was recorded by RecordInlineFnStart. - DenseMap::iterator - I = DbgAbstractScopeMap.find(SP.getNode()); + DenseMap::iterator + I = DbgAbstractScopeMap.find(SP.getGV()); if (I != DbgAbstractScopeMap.end()) { InlinedVar = true; Scope = I->second; } } - if (!InlinedVar) - Scope = getOrCreateScope(Context); + if (!InlinedVar) { + // GV is a local variable. + Scope = getOrCreateScope(V); + } } assert(Scope && "Unable to find the variable's scope"); - DbgVariable *DV = new DbgVariable(DIVariable(N), FrameIndex, InlinedFnVar); + DbgVariable *DV = new DbgVariable(DIVariable(GV), FrameIndex, InlinedFnVar); Scope->AddVariable(DV); if (TimePassesIsEnabled) @@ -1662,17 +1658,17 @@ if (TimePassesIsEnabled) DebugTimer->startTimer(); - MDNode *Node = SP.getNode(); - DenseMap::iterator - II = AbstractInstanceRootMap.find(Node); + GlobalVariable *GV = SP.getGV(); + DenseMap::iterator + II = AbstractInstanceRootMap.find(GV); if (II == AbstractInstanceRootMap.end()) { // Create an abstract instance entry for this inlined function if it doesn't // already exist. - DbgScope *Scope = new DbgScope(NULL, DIDescriptor(Node)); + DbgScope *Scope = new DbgScope(NULL, DIDescriptor(GV)); // Get the compile unit context. - DIE *SPDie = ModuleCU->getDieMapSlotFor(Node); + DIE *SPDie = ModuleCU->getDieMapSlotFor(GV); if (!SPDie) SPDie = CreateSubprogramDIE(ModuleCU, SP, false, true); @@ -1684,18 +1680,18 @@ AddUInt(SPDie, dwarf::DW_AT_inline, 0, dwarf::DW_INL_declared_not_inlined); // Keep track of the abstract scope for this function. - DbgAbstractScopeMap[Node] = Scope; + DbgAbstractScopeMap[GV] = Scope; - AbstractInstanceRootMap[Node] = Scope; + AbstractInstanceRootMap[GV] = Scope; AbstractInstanceRootList.push_back(Scope); } // Create a concrete inlined instance for this inlined function. - DbgConcreteScope *ConcreteScope = new DbgConcreteScope(DIDescriptor(Node)); + DbgConcreteScope *ConcreteScope = new DbgConcreteScope(DIDescriptor(GV)); DIE *ScopeDie = new DIE(dwarf::DW_TAG_inlined_subroutine); ScopeDie->setAbstractCompileUnit(ModuleCU); - DIE *Origin = ModuleCU->getDieMapSlotFor(Node); + DIE *Origin = ModuleCU->getDieMapSlotFor(GV); AddDIEEntry(ScopeDie, dwarf::DW_AT_abstract_origin, dwarf::DW_FORM_ref4, Origin); AddUInt(ScopeDie, dwarf::DW_AT_call_file, 0, ModuleCU->getID()); @@ -1709,20 +1705,20 @@ LexicalScopeStack.back()->AddConcreteInst(ConcreteScope); // Keep track of the concrete scope that's inlined into this function. - DenseMap >::iterator - SI = DbgConcreteScopeMap.find(Node); + DenseMap >::iterator + SI = DbgConcreteScopeMap.find(GV); if (SI == DbgConcreteScopeMap.end()) - DbgConcreteScopeMap[Node].push_back(ConcreteScope); + DbgConcreteScopeMap[GV].push_back(ConcreteScope); else SI->second.push_back(ConcreteScope); // Track the start label for this inlined function. - DenseMap >::iterator - I = InlineInfo.find(Node); + DenseMap >::iterator + I = InlineInfo.find(GV); if (I == InlineInfo.end()) - InlineInfo[Node].push_back(LabelID); + InlineInfo[GV].push_back(LabelID); else I->second.push_back(LabelID); @@ -1740,9 +1736,9 @@ if (TimePassesIsEnabled) DebugTimer->startTimer(); - MDNode *Node = SP.getNode(); - DenseMap >::iterator - I = DbgConcreteScopeMap.find(Node); + GlobalVariable *GV = SP.getGV(); + DenseMap >::iterator + I = DbgConcreteScopeMap.find(GV); if (I == DbgConcreteScopeMap.end()) { // FIXME: Can this situation actually happen? And if so, should it? @@ -2447,11 +2443,11 @@ Asm->EmitInt16(dwarf::DWARF_VERSION); Asm->EOL("Dwarf Version"); Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Address Size (in bytes)"); - for (DenseMap >::iterator + for (DenseMap >::iterator I = InlineInfo.begin(), E = InlineInfo.end(); I != E; ++I) { - MDNode *Node = I->first; + GlobalVariable *GV = I->first; SmallVector &Labels = I->second; - DISubprogram SP(Node); + DISubprogram SP(GV); std::string Name; std::string LName; @@ -2477,7 +2473,7 @@ for (SmallVector::iterator LI = Labels.begin(), LE = Labels.end(); LI != LE; ++LI) { - DIE *SP = ModuleCU->getDieMapSlotFor(Node); + DIE *SP = ModuleCU->getDieMapSlotFor(GV); Asm->EmitInt32(SP->getOffset()); Asm->EOL("DIE offset"); if (TD->getPointerSize() == sizeof(int32_t)) Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed Aug 26 00:01:18 2009 @@ -139,25 +139,25 @@ DbgScope *FunctionDbgScope; /// DbgScopeMap - Tracks the scopes in the current function. - DenseMap DbgScopeMap; + DenseMap DbgScopeMap; /// DbgAbstractScopeMap - Tracks abstract instance scopes in the current /// function. - DenseMap DbgAbstractScopeMap; + DenseMap DbgAbstractScopeMap; /// DbgConcreteScopeMap - Tracks concrete instance scopes in the current /// function. - DenseMap > DbgConcreteScopeMap; /// InlineInfo - Keep track of inlined functions and their location. This /// information is used to populate debug_inlined section. - DenseMap > InlineInfo; + DenseMap > InlineInfo; /// AbstractInstanceRootMap - Map of abstract instance roots of inlined /// functions. These are subroutine entries that contain a DW_AT_inline /// attribute. - DenseMap AbstractInstanceRootMap; + DenseMap AbstractInstanceRootMap; /// AbstractInstanceRootList - List of abstract instance roots of inlined /// functions. These are subroutine entries that contain a DW_AT_inline @@ -335,7 +335,7 @@ /// getOrCreateScope - Returns the scope associated with the given descriptor. /// - DbgScope *getOrCreateScope(MDNode *N); + DbgScope *getOrCreateScope(GlobalVariable *V); /// ConstructDbgScope - Construct the components of a scope. /// @@ -448,11 +448,11 @@ unsigned GetOrCreateSourceID(const std::string &DirName, const std::string &FileName); - void ConstructCompileUnit(MDNode *N); + void ConstructCompileUnit(GlobalVariable *GV); - void ConstructGlobalVariableDIE(MDNode *N); + void ConstructGlobalVariableDIE(GlobalVariable *GV); - void ConstructSubprogram(MDNode *N); + void ConstructSubprogram(GlobalVariable *GV); public: //===--------------------------------------------------------------------===// @@ -506,13 +506,13 @@ const std::string &FileName); /// RecordRegionStart - Indicate the start of a region. - unsigned RecordRegionStart(MDNode *N); + unsigned RecordRegionStart(GlobalVariable *V); /// RecordRegionEnd - Indicate the end of a region. - unsigned RecordRegionEnd(MDNode *N); + unsigned RecordRegionEnd(GlobalVariable *V); /// RecordVariable - Indicate the declaration of a local variable. - void RecordVariable(MDNode *N, unsigned FrameIndex); + void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); //// RecordInlinedFnStart - Indicate the start of inlined subroutine. unsigned RecordInlinedFnStart(DISubprogram &SP, DICompileUnit CU, Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Wed Aug 26 00:01:18 2009 @@ -80,13 +80,13 @@ } /// RecordRegionStart - Indicate the start of a region. -unsigned DwarfWriter::RecordRegionStart(MDNode *N) { - return DD->RecordRegionStart(N); +unsigned DwarfWriter::RecordRegionStart(GlobalVariable *V) { + return DD->RecordRegionStart(V); } /// RecordRegionEnd - Indicate the end of a region. -unsigned DwarfWriter::RecordRegionEnd(MDNode *N) { - return DD->RecordRegionEnd(N); +unsigned DwarfWriter::RecordRegionEnd(GlobalVariable *V) { + return DD->RecordRegionEnd(V); } /// getRecordSourceLineCount - Count source lines. @@ -96,8 +96,8 @@ /// RecordVariable - Indicate the declaration of a local variable. /// -void DwarfWriter::RecordVariable(MDNode *N, unsigned FrameIndex) { - DD->RecordVariable(N, FrameIndex); +void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { + DD->RecordVariable(GV, FrameIndex); } /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should @@ -106,7 +106,8 @@ return DD && DD->ShouldEmitDwarfDebug(); } -//// RecordInlinedFnStart +//// RecordInlinedFnStart - Global variable GV is inlined at the location marked +//// by LabelID label. unsigned DwarfWriter::RecordInlinedFnStart(DISubprogram SP, DICompileUnit CU, unsigned Line, unsigned Col) { return DD->RecordInlinedFnStart(SP, CU, Line, Col); Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Wed Aug 26 00:01:18 2009 @@ -333,7 +333,7 @@ /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given /// source file, line, and column. If none currently exists, create a new /// DebugLocTuple, and insert it into the DebugIdMap. -unsigned MachineFunction::getOrCreateDebugLocID(MDNode *CompileUnit, +unsigned MachineFunction::getOrCreateDebugLocID(GlobalVariable *CompileUnit, unsigned Line, unsigned Col) { DebugLocTuple Tuple(CompileUnit, Line, Col); DenseMap::iterator II Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Aug 26 00:01:18 2009 @@ -335,7 +335,7 @@ if (isValidDebugInfoIntrinsic(*RSI, CodeGenOpt::None) && DW && DW->ShouldEmitDwarfDebug()) { unsigned ID = - DW->RecordRegionStart(RSI->getContext()); + DW->RecordRegionStart(cast(RSI->getContext())); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, DL, II).addImm(ID); } @@ -346,7 +346,7 @@ if (isValidDebugInfoIntrinsic(*REI, CodeGenOpt::None) && DW && DW->ShouldEmitDwarfDebug()) { unsigned ID = 0; - DISubprogram Subprogram(REI->getContext()); + DISubprogram Subprogram(cast(REI->getContext())); if (isInlinedFnEnd(*REI, MF.getFunction())) { // This is end of an inlined function. const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); @@ -359,7 +359,7 @@ BuildMI(MBB, DL, II).addImm(ID); } else { const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); - ID = DW->RecordRegionEnd(REI->getContext()); + ID = DW->RecordRegionEnd(cast(REI->getContext())); BuildMI(MBB, DL, II).addImm(ID); } } @@ -384,7 +384,7 @@ setCurDebugLoc(ExtractDebugLocation(*FSI, MF.getDebugLocInfo())); DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); - DISubprogram SP(FSI->getSubprogram()); + DISubprogram SP(cast(FSI->getSubprogram())); unsigned LabelID = DW->RecordInlinedFnStart(SP, DICompileUnit(PrevLocTpl.CompileUnit), PrevLocTpl.Line, @@ -398,7 +398,7 @@ MF.setDefaultDebugLoc(ExtractDebugLocation(*FSI, MF.getDebugLocInfo())); // llvm.dbg.func_start also defines beginning of function scope. - DW->RecordRegionStart(FSI->getSubprogram()); + DW->RecordRegionStart(cast(FSI->getSubprogram())); return true; } case Intrinsic::dbg_declare: { @@ -419,7 +419,10 @@ if (SI == StaticAllocaMap.end()) break; // VLAs. int FI = SI->second; - DW->RecordVariable(cast(Variable), FI); + // Determine the debug globalvariable. + GlobalValue *GV = cast(Variable); + + DW->RecordVariable(cast(GV), FI); return true; } case Intrinsic::eh_exception: { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Aug 26 00:01:18 2009 @@ -1593,9 +1593,9 @@ bool useLABEL = TLI.isOperationLegalOrCustom(ISD::DBG_LABEL, MVT::Other); const DbgStopPointSDNode *DSP = cast(Node); - MDNode *CU_Node = DSP->getCompileUnit(); - if (DW && (useDEBUG_LOC || useLABEL)) { - DICompileUnit CU(CU_Node); + GlobalVariable *CU_GV = cast(DSP->getCompileUnit()); + if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) { + DICompileUnit CU(cast(DSP->getCompileUnit())); unsigned Line = DSP->getLine(); unsigned Col = DSP->getColumn(); @@ -1607,7 +1607,7 @@ return DAG.getNode(ISD::DEBUG_LOC, dl, MVT::Other, Node->getOperand(0), DAG.getConstant(Line, MVT::i32), DAG.getConstant(Col, MVT::i32), - DAG.getSrcValue(CU.getNode())); + DAG.getSrcValue(CU.getGV())); } else { unsigned ID = DW->RecordSourceLine(Line, Col, CU); return DAG.getLabel(ISD::DBG_LABEL, dl, Node->getOperand(0), ID); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Aug 26 00:01:18 2009 @@ -1286,7 +1286,7 @@ SDValue SelectionDAG::getDbgStopPoint(DebugLoc DL, SDValue Root, unsigned Line, unsigned Col, - MDNode *CU) { + Value *CU) { SDNode *N = NodeAllocator.Allocate(); new (N) DbgStopPointSDNode(Root, Line, Col, CU); N->setDebugLoc(DL); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Wed Aug 26 00:01:18 2009 @@ -3876,7 +3876,7 @@ if (isValidDebugInfoIntrinsic(RSI, OptLevel) && DW && DW->ShouldEmitDwarfDebug()) { unsigned LabelID = - DW->RecordRegionStart(RSI.getContext()); + DW->RecordRegionStart(cast(RSI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), getRoot(), LabelID)); } @@ -3891,7 +3891,7 @@ return 0; MachineFunction &MF = DAG.getMachineFunction(); - DISubprogram Subprogram(REI.getContext()); + DISubprogram Subprogram(cast(REI.getContext())); if (isInlinedFnEnd(REI, MF.getFunction())) { // This is end of inlined function. Debugging information for inlined @@ -3910,7 +3910,7 @@ } unsigned LabelID = - DW->RecordRegionEnd(REI.getContext()); + DW->RecordRegionEnd(cast(REI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), getRoot(), LabelID)); return 0; @@ -3942,7 +3942,7 @@ if (!DW || !DW->ShouldEmitDwarfDebug()) return 0; DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); - DISubprogram SP(FSI.getSubprogram()); + DISubprogram SP(cast(FSI.getSubprogram())); DICompileUnit CU(PrevLocTpl.CompileUnit); unsigned LabelID = DW->RecordInlinedFnStart(SP, CU, PrevLocTpl.Line, @@ -3958,7 +3958,7 @@ if (!DW || !DW->ShouldEmitDwarfDebug()) return 0; // llvm.dbg.func_start also defines beginning of function scope. - DW->RecordRegionStart(FSI.getSubprogram()); + DW->RecordRegionStart(cast(FSI.getSubprogram())); return 0; } case Intrinsic::dbg_declare: { @@ -3981,7 +3981,7 @@ if (!AI) return 0; int FI = FuncInfo.StaticAllocaMap[AI]; - DW->RecordVariable(cast(Variable), FI); + DW->RecordVariable(cast(Variable), FI); return 0; } case Intrinsic::eh_exception: { Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp Wed Aug 26 00:01:18 2009 @@ -1,4 +1,3 @@ - //===-- PIC16DebugInfo.cpp - Implementation for PIC16 Debug Information ======// // // The LLVM Compiler Infrastructure @@ -70,7 +69,7 @@ // We also need to encode the the information about the base type of // pointer in TypeNo. - DIType BaseType = DIDerivedType(Ty.getNode()).getTypeDerivedFrom(); + DIType BaseType = DIDerivedType(Ty.getGV()).getTypeDerivedFrom(); PopulateDebugInfo(BaseType, TypeNo, HasAux, Aux, TagName); } @@ -79,7 +78,7 @@ bool &HasAux, int Aux[], std::string &TagName) { - DICompositeType CTy = DICompositeType(Ty.getNode()); + DICompositeType CTy = DICompositeType(Ty.getGV()); DIArray Elements = CTy.getTypeArray(); unsigned short size = 1; unsigned short Dimension[4]={0,0,0,0}; @@ -88,7 +87,7 @@ if (Element.getTag() == dwarf::DW_TAG_subrange_type) { TypeNo = TypeNo << PIC16Dbg::S_DERIVED; TypeNo = TypeNo | PIC16Dbg::DT_ARY; - DISubrange SubRange = DISubrange(Element.getNode()); + DISubrange SubRange = DISubrange(Element.getGV()); Dimension[i] = SubRange.getHi() - SubRange.getLo() + 1; // Each dimension is represented by 2 bytes starting at byte 9. Aux[8+i*2+0] = Dimension[i]; @@ -111,7 +110,7 @@ unsigned short &TypeNo, bool &HasAux, int Aux[], std::string &TagName) { - DICompositeType CTy = DICompositeType(Ty.getNode()); + DICompositeType CTy = DICompositeType(Ty.getGV()); TypeNo = TypeNo << PIC16Dbg::S_BASIC; if (Ty.getTag() == dwarf::DW_TAG_structure_type) TypeNo = TypeNo | PIC16Dbg::T_STRUCT; @@ -124,7 +123,7 @@ // llvm.dbg.composite* global variable. Since we need to revisit // PIC16DebugInfo implementation anyways after the MDNodes based // framework is done, let us continue with the way it is. - std::string UniqueSuffix = "." + Ty.getNode()->getNameStr().substr(18); + std::string UniqueSuffix = "." + Ty.getGV()->getNameStr().substr(18); TagName += UniqueSuffix; unsigned short size = CTy.getSizeInBits()/8; // 7th and 8th byte represent size. @@ -211,10 +210,11 @@ DbgFinder.processModule(M); if (DbgFinder.compile_unit_count() != 0) { // FIXME : What if more then one CUs are present in a module ? - MDNode *CU = *DbgFinder.compile_unit_begin(); + GlobalVariable *CU = *DbgFinder.compile_unit_begin(); EmitDebugDirectives = true; SwitchToCU(CU); } + // Emit debug info for decls of composite types. EmitCompositeTypeDecls(M); } @@ -259,7 +259,7 @@ if (! EmitDebugDirectives) return; assert (! DL.isUnknown() && "can't change to invalid debug loc"); - MDNode *CU = MF.getDebugLocTuple(DL).CompileUnit; + GlobalVariable *CU = MF.getDebugLocTuple(DL).CompileUnit; unsigned line = MF.getDebugLocTuple(DL).Line; SwitchToCU(CU); @@ -306,7 +306,8 @@ int ElementAux[PIC16Dbg::AuxSize] = { 0 }; std::string TagName = ""; std::string ElementName; - DIDerivedType DITy(Element.getNode()); + GlobalVariable *GV = Element.getGV(); + DIDerivedType DITy(GV); DITy.getName(ElementName); unsigned short ElementSize = DITy.getSizeInBits()/8; // Get mangleddd name for this structure/union element. @@ -342,7 +343,7 @@ CTy.getName(Name); // Get the number after llvm.dbg.composite and make UniqueSuffix from // it. - std::string DIVar = CTy.getNode()->getNameStr(); + std::string DIVar = CTy.getGV()->getNameStr(); std::string UniqueSuffix = "." + DIVar.substr(18); std::string MangledCTyName = Name + UniqueSuffix; unsigned short size = CTy.getSizeInBits()/8; @@ -440,7 +441,7 @@ void PIC16DbgInfo::EmitVarDebugInfo(Module &M) { DebugInfoFinder DbgFinder; DbgFinder.processModule(M); - + for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(), E = DbgFinder.global_variable_end(); I != E; ++I) { DIGlobalVariable DIGV(*I); @@ -465,7 +466,7 @@ /// SwitchToCU - Switch to a new compilation unit. /// -void PIC16DbgInfo::SwitchToCU(MDNode *CU) { +void PIC16DbgInfo::SwitchToCU(GlobalVariable *CU) { // Get the file path from CU. DICompileUnit cu(CU); std::string DirName, FileName; Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h Wed Aug 26 00:01:18 2009 @@ -117,7 +117,7 @@ private: - void SwitchToCU (MDNode *CU); + void SwitchToCU (GlobalVariable *CU); void SwitchToLine (unsigned Line, bool IsInBeginFunction = false); void PopulateDebugInfo (DIType Ty, unsigned short &TypeNo, bool &HasAux, Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Wed Aug 26 00:01:18 2009 @@ -203,56 +203,167 @@ // llvm.dbg.region.end calls, and any globals they point to if now dead. static bool StripDebugInfo(Module &M) { - // Remove all of the calls to the debugger intrinsics, and remove them from - // the module. + SmallPtrSet llvmUsedValues; + findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues); + findUsedValues(M.getGlobalVariable("llvm.compiler.used"), llvmUsedValues); + + DebugInfoFinder DbgFinder; + DbgFinder.processModule(M); + + // These anchors use LinkOnce linkage so that the optimizer does not + // remove them accidently. Set InternalLinkage for all these debug + // info anchors. + for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(), + E = DbgFinder.compile_unit_end(); I != E; ++I) + (*I)->setLinkage(GlobalValue::InternalLinkage); + for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(), + E = DbgFinder.global_variable_end(); I != E; ++I) + (*I)->setLinkage(GlobalValue::InternalLinkage); + for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(), + E = DbgFinder.subprogram_end(); I != E; ++I) + (*I)->setLinkage(GlobalValue::InternalLinkage); + + + // Delete all dbg variables. + for (Module::global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) { + GlobalVariable *GV = dyn_cast(I); + if (!GV) continue; + if (!GV->use_empty() && llvmUsedValues.count(I) == 0) { + if (GV->getName().startswith("llvm.dbg")) { + GV->replaceAllUsesWith(UndefValue::get(GV->getType())); + } + } + } + Function *FuncStart = M.getFunction("llvm.dbg.func.start"); Function *StopPoint = M.getFunction("llvm.dbg.stoppoint"); Function *RegionStart = M.getFunction("llvm.dbg.region.start"); Function *RegionEnd = M.getFunction("llvm.dbg.region.end"); Function *Declare = M.getFunction("llvm.dbg.declare"); + std::vector DeadConstants; + + // Remove all of the calls to the debugger intrinsics, and remove them from + // the module. if (FuncStart) { while (!FuncStart->use_empty()) { CallInst *CI = cast(FuncStart->use_back()); + Value *Arg = CI->getOperand(1); + assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); + if (Arg->use_empty()) + if (Constant *C = dyn_cast(Arg)) + DeadConstants.push_back(C); } FuncStart->eraseFromParent(); } if (StopPoint) { while (!StopPoint->use_empty()) { CallInst *CI = cast(StopPoint->use_back()); + Value *Arg = CI->getOperand(3); + assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); + if (Arg->use_empty()) + if (Constant *C = dyn_cast(Arg)) + DeadConstants.push_back(C); } StopPoint->eraseFromParent(); } if (RegionStart) { while (!RegionStart->use_empty()) { CallInst *CI = cast(RegionStart->use_back()); + Value *Arg = CI->getOperand(1); + assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); + if (Arg->use_empty()) + if (Constant *C = dyn_cast(Arg)) + DeadConstants.push_back(C); } RegionStart->eraseFromParent(); } if (RegionEnd) { while (!RegionEnd->use_empty()) { CallInst *CI = cast(RegionEnd->use_back()); + Value *Arg = CI->getOperand(1); + assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); + if (Arg->use_empty()) + if (Constant *C = dyn_cast(Arg)) + DeadConstants.push_back(C); } RegionEnd->eraseFromParent(); } if (Declare) { while (!Declare->use_empty()) { CallInst *CI = cast(Declare->use_back()); + Value *Arg1 = CI->getOperand(1); + Value *Arg2 = CI->getOperand(2); + assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); + if (Arg1->use_empty()) { + if (Constant *C = dyn_cast(Arg1)) + DeadConstants.push_back(C); + else + RecursivelyDeleteTriviallyDeadInstructions(Arg1); + } + if (Arg2->use_empty()) + if (Constant *C = dyn_cast(Arg2)) + DeadConstants.push_back(C); } Declare->eraseFromParent(); } - NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv"); - if (NMD) - NMD->eraseFromParent(); + // llvm.dbg.compile_units and llvm.dbg.subprograms are marked as linkonce + // but since we are removing all debug information, make them internal now. + // FIXME: Use private linkage maybe? + if (Constant *C = M.getNamedGlobal("llvm.dbg.compile_units")) + if (GlobalVariable *GV = dyn_cast(C)) + GV->setLinkage(GlobalValue::InternalLinkage); + + if (Constant *C = M.getNamedGlobal("llvm.dbg.subprograms")) + if (GlobalVariable *GV = dyn_cast(C)) + GV->setLinkage(GlobalValue::InternalLinkage); + + if (Constant *C = M.getNamedGlobal("llvm.dbg.global_variables")) + if (GlobalVariable *GV = dyn_cast(C)) + GV->setLinkage(GlobalValue::InternalLinkage); + + // Delete all dbg variables. + for (Module::global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) { + GlobalVariable *GV = dyn_cast(I); + if (!GV) continue; + if (GV->use_empty() && llvmUsedValues.count(I) == 0 + && (!GV->hasSection() + || strcmp(GV->getSection().c_str(), "llvm.metadata") == 0)) + DeadConstants.push_back(GV); + } + + if (DeadConstants.empty()) + return false; + + // Delete any internal globals that were only used by the debugger intrinsics. + while (!DeadConstants.empty()) { + Constant *C = DeadConstants.back(); + DeadConstants.pop_back(); + if (GlobalVariable *GV = dyn_cast(C)) { + if (GV->hasLocalLinkage()) + RemoveDeadConstant(GV); + } + else + RemoveDeadConstant(C); + } - // Remove dead metadata. - M.getContext().RemoveDeadMetadata(); + // Remove all llvm.dbg types. + TypeSymbolTable &ST = M.getTypeSymbolTable(); + for (TypeSymbolTable::iterator TI = ST.begin(), TE = ST.end(); TI != TE; ) { + if (!strncmp(TI->first.c_str(), "llvm.dbg.", 9)) + ST.remove(TI++); + else + ++TI; + } + return true; } Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Wed Aug 26 00:01:18 2009 @@ -238,7 +238,7 @@ // Do not clone llvm.dbg.region.end. It will be adjusted by the inliner. if (const DbgFuncStartInst *DFSI = dyn_cast(II)) { if (DbgFnStart == NULL) { - DISubprogram SP(DFSI->getSubprogram()); + DISubprogram SP(cast(DFSI->getSubprogram())); if (SP.describes(BB->getParent())) DbgFnStart = DFSI->getSubprogram(); } Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Wed Aug 26 00:01:18 2009 @@ -207,17 +207,17 @@ /// to the llvm.dbg.func.start of the function F. Otherwise return NULL. static const DbgRegionEndInst *findFnRegionEndMarker(const Function *F) { - MDNode *FnStart = NULL; + GlobalVariable *FnStart = NULL; const DbgRegionEndInst *FnEnd = NULL; for (Function::const_iterator FI = F->begin(), FE =F->end(); FI != FE; ++FI) for (BasicBlock::const_iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) { if (FnStart == NULL) { if (const DbgFuncStartInst *FSI = dyn_cast(BI)) { - DISubprogram SP(FSI->getSubprogram()); + DISubprogram SP(cast(FSI->getSubprogram())); assert (SP.isNull() == false && "Invalid llvm.dbg.func.start"); if (SP.describes(F)) - FnStart = SP.getNode(); + FnStart = SP.getGV(); } } else { if (const DbgRegionEndInst *REI = dyn_cast(BI)) Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original) +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Wed Aug 26 00:01:18 2009 @@ -16,7 +16,8 @@ #include "llvm/Function.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/IntrinsicInst.h" +#include "llvm/Instructions.h" +#include "llvm/Intrinsics.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" #include @@ -433,74 +434,3 @@ } } } - -/// This function checks debug info intrinsics. If an intrinsic is invalid -/// then this function simply removes the intrinsic. -void llvm::CheckDebugInfoIntrinsics(Module *M) { - - - if (Function *FuncStart = M->getFunction("llvm.dbg.func.start")) { - if (!FuncStart->use_empty()) { - DbgFuncStartInst *DFSI = cast(FuncStart->use_back()); - if (!isa(DFSI->getOperand(1))) { - while (!FuncStart->use_empty()) { - CallInst *CI = cast(FuncStart->use_back()); - CI->eraseFromParent(); - } - FuncStart->eraseFromParent(); - } - } - } - - if (Function *StopPoint = M->getFunction("llvm.dbg.stoppoint")) { - if (!StopPoint->use_empty()) { - DbgStopPointInst *DSPI = cast(StopPoint->use_back()); - if (!isa(DSPI->getOperand(3))) { - while (!StopPoint->use_empty()) { - CallInst *CI = cast(StopPoint->use_back()); - CI->eraseFromParent(); - } - StopPoint->eraseFromParent(); - } - } - } - - if (Function *RegionStart = M->getFunction("llvm.dbg.region.start")) { - if (!RegionStart->use_empty()) { - DbgRegionStartInst *DRSI = cast(RegionStart->use_back()); - if (!isa(DRSI->getOperand(1))) { - while (!RegionStart->use_empty()) { - CallInst *CI = cast(RegionStart->use_back()); - CI->eraseFromParent(); - } - RegionStart->eraseFromParent(); - } - } - } - - if (Function *RegionEnd = M->getFunction("llvm.dbg.region.end")) { - if (!RegionEnd->use_empty()) { - DbgRegionEndInst *DREI = cast(RegionEnd->use_back()); - if (!isa(DREI->getOperand(1))) { - while (!RegionEnd->use_empty()) { - CallInst *CI = cast(RegionEnd->use_back()); - CI->eraseFromParent(); - } - RegionEnd->eraseFromParent(); - } - } - } - - if (Function *Declare = M->getFunction("llvm.dbg.declare")) { - if (!Declare->use_empty()) { - DbgDeclareInst *DDI = cast(Declare->use_back()); - if (!isa(DDI->getOperand(2))) { - while (!Declare->use_empty()) { - CallInst *CI = cast(Declare->use_back()); - CI->eraseFromParent(); - } - Declare->eraseFromParent(); - } - } - } -} Modified: llvm/trunk/lib/VMCore/Metadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Metadata.cpp (original) +++ llvm/trunk/lib/VMCore/Metadata.cpp Wed Aug 26 00:01:18 2009 @@ -82,7 +82,7 @@ V.reserve(NumVals); for (unsigned i = 0; i < NumVals; ++i) V.push_back(Vals[i]); - + return pImpl->MDNodes.getOrCreate(Type::getMetadataTy(Context), V); } Modified: llvm/trunk/lib/VMCore/ValueTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ValueTypes.cpp?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ValueTypes.cpp (original) +++ llvm/trunk/lib/VMCore/ValueTypes.cpp Wed Aug 26 00:01:18 2009 @@ -169,7 +169,6 @@ case MVT::v8f32: return VectorType::get(Type::getFloatTy(Context), 8); case MVT::v2f64: return VectorType::get(Type::getDoubleTy(Context), 2); case MVT::v4f64: return VectorType::get(Type::getDoubleTy(Context), 4); - case MVT::Metadata: return Type::getMetadataTy(Context); } } Modified: llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll?rev=80073&r1=80072&r2=80073&view=diff ============================================================================== --- llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll (original) +++ llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll Wed Aug 26 00:01:18 2009 @@ -1,3 +1,5 @@ +; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep region | count 2 +; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep func.start | count 2 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep "br label" %llvm.dbg.anchor.type = type { i32, i32 } From dpatel at apple.com Wed Aug 26 00:10:45 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 26 Aug 2009 05:10:45 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r80074 - in /llvm-gcc-4.2/trunk/gcc: llvm-debug.cpp llvm-debug.h Message-ID: <200908260510.n7Q5AjEL010589@zion.cs.uiuc.edu> Author: dpatel Date: Wed Aug 26 00:10:45 2009 New Revision: 80074 URL: http://llvm.org/viewvc/llvm-project?rev=80074&view=rev Log: Revert 79978 for now. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp llvm-gcc-4.2/trunk/gcc/llvm-debug.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=80074&r1=80073&r2=80074&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Wed Aug 26 00:10:45 2009 @@ -576,21 +576,13 @@ // recursive) and replace all uses of the forward declaration with the // final definition. expanded_location Loc = GetNodeLocation(TREE_CHAIN(type), false); - // FIXME: findRegion() is not able to find context all the time. This - // means when type names in different context match then FwdDecl is - // reused because MDNodes are uniqued. To avoid this, use type context - /// also while creating FwdDecl for now. - std::string FwdName; - if (TYPE_CONTEXT(type)) - FwdName = GetNodeName(TYPE_CONTEXT(type)); - FwdName = FwdName + GetNodeName(type); unsigned Flags = llvm::DIType::FlagFwdDecl; if (TYPE_BLOCK_IMPL_STRUCT(type)) Flags |= llvm::DIType::FlagClosure; llvm::DICompositeType FwdDecl = DebugFactory.CreateCompositeType(Tag, findRegion(type), - FwdName, + GetNodeName(type), getOrCreateCompileUnit(Loc.file), Loc.line, 0, 0, 0, Flags, @@ -877,7 +869,7 @@ bool isMain) { if (!FullPath) FullPath = main_input_filename; - MDNode *&CU = CUCache[FullPath]; + GlobalVariable *&CU = CUCache[FullPath]; if (CU) return DICompileUnit(CU); @@ -925,7 +917,7 @@ version_string, isMain, optimize, Flags, ObjcRunTimeVer); - CU = NewCU.getNode(); + CU = NewCU.getGV(); return NewCU; } Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.h?rev=80074&r1=80073&r2=80074&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.h Wed Aug 26 00:10:45 2009 @@ -59,7 +59,7 @@ const char *PrevFullPath; // Previous location file encountered. int PrevLineNo; // Previous location line# encountered. BasicBlock *PrevBB; // Last basic block encountered. - std::map CUCache; + std::map CUCache; std::map TypeCache; // Cache of previously constructed // Types. From venkatra at cs.wisc.edu Tue Aug 25 23:50:17 2009 From: venkatra at cs.wisc.edu (Venkatraman Govindaraju) Date: Wed, 26 Aug 2009 04:50:17 -0000 Subject: [llvm-commits] [llvm] r80070 - /llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Message-ID: <200908260450.n7Q4oH1X007872@zion.cs.uiuc.edu> Author: venkatra Date: Tue Aug 25 23:50:17 2009 New Revision: 80070 URL: http://llvm.org/viewvc/llvm-project?rev=80070&view=rev Log: test commit Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=80070&r1=80069&r2=80070&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Tue Aug 25 23:50:17 2009 @@ -117,7 +117,7 @@ def SPselecticc : SDNode<"SPISD::SELECT_ICC", SDTSPselectcc, [SDNPInFlag]>; def SPselectfcc : SDNode<"SPISD::SELECT_FCC", SDTSPselectcc, [SDNPInFlag]>; -// These are target-independent nodes, but have target-specific formats. +// These are target-independent nodes, but have target-specific formats. def SDT_SPCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32> ]>; def SDT_SPCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>; From nicholas at mxc.ca Wed Aug 26 00:54:12 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 25 Aug 2009 22:54:12 -0700 Subject: [llvm-commits] [llvm] r80038 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instruction.h include/llvm/Instructions.h include/llvm/Value.h lib/Transforms/IPO/MergeFunctions.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/Transforms/Utils/BasicBlockUtils.cpp lib/Transforms/Utils/SimplifyCFG.cpp lib/VMCore/Instruction.cpp lib/VMCore/Instructions.cpp In-Reply-To: <200908252211.n7PMBLsV020878@zion.cs.uiuc.edu> References: <200908252211.n7PMBLsV020878@zion.cs.uiuc.edu> Message-ID: <4A94CE04.7050102@mxc.ca> Dan Gohman wrote: > Author: djg > Date: Tue Aug 25 17:11:20 2009 > New Revision: 80038 > > URL: http://llvm.org/viewvc/llvm-project?rev=80038&view=rev > Log: > Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined, > and introduce a new Instruction::isIdenticalTo which tests for full > identity, including the SubclassOptionalData flags. Also, fix the > Instruction::clone implementations to preserve the SubclassOptionalData > flags. Finally, teach several optimizations how to handle > SubclassOptionalData correctly, given these changes. > > This fixes the counterintuitive behavior of isIdenticalTo not comparing > the full value, and clone not returning an identical clone, as well as > some subtle bugs that could be caused by these. Aha! Thanks for spotting that and coming up with such clean solution! > Modified: llvm/trunk/include/llvm/Instructions.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=80038&r1=80037&r2=80038&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/Instructions.h (original) > +++ llvm/trunk/include/llvm/Instructions.h Tue Aug 25 17:11:20 2009 > @@ -99,7 +99,6 @@ > /// MallocInst - an instruction to allocated memory on the heap > /// > class MallocInst : public AllocationInst { > - MallocInst(const MallocInst &MI); Why remove these? > UnreachableInst *UnreachableInst::clone(LLVMContext &C) const { > - return new UnreachableInst(C); > + UnreachableInst *New = new UnreachableInst(C); > + New->SubclassOptionalData = SubclassOptionalData; > + return New; > } Most of these (ie. unreachable, unwind, invoke, switch) don't have extra bits. Why make copies of SubclassOptionalData? They could add it later if they need it. Are we taking this into 2.6? Nick From evan.cheng at apple.com Wed Aug 26 01:56:34 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 25 Aug 2009 23:56:34 -0700 Subject: [llvm-commits] [llvm] r79377 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrFormats.td X86InstrSSE.td In-Reply-To: <6C39985E-F4CE-4BB6-8878-A21799A995B0@apple.com> References: <200908182250.n7IMoX26007247@zion.cs.uiuc.edu> <66AB710C-E746-45BB-90DB-7AA49A371B78@apple.com> <7AB29094-CDF9-484A-825B-7A5A747DDB10@apple.com> <6C39985E-F4CE-4BB6-8878-A21799A995B0@apple.com> Message-ID: On Aug 22, 2009, at 7:40 PM, Eric Christopher wrote: >> >> I still don't understand what the problem is here. Is the problem >> you're solving a type inference issue? > > Nope. > >> If so, you can fix it by doing something like: >> >> >> (set (v4i32 XMM0), ...) >> >> or better yet: >> >> (set XMM0, (v4i32 ... )) >> >> Is this the problem, or is there something else going on? We'd >> prefer to have as little custom c++ matching code as possible for >> obvious reasons :) > > Quite, I tried about 10 things before going with this on Evan's > suggestion. The other idea I had was a custom register class for > XMM0, but Evan wanted to keep the number of register classes small. > > Basically the problem comes when codegen wants to move the value to/ > from a register - since XMM0 can be of a number of different register > types it ends up believing that this is a register of type MVT::Other > and there's no knowledge in the backend on how to do this. > > I am open to other ideas, and thinking it was a problem on my end I'd > already tried the two above :) This will be fixed once we introduce scalar xmm registers (e.g. XMM0_F32) which are sub-registers of the 128-bit ones. That will eliminate the ambiguity. Evan > > -eric > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Wed Aug 26 01:47:22 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 25 Aug 2009 23:47:22 -0700 Subject: [llvm-commits] [llvm] r79977 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Support/ lib/Analysis/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/PIC16/ lib/Transforms/IPO/ lib/Transforms/Utils/ lib/VMCore/ test/DebugInfo/ test/FrontendC++/ test/FrontendObjC/ test/Transforms/SimplifyCFG/ In-Reply-To: <200908250524.n7P5O9P5007625@zion.cs.uiuc.edu> References: <200908250524.n7P5O9P5007625@zion.cs.uiuc.edu> Message-ID: On Aug 24, 2009, at 10:24 PM, Devang Patel wrote: > Author: dpatel > Date: Tue Aug 25 00:24:07 2009 > New Revision: 79977 > > URL: http://llvm.org/viewvc/llvm-project?rev=79977&view=rev > Log: > Update DebugInfo interface to use metadata, instead of special named > llvm.dbg.... global variables, to encode debugging information in > llvm IR. This is mostly a mechanical change that tests metadata > support very well. > > This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured > by compiling InstructionCombining.cpp!) Very nice! Evan > > Removed: > llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll > llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll > llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll > llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll > llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll > llvm/trunk/test/DebugInfo/2009-01-30-Method.ll > llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll > llvm/trunk/test/DebugInfo/2009-03-02-sink.ll > llvm/trunk/test/DebugInfo/dataOnly.ll > llvm/trunk/test/DebugInfo/forwardDecl.ll > llvm/trunk/test/DebugInfo/printdbginfo.ll > llvm/trunk/test/DebugInfo/printdbginfo2.ll > llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp > llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m > Modified: > llvm/trunk/docs/SourceLevelDebugging.html > llvm/trunk/include/llvm/Analysis/DebugInfo.h > llvm/trunk/include/llvm/AutoUpgrade.h > llvm/trunk/include/llvm/CodeGen/DwarfWriter.h > llvm/trunk/include/llvm/CodeGen/MachineFunction.h > llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > llvm/trunk/include/llvm/IntrinsicInst.h > llvm/trunk/include/llvm/Intrinsics.td > llvm/trunk/include/llvm/Metadata.h > llvm/trunk/include/llvm/Support/DebugLoc.h > llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp > llvm/trunk/lib/Analysis/DebugInfo.cpp > llvm/trunk/lib/AsmParser/LLParser.cpp > llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp > llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp > llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h > llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp > llvm/trunk/lib/CodeGen/MachineFunction.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp > llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp > llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h > llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp > llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp > llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp > llvm/trunk/lib/VMCore/AutoUpgrade.cpp > llvm/trunk/lib/VMCore/Metadata.cpp > llvm/trunk/lib/VMCore/ValueTypes.cpp > llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll > > Modified: llvm/trunk/docs/SourceLevelDebugging.html > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.html?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/docs/SourceLevelDebugging.html (original) > +++ llvm/trunk/docs/SourceLevelDebugging.html Tue Aug 25 00:24:07 2009 > @@ -122,8 +122,8 @@ >

The approach used by the LLVM implementation is to use a small set > of intrinsic functions to > define a > mapping between LLVM program objects and the source-level > objects. The > - description of the source-level program is maintained in LLVM > global > - variables in an implementation-defined > format > + description of the source-level program is maintained in LLVM > metadata > + in an implementation-defined format > (the C/C++ front-end currently uses working draft 7 of > the DWARF 3 > standard).

> @@ -240,31 +240,21 @@ >

LLVM debugging information has been carefully designed to make it > possible > for the optimizer to optimize the program and debugging > information without > necessarily having to know anything about debugging information. > In > - particular, the global constant merging pass automatically > eliminates > - duplicated debugging information (often caused by header files), > the global > - dead code elimination pass automatically deletes debugging > information for a > - function if it decides to delete the function, and the linker > eliminates > - debug information when it merges linkonce functions.

> + particular, te use of metadadta avoids duplicated dubgging > information from > + the beginning, and the global dead code elimination pass > automatically > + deletes debugging information for a function if it decides to > delete the > + function.

> >

To do this, most of the debugging information (descriptors for > types, > variables, functions, source files, etc) is inserted by the > language > - front-end in the form of LLVM global variables. These LLVM > global variables > - are no different from any other global variables, except that > they have a web > - of LLVM intrinsic functions that point to them. If the last > references to a > - particular piece of debugging information are deleted (for > example, by the > - -globaldce pass), the extraneous debug information will > - automatically become dead and be removed by the optimizer.

> + front-end in the form of LLVM metadata.

> >

Debug information is designed to be agnostic about the target > debugger and > debugging information representation (e.g. DWARF/Stabs/etc). It > uses a > - generic machine debug information pass to decode the information > that > - represents variables, types, functions, namespaces, etc: this > allows for > - arbitrary source-language semantics and type-systems to be used, > as long as > - there is a module written for the target debugger to interpret the > - information. In addition, debug global variables are declared in > - the "llvm.metadata" section. All values declared in > this section > - are stripped away after target debug information is constructed > and before > - the program object is emitted.

> + generic pass to decode the information that represents > variables, types, > + functions, namespaces, etc: this allows for arbitrary source- > language > + semantics and type-systems to be used, as long as there is a > module > + written for the target debugger to interpret the information.

> >

To provide basic functionality, the LLVM debugger does have to > make some > assumptions about the source-level language being debugged, > though it keeps > @@ -288,9 +278,7 @@ >

> >

In consideration of the complexity and volume of debug > information, LLVM > - provides a specification for well formed debug global > variables. The > - constant value of each of these globals is one of a limited set of > - structures, known as debug descriptors.

> + provides a specification for well formed debug descriptors.

> >

Consumers of LLVM debug information expect the descriptors for > program > objects to start in a canonical format, but the descriptors can > include > @@ -303,17 +291,14 @@ > the range 0x1000 thru 0x2000 (there is a defined enum > DW_TAG_user_base = > 0x1000.)

> > -

The fields of debug descriptors used internally by LLVM > (MachineModuleInfo) > +

The fields of debug descriptors used internally by LLVM > are restricted to only the simple data types int, > uint, > - bool, float, double, i8* and > - { }*. References to arbitrary values are handled > using a > - { }* and a cast to { }* expression; > typically > - references to other field descriptors, arrays of descriptors or > global > - variables.

> + bool, float, double, mdstring tt> and > + mdnode.

> >
>
> -%llvm.dbg.object.type = type {
> +!1 = metadata !{
>   uint,   ;; A tag
>   ...
> }
> @@ -326,8 +311,8 @@
>    of tags are loosely bound to the tag values of DWARF information  
> entries.
>    However, that does not restrict the use of the information  
> supplied to DWARF
>    targets.  To facilitate versioning of debug information, the tag  
> is augmented
> -   with the current debug version (LLVMDebugVersion = 4 << 16 or  
> 0x40000 or
> -   262144.)

> + with the current debug version (LLVMDebugVersion = 7 << 16 or > 0x70000 or > + 458752.)

> >

The details of the various descriptors follow.

> > @@ -342,17 +327,18 @@ > >
>
> -%llvm.dbg.compile_unit.type =  
> type {
> -  i32,    ;; Tag = 17 +  href="#LLVMDebugVersion">LLVMDebugVersion (DW_TAG_compile_unit)
> -  {  }*,  ;; Compile unit anchor = cast = (% href="#format_anchors">llvm.dbg.anchor.type* % href="#format_compile_units">llvm.dbg.compile_units to {  }*)
> -  i32,    ;; DWARF language identifier (ex. DW_LANG_C89)
> -  i8*,    ;; Source file name
> -  i8*,    ;; Source file directory (includes trailing slash)
> -  i8*     ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
> -  i1,     ;; True if this is a main compile unit.
> -  i1,     ;; True if this is optimized.
> -  i8*,    ;; Flags
> -  i32     ;; Runtime version
> +!0 = metadata !{
> +  i32,       ;; Tag = 17 +  href="#LLVMDebugVersion">LLVMDebugVersion
> +             ;; (DW_TAG_compile_unit)
> +  i32,       ;; Unused field.
> +  i32,       ;; DWARF language identifier (ex. DW_LANG_C89)
> +  metadata,  ;; Source file name
> +  metadata,  ;; Source file directory (includes trailing slash)
> +  metadata   ;; Producer (ex. "4.0.1 LLVM (LLVM research group)")
> +  i1,        ;; True if this is a main compile unit.
> +  i1,        ;; True if this is optimized.
> +  metadata,  ;; Flags
> +  i32        ;; Runtime version
> }
> 
>
> @@ -388,19 +374,20 @@ > >
>
> -%llvm.dbg.global_variable.type a> = type {
> -  i32,    ;; Tag = 52 +  href="#LLVMDebugVersion">LLVMDebugVersion (DW_TAG_variable)
> -  {  }*,  ;; Global variable anchor = cast (% href="#format_anchors">llvm.dbg.anchor.type* % href="#format_global_variables">llvm.dbg.global_variables to {  } 
> *),
> -  {  }*,  ;; Reference to context descriptor
> -  i8*,    ;; Name
> -  i8*,    ;; Display name (fully qualified C++ name)
> -  i8*,    ;; MIPS linkage name (for C++)
> -  {  }*,  ;; Reference to compile unit where defined
> -  i32,    ;; Line number where defined
> -  {  }*,  ;; Reference to type descriptor
> -  i1,     ;; True if the global is local to compile unit (static)
> -  i1,     ;; True if the global is defined in the compile unit (not  
> extern)
> -  {  }*   ;; Reference to the global variable
> +!1 = metadata !{
> +  i32,      ;; Tag = 52 +  href="#LLVMDebugVersion">LLVMDebugVersion
> +            ;; (DW_TAG_variable)
> +  i32,      ;; Unused field.
> +  metadata, ;; Reference to context descriptor
> +  metadata, ;; Name
> +  metadata, ;; Display name (fully qualified C++ name)
> +  metadata, ;; MIPS linkage name (for C++)
> +  metadata, ;; Reference to compile unit where defined
> +  i32,      ;; Line number where defined
> +  metadata, ;; Reference to type descriptor
> +  i1,       ;; True if the global is local to compile unit (static)
> +  i1,       ;; True if the global is defined in the compile unit  
> (not extern)
> +  {  }*     ;; Reference to the global variable
> }
> 
>
> @@ -419,18 +406,19 @@ > >
>
> -%llvm.dbg.subprogram.type = type {
> -  i32,    ;; Tag = 46 +  href="#LLVMDebugVersion">LLVMDebugVersion (DW_TAG_subprogram)
> -  {  }*,  ;; Subprogram anchor = cast (% href="#format_anchors">llvm.dbg.anchor.type* % href="#format_subprograms">llvm.dbg.subprograms to {  }*),
> -  {  }*,  ;; Reference to context descriptor
> -  i8*,    ;; Name
> -  i8*,    ;; Display name (fully qualified C++ name)
> -  i8*,    ;; MIPS linkage name (for C++)
> -  {  }*,  ;; Reference to compile unit where defined
> -  i32,    ;; Line number where defined
> -  {  }*,  ;; Reference to type descriptor
> -  i1,     ;; True if the global is local to compile unit (static)
> -  i1      ;; True if the global is defined in the compile unit (not  
> extern)
> +!2 = metadata !{
> +  i32,      ;; Tag = 46 +  href="#LLVMDebugVersion">LLVMDebugVersion
> +            ;; (DW_TAG_subprogram)
> +  i32,      ;; Unused field.
> +  metadata, ;; Reference to context descriptor
> +  metadata, ;; Name
> +  metadata, ;; Display name (fully qualified C++ name)
> +  metadata, ;; MIPS linkage name (for C++)
> +  metadata, ;; Reference to compile unit where defined
> +  i32,      ;; Line number where defined
> +  metadata, ;; Reference to type descriptor
> +  i1,       ;; True if the global is local to compile unit (static)
> +  i1        ;; True if the global is defined in the compile unit  
> (not extern)
> }
> 
>
> @@ -450,9 +438,9 @@ > >
>
> -%llvm.dbg.block = type {
> -  i32,    ;; Tag = 13 +  href="#LLVMDebugVersion">LLVMDebugVersion (DW_TAG_lexical_block)
> -  {  }*   ;; Reference to context descriptor
> +!3 = metadata !{
> +  i32,     ;; Tag = 13 +  href="#LLVMDebugVersion">LLVMDebugVersion (DW_TAG_lexical_block)
> +  metadata ;; Reference to context descriptor
> }
> 
>
> @@ -472,17 +460,18 @@ > >
>
> -%llvm.dbg.basictype.type = type {
> -  i32,    ;; Tag = 36 +  href="#LLVMDebugVersion">LLVMDebugVersion (DW_TAG_base_type)
> -  {  }*,  ;; Reference to context (typically a compile unit)
> -  i8*,    ;; Name (may be "" for anonymous types)
> -  {  }*,  ;; Reference to compile unit where defined (may be NULL)
> -  i32,    ;; Line number where defined (may be 0)
> -  i64,    ;; Size in bits
> -  i64,    ;; Alignment in bits
> -  i64,    ;; Offset in bits
> -  i32,    ;; Flags
> -  i32     ;; DWARF type encoding
> +!4 = metadata !{
> +  i32,      ;; Tag = 36 +  href="#LLVMDebugVersion">LLVMDebugVersion
> +            ;; (DW_TAG_base_type)
> +  metadata, ;; Reference to context (typically a compile unit)
> +  metadata, ;; Name (may be "" for anonymous types)
> +  metadata, ;; Reference to compile unit where defined (may be NULL)
> +  i32,      ;; Line number where defined (may be 0)
> +  i64,      ;; Size in bits
> +  i64,      ;; Alignment in bits
> +  i64,      ;; Offset in bits
> +  i32,      ;; Flags
> +  i32       ;; DWARF type encoding
> }
> 
>
> @@ -523,16 +512,16 @@ > >
>
> -%llvm.dbg.derivedtype.type =  
> type {
> -  i32,    ;; Tag (see below)
> -  {  }*,  ;; Reference to context
> -  i8*,    ;; Name (may be "" for anonymous types)
> -  {  }*,  ;; Reference to compile unit where defined (may be NULL)
> -  i32,    ;; Line number where defined (may be 0)
> -  i32,    ;; Size in bits
> -  i32,    ;; Alignment in bits
> -  i32,    ;; Offset in bits
> -  {  }*   ;; Reference to type derived from
> +!5 = metadata !{
> +  i32,      ;; Tag (see below)
> +  metadata, ;; Reference to context
> +  metadata, ;; Name (may be "" for anonymous types)
> +  metadata, ;; Reference to compile unit where defined (may be NULL)
> +  i32,      ;; Line number where defined (may be 0)
> +  i32,      ;; Size in bits
> +  i32,      ;; Alignment in bits
> +  i32,      ;; Offset in bits
> +  metadata  ;; Reference to type derived from
> }
> 
>
> @@ -591,19 +580,19 @@ > >
>
> -%llvm.dbg.compositetype.type =  
> type {
> -  i32,    ;; Tag (see below)
> -  {  }*,  ;; Reference to context
> -  i8*,    ;; Name (may be "" for anonymous types)
> -  {  }*,  ;; Reference to compile unit where defined (may be NULL)
> -  i32,    ;; Line number where defined (may be 0)
> -  i64,    ;; Size in bits
> -  i64,    ;; Alignment in bits
> -  i64,    ;; Offset in bits
> -  i32,    ;; Flags
> -  {  }*,  ;; Reference to type derived from
> -  {  }*,  ;; Reference to array of member descriptors
> -  i32     ;; Runtime languages
> +!6 = metadata !{
> +  i32,      ;; Tag (see below)
> +  metadata, ;; Reference to context
> +  metadata, ;; Name (may be "" for anonymous types)
> +  metadata, ;; Reference to compile unit where defined (may be NULL)
> +  i32,      ;; Line number where defined (may be 0)
> +  i64,      ;; Size in bits
> +  i64,      ;; Alignment in bits
> +  i64,      ;; Offset in bits
> +  i32,      ;; Flags
> +  metadata, ;; Reference to type derived from
> +  metadata, ;; Reference to array of member descriptors
> +  i32       ;; Runtime languages
> }
> 
>
> @@ -702,10 +691,11 @@ > >
>
> -%llvm.dbg.enumerator.type = type {
> -  i32,    ;; Tag = 40 +  href="#LLVMDebugVersion">LLVMDebugVersion (DW_TAG_enumerator)
> -  i8*,    ;; Name
> -  i64     ;; Value
> +!6 = metadata !{
> +  i32,      ;; Tag = 40 +  href="#LLVMDebugVersion">LLVMDebugVersion
> +            ;; (DW_TAG_enumerator)
> +  metadata, ;; Name
> +  i64       ;; Value
> }
> 
>
> @@ -725,13 +715,13 @@ > >
>
> -%llvm.dbg.variable.type = type {
> -  i32,     ;; Tag (see below)
> -  {  }*,   ;; Context
> -  i8*,     ;; Name
> -  {  }*,   ;; Reference to compile unit where defined
> -  i32,     ;; Line number where defined
> -  {  }*    ;; Type descriptor
> +!7 = metadata !{
> +  i32,      ;; Tag (see below)
> +  metadata, ;; Context
> +  metadata, ;; Name
> +  metadata, ;; Reference to compile unit where defined
> +  i32,      ;; Line number where defined
> +  metadata  ;; Type descriptor
> }
> 
>
> @@ -778,14 +768,14 @@ > >
>
> -  void %llvm.dbg.stoppoint 
> ( uint, uint, { }* )
> +  void %llvm.dbg.stoppoint 
> ( uint, uint, metadata)
> 
> >

This intrinsic is used to provide correspondence between the > source file and > the generated code. The first argument is the line number (base > 1), second > argument is the column number (0 if unknown) and the third > argument the > - source % href="#format_compile_units">llvm.dbg.compile_unit* > - cast to a { }*. Code following a call to this > intrinsic will > + source % href="#format_compile_units">llvm.dbg.compile_unit. > + Code following a call to this intrinsic will > have been defined in close proximity of the line, column and > file. This > information holds until the next call > to %lvm.dbg.stoppoint tt>.

> @@ -799,7 +789,7 @@ > >
>
> -  void %llvm.dbg.func.start 
> ( { }* )
> +  void %llvm.dbg.func.start 
> ( metadata )
> 
> >

This intrinsic is used to link the debug information > @@ -823,7 +813,7 @@ > >

>
> -  void % href="#format_common_region_start">llvm.dbg.region.start( { }* )
> +  void % href="#format_common_region_start">llvm.dbg.region.start 
> ( metadata )
> 
> >

This intrinsic is used to define the beginning of a declarative > scope (ex. > @@ -843,7 +833,7 @@ > >

>
> -  void %llvm.dbg.region.end 
> ( { }* )
> +  void %llvm.dbg.region.end 
> ( metadata )
> 
> >

This intrinsic is used to define the end of a declarative scope > (ex. block) > @@ -864,14 +854,14 @@ > >

>
> -  void %llvm.dbg.declare( { }  
> *, { }* )
> +  void %llvm.dbg.declare( { }  
> *, metadata )
> 
> >

This intrinsic provides information about a local element (ex. > variable.) The > first argument is the alloca for the variable, cast to a { } > *. The > second argument is > the %llvm.dbg.variable > containing > - the description of the variable, also cast to a { }*.

> + the description of the variable.

> >
> > @@ -955,29 +945,29 @@ > > ... > > - call void @ href="#format_common_func_start">llvm.dbg.func.start( % href="#format_subprograms">llvm.dbg.subprogram.type* > @llvm.dbg.subprogram ) > + call void @ href="#format_common_func_start">llvm.dbg.func.start( metadata !0) > > - call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 2, uint > 2, %llvm.dbg.compile_unit* > @llvm.dbg.compile_unit ) > + call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 2, uint > 2, metadata !1) > > call void @llvm.dbg.declare > ({}* %X, ...) > call void @llvm.dbg.declare > ({}* %Y, ...) > > ;; Evaluate expression on line 2, assigning to X. > > - call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 3, uint > 2, %llvm.dbg.compile_unit* > @llvm.dbg.compile_unit ) > + call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 3, uint > 2, metadata !1) > > ;; Evaluate expression on line 3, assigning to Y. > > call void @llvm.region.start a>() > - call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 5, uint > 4, %llvm.dbg.compile_unit* > @llvm.dbg.compile_unit ) > + call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 5, uint > 4, metadata !1) > call void @llvm.dbg.declare > ({}* %X, ...) > > ;; Evaluate expression on line 5, assigning to Z. > > - call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 7, uint > 2, %llvm.dbg.compile_unit* > @llvm.dbg.compile_unit ) > + call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 7, uint > 2, metadata !1) > call void @llvm.region.end a>() > > - call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 9, uint > 2, %llvm.dbg.compile_unit* > @llvm.dbg.compile_unit ) > + call void @ href="#format_common_stoppoint">llvm.dbg.stoppoint( uint 9, uint > 2, metadata !1) > > call void @llvm.region.end a>() > > @@ -1097,50 +1087,35 @@ >
> ...
> ;;
> -;; Define types used.  In this case we need one for compile unit  
> anchors and one
> -;; for compile units.
> -;;
> -%llvm.dbg.anchor.type = type { uint,  
> uint }
> -%llvm.dbg.compile_unit.type =  
> type { uint, {  }*, uint, uint, i8*, i8*, i8* }
> -...
> -;;
> -;; Define the anchor for compile units.  Note that the second field  
> of the
> -;; anchor is 17, which is the same as the tag for compile units
> -;; (17 = DW_TAG_compile_unit.)
> -;;
> -%llvm.dbg.compile_units =  
> linkonce constant %llvm.dbg.anchor.type a> { uint 0, uint 17 }, section "llvm.metadata"
> -
> -;;
> ;; Define the compile unit for the source file "/Users/mine/sources/ 
> MySource.cpp".
> ;;
> -%llvm.dbg.compile_unit1 =  
> internal constant % href="#format_compile_units">llvm.dbg.compile_unit.type {
> -    uint add(uint 17, uint 262144),
> -    {  }* cast (%llvm.dbg.anchor.type a>* %llvm.dbg.compile_units to  
> {  }*),
> -    uint 1,
> -    uint 1,
> -    i8* getelementptr ([13 x i8]* %str1, i32 0, i32 0),
> -    i8* getelementptr ([21 x i8]* %str2, i32 0, i32 0),
> -    i8* getelementptr ([33 x i8]* %str3, i32 0, i32 0) }, section  
> "llvm.metadata"
> -
> +!3 = metadata !{
> +  i32 458769,    ;; Tag
> +  i32 0,         ;; Unused
> +  i32 4,         ;; Language Id
> +  metadata !"MySource.cpp",
> +  metadata !"/Users/mine/sources",
> +  metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)",
> +  i1 true,       ;; Main Compile Unit
> +  i1 false,      ;; Optimized compile unit
> +  metadata !"",  ;; Compiler flags
> +  i32 0}         ;; Runtime version
> +
> ;;
> ;; Define the compile unit for the header file "/Users/mine/sources/ 
> MyHeader.h".
> ;;
> -%llvm.dbg.compile_unit2 =  
> internal constant % href="#format_compile_units">llvm.dbg.compile_unit.type {
> -    uint add(uint 17, uint 262144),
> -    {  }* cast (%llvm.dbg.anchor.type a>* %llvm.dbg.compile_units to  
> {  }*),
> -    uint 1,
> -    uint 1,
> -    i8* getelementptr ([11 x i8]* %str4, int 0, int 0),
> -    i8* getelementptr ([21 x i8]* %str2, int 0, int 0),
> -    i8* getelementptr ([33 x i8]* %str3, int 0, int 0) }, section  
> "llvm.metadata"
> -
> -;;
> -;; Define each of the strings used in the compile units.
> -;;
> -%str1 = internal constant [13 x i8] c"MySource.cpp\00", section  
> "llvm.metadata";
> -%str2 = internal constant [21 x i8] c"/Users/mine/sources/\00",  
> section "llvm.metadata";
> -%str3 = internal constant [33 x i8] c"4.0.1 LLVM (LLVM research  
> group)\00", section "llvm.metadata";
> -%str4 = internal constant [11 x i8] c"MyHeader.h\00", section  
> "llvm.metadata";
> +!1 = metadata !{
> +  i32 458769,    ;; Tag
> +  i32 0,         ;; Unused
> +  i32 4,         ;; Language Id
> +  metadata !"MyHeader.h",
> +  metadata !"/Users/mine/sources",
> +  metadata !"4.2.1 (Based on Apple Inc. build 5649) (LLVM build 00)",
> +  i1 false,      ;; Main Compile Unit
> +  i1 false,      ;; Optimized compile unit
> +  metadata !"",  ;; Compiler flags
> +  i32 0}         ;; Runtime version
> +
> ...
> 
>
> @@ -1167,65 +1142,51 @@ >
>
> ;;
> -;; Define types used. One for global variable anchors, one for the  
> global
> -;; variable descriptor, one for the global's basic type and one for  
> the global's
> -;; compile unit.
> -;;
> -%llvm.dbg.anchor.type = type { uint,  
> uint }
> -%llvm.dbg.global_variable.type a> = type { uint, {  }*, {  }*, i8*, {  }*, uint, {  }*, bool, bool,  
> {  }*, uint }
> -%llvm.dbg.basictype.type = type  
> { uint, {  }*, i8*, {  }*, int, uint, uint, uint, uint }
> -%llvm.dbg.compile_unit.type = ...
> -...
> -;;
> ;; Define the global itself.
> ;;
> %MyGlobal = global int 100
> ...
> ;;
> -;; Define the anchor for global variables.  Note that the second  
> field of the
> -;; anchor is 52, which is the same as the tag for global variables
> -;; (52 = DW_TAG_variable.)
> +;; List of debug info of globals
> ;;
> -%llvm.dbg.global_variables =  
> linkonce constant %llvm.dbg.anchor.type a> { uint 0, uint 52 }, section "llvm.metadata"
> +!llvm.dbg.gv = !{!0}
>
> ;;
> ;; Define the global variable descriptor.  Note the reference to the  
> global
> ;; variable anchor and the global variable itself.
> ;;
> -%llvm.dbg.global_variable =  
> internal constant % href="#format_global_variables">llvm.dbg.global_variable.type {
> -    uint add(uint 52, uint 262144),
> -    {  }* cast (%llvm.dbg.anchor.type a>* %llvm.dbg.global_variables a> to {  }*),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([9 x i8]* %str1, int 0, int 0),
> -    i8* getelementptr ([1 x i8]* %str2, int 0, int 0),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    uint 1,
> -    {  }* cast (% href="#format_basic_type">llvm.dbg.basictype.type* % href="#format_basic_type">llvm.dbg.basictype to {  }*),
> -    bool false,
> -    bool true,
> -    {  }* cast (int* %MyGlobal to {  }*) }, section "llvm.metadata"
> -
> +!0 = metadata !{
> +  i32 458804,              ;; Tag
> +  i32 0,                   ;; Unused
> +  metadata !1,             ;; Context
> +  metadata !"MyGlobal",    ;; Name
> +  metadata !"MyGlobal",    ;; Display Name
> +  metadata !"MyGlobal",    ;; Linkage Name
> +  metadata !1,             ;; Compile Unit
> +  i32 1,                   ;; Line Number
> +  metadata !2,             ;; Type
> +  i1 false,                ;; Is a local variable
> +  i1 true,                 ;; Is this a definition
> +  i32* @MyGlobal           ;; The global variable
> +}
> +
> ;;
> ;; Define the basic type of 32 bit signed integer.  Note that since  
> int is an
> ;; intrinsic type the source file is NULL and line 0.
> ;;
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([4 x i8]* %str3, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 32,
> -    uint 32,
> -    uint 0,
> -    uint 5 }, section "llvm.metadata"
> -
> -;;
> -;; Define the names of the global variable and basic type.
> -;;
> -%str1 = internal constant [9 x i8] c"MyGlobal\00", section  
> "llvm.metadata"
> -%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
> -%str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,              ;; Tag
> +  metadata !1,             ;; Context
> +  metadata !"int",         ;; Name
> +  metadata !1,             ;; Compile Unit
> +  i32 0,                   ;; Line number
> +  i64 32,                  ;; Size in Bits
> +  i64 32,                  ;; Align in Bits
> +  i64 0,                   ;; Offset in Bits
> +  i32 0,                   ;; Flags
> +  i32 5                    ;; Encoding
> +}
> +
> 
>
> > @@ -1253,46 +1214,27 @@ >
>
> ;;
> -;; Define types used. One for subprogram anchors, one for the  
> subprogram
> -;; descriptor, one for the global's basic type and one for the  
> subprogram's
> -;; compile unit.
> -;;
> -%llvm.dbg.subprogram.type = type  
> { uint, {  }*, {  }*, i8*, {  }*, bool, bool }
> -%llvm.dbg.anchor.type = type { uint,  
> uint }
> -%llvm.dbg.compile_unit.type = ...
> -	
> -;;
> ;; Define the anchor for subprograms.  Note that the second field of  
> the
> ;; anchor is 46, which is the same as the tag for subprograms
> ;; (46 = DW_TAG_subprogram.)
> ;;
> -%llvm.dbg.subprograms = linkonce  
> constant %llvm.dbg.anchor.type { uint  
> 0, uint 46 }, section "llvm.metadata"
> -
> -;;
> -;; Define the descriptor for the subprogram.  TODO - more details.
> -;;
> -%llvm.dbg.subprogram = internal  
> constant %llvm.dbg.subprogram.type {
> -    uint add(uint 46, uint 262144),
> -    {  }* cast (%llvm.dbg.anchor.type a>* %llvm.dbg.subprograms to {  }*),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([5 x i8]* %str1, int 0, int 0),
> -    i8* getelementptr ([1 x i8]* %str2, int 0, int 0),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    uint 1,
> -    {  }* null,
> -    bool false,
> -    bool true }, section "llvm.metadata"
> -
> -;;
> -;; Define the name of the subprogram.
> -;;
> -%str1 = internal constant [5 x i8] c"main\00", section  
> "llvm.metadata"
> -%str2 = internal constant [1 x i8] c"\00", section "llvm.metadata"
> -
> +!0 = metadata !{
> +  i32 458798,        ;; Tag
> +  i32 0,             ;; Unused
> +  metadata !1,       ;; Context
> +  metadata !"main",  ;; Name
> +  metadata !"main",  ;; Display name
> +  metadata !"main",  ;; Linkage name
> +  metadata !1,       ;; Compile unit
> +  i32 1,             ;; Line number
> +  metadata !2,       ;; Type
> +  i1 false,          ;; Is local
> +  i1 true            ;; Is definition
> +}
> ;;
> ;; Define the subprogram itself.
> ;;
> -int %main(int %argc, i8** %argv) {
> +define i32 @main(i32 %argc, i8** %argv) {
> ...
> }
> 
> @@ -1320,17 +1262,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([5 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 32,
> -    uint 32,
> -    uint 0,
> -    uint 2 }, section "llvm.metadata"
> -%str1 = internal constant [5 x i8] c"bool\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"bool",  ;; Name
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 8,             ;; Size in Bits
> +  i64 8,             ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 2              ;; Encoding
> +}
> 
>
> > @@ -1345,17 +1288,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([5 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 8,
> -    uint 8,
> -    uint 0,
> -    uint 6 }, section "llvm.metadata"
> -%str1 = internal constant [5 x i8] c"char\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"char",  ;; Name
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 8,             ;; Size in Bits
> +  i64 8,             ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 6              ;; Encoding
> +}
> 
>
> > @@ -1370,17 +1314,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([14 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 8,
> -    uint 8,
> -    uint 0,
> -    uint 8 }, section "llvm.metadata"
> -%str1 = internal constant [14 x i8] c"unsigned char\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"unsigned char",
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 8,             ;; Size in Bits
> +  i64 8,             ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 8              ;; Encoding
> +}
> 
>
> > @@ -1395,17 +1340,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([10 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 16,
> -    uint 16,
> -    uint 0,
> -    uint 5 }, section "llvm.metadata"
> -%str1 = internal constant [10 x i8] c"short int\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"short int",
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 16,            ;; Size in Bits
> +  i64 16,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 5              ;; Encoding
> +}
> 
>
> > @@ -1420,17 +1366,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([19 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 16,
> -    uint 16,
> -    uint 0,
> -    uint 7 }, section "llvm.metadata"
> -%str1 = internal constant [19 x i8] c"short unsigned int\00",  
> section "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"short unsigned int",
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 16,            ;; Size in Bits
> +  i64 16,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 7              ;; Encoding
> +}
> 
>
> > @@ -1445,17 +1392,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([4 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 32,
> -    uint 32,
> -    uint 0,
> -    uint 5 }, section "llvm.metadata"
> -%str1 = internal constant [4 x i8] c"int\00", section "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"int",   ;; Name
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 32,            ;; Size in Bits
> +  i64 32,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 5              ;; Encoding
> +}
> 
> >
> @@ -1469,17 +1417,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([13 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 32,
> -    uint 32,
> -    uint 0,
> -    uint 7 }, section "llvm.metadata"
> -%str1 = internal constant [13 x i8] c"unsigned int\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"unsigned int",
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 32,            ;; Size in Bits
> +  i64 32,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 7              ;; Encoding
> +}
> 
>
> > @@ -1494,17 +1443,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([14 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 64,
> -    uint 64,
> -    uint 0,
> -    uint 5 }, section "llvm.metadata"
> -%str1 = internal constant [14 x i8] c"long long int\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"long long int",
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 64,            ;; Size in Bits
> +  i64 64,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 5              ;; Encoding
> +}
> 
>
> > @@ -1519,17 +1469,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([23 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 64,
> -    uint 64,
> -    uint 0,
> -    uint 7 }, section "llvm.metadata"
> -%str1 = internal constant [23 x 8] c"long long unsigned int\00",  
> section "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"long long unsigned int",
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 64,            ;; Size in Bits
> +  i64 64,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 7              ;; Encoding
> +}
> 
>
> > @@ -1544,17 +1495,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    i8* getelementptr ([6 x i8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 32,
> -    uint 32,
> -    uint 0,
> -    uint 4 }, section "llvm.metadata"
> -%str1 = internal constant [6 x i8] c"float\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"float",
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 32,            ;; Size in Bits
> +  i64 32,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 4              ;; Encoding
> +}
> 
>
> > @@ -1569,17 +1521,18 @@ > >
>
> -%llvm.dbg.basictype = internal  
> constant %llvm.dbg.basictype.type {
> -    uint add(uint 36, uint 262144),
> -    {  }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to {  }*),
> -    8* getelementptr ([7 x 8]* %str1, int 0, int 0),
> -    {  }* null,
> -    int 0,
> -    uint 64,
> -    uint 64,
> -    uint 0,
> -    uint 4 }, section "llvm.metadata"
> -%str1 = internal constant [7 x 8] c"double\00", section  
> "llvm.metadata"
> +!2 = metadata !{
> +  i32 458788,        ;; Tag
> +  metadata !1,       ;; Context
> +  metadata !"double",;; Name
> +  metadata !1,       ;; Compile Unit
> +  i32 0,             ;; Line number
> +  i64 64,            ;; Size in Bits
> +  i64 64,            ;; Align in Bits
> +  i64 0,             ;; Offset in Bits
> +  i32 0,             ;; Flags
> +  i32 4              ;; Encoding
> +}
> 
>
> > @@ -1607,60 +1560,64 @@ > ;; > ;; Define the typedef "IntPtr". > ;; > -%llvm.dbg.derivedtype1 = > internal constant % href="#format_derived_type">llvm.dbg.derivedtype.type { > - uint add(uint 22, uint 262144), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - i8* getelementptr ([7 x 8]* %str1, int 0, int 0), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - int 1, > - uint 0, > - uint 0, > - uint 0, > - { }* cast (% href="#format_derived_type">llvm.dbg.derivedtype.type* % href="#format_derived_type">llvm.dbg.derivedtype2 to { }*) }, > section "llvm.metadata" > -%str1 = internal constant [7 x 8] c"IntPtr\00", section > "llvm.metadata" > +!2 = metadata !{ > + i32 458774, ;; Tag > + metadata !1, ;; Context > + metadata !"IntPtr", ;; Name > + metadata !3, ;; Compile unit > + i32 0, ;; Line number > + i64 0, ;; Size in bits > + i64 0, ;; Align in bits > + i64 0, ;; Offset in bits > + i32 0, ;; Flags > + metadata !4 ;; Derived From type > +} > > ;; > ;; Define the pointer type. > ;; > -%llvm.dbg.derivedtype2 = > internal constant % href="#format_derived_type">llvm.dbg.derivedtype.type { > - uint add(uint 15, uint 262144), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - i8* null, > - { }* null, > - int 0, > - uint 32, > - uint 32, > - uint 0, > - { }* cast (% href="#format_derived_type">llvm.dbg.derivedtype.type* % href="#format_derived_type">llvm.dbg.derivedtype3 to { }*) }, > section "llvm.metadata" > - > +!4 = metadata !{ > + i32 458767, ;; Tag > + metadata !1, ;; Context > + metadata !"", ;; Name > + metadata !1, ;; Compile unit > + i32 0, ;; Line number > + i64 64, ;; Size in bits > + i64 64, ;; Align in bits > + i64 0, ;; Offset in bits > + i32 0, ;; Flags > + metadata !5 ;; Derived From type > +} > ;; > ;; Define the const type. > ;; > -%llvm.dbg.derivedtype3 = > internal constant % href="#format_derived_type">llvm.dbg.derivedtype.type { > - uint add(uint 38, uint 262144), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - i8* null, > - { }* null, > - int 0, > - uint 0, > - uint 0, > - uint 0, > - { }* cast (% href="#format_basic_type">llvm.dbg.basictype.type* % href="#format_basic_type">llvm.dbg.basictype1 to { }*) }, > section "llvm.metadata" > - > +!5 = metadata !{ > + i32 458790, ;; Tag > + metadata !1, ;; Context > + metadata !"", ;; Name > + metadata !1, ;; Compile unit > + i32 0, ;; Line number > + i64 32, ;; Size in bits > + i64 32, ;; Align in bits > + i64 0, ;; Offset in bits > + i32 0, ;; Flags > + metadata !6 ;; Derived From type > +} > ;; > ;; Define the int type. > ;; > -%llvm.dbg.basictype1 = internal > constant %llvm.dbg.basictype.type { > - uint add(uint 36, uint 262144), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - 8* getelementptr ([4 x 8]* %str2, int 0, int 0), > - { }* null, > - int 0, > - uint 32, > - uint 32, > - uint 0, > - uint 5 }, section "llvm.metadata" > -%str2 = internal constant [4 x 8] c"int\00", section "llvm.metadata" > +!6 = metadata !{ > + i32 458788, ;; Tag > + metadata !1, ;; Context > + metadata !"int", ;; Name > + metadata !1, ;; Compile unit > + i32 0, ;; Line number > + i64 32, ;; Size in bits > + i64 32, ;; Align in bits > + i64 0, ;; Offset in bits > + i32 0, ;; Flags > + 5 ;; Encoding > +} >
>
> > @@ -1692,86 +1649,88 @@ > ;; > ;; Define basic type for unsigned int. > ;; > -%llvm.dbg.basictype = internal > constant %llvm.dbg.basictype.type { > - uint add(uint 36, uint 262144), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - i8* getelementptr ([13 x i8]* %str1, int 0, int 0), > - { }* null, > - int 0, > - uint 32, > - uint 32, > - uint 0, > - uint 7 }, section "llvm.metadata" > -%str1 = internal constant [13 x i8] c"unsigned int\00", section > "llvm.metadata" > - > +!5 = metadata !{ > + i32 458788, ;; Tag > + metadata !1, ;; Context > + metadata !"unsigned int", > + metadata !1, ;; Compile Unit > + i32 0, ;; Line number > + i64 32, ;; Size in Bits > + i64 32, ;; Align in Bits > + i64 0, ;; Offset in Bits > + i32 0, ;; Flags > + i32 7 ;; Encoding > +} > ;; > ;; Define composite type for struct Color. > ;; > -%llvm.dbg.compositetype = > internal constant % href="#format_composite_type">llvm.dbg.compositetype.type { > - uint add(uint 19, uint 262144), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - i8* getelementptr ([6 x i8]* %str2, int 0, int 0), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - int 1, > - uint 96, > - uint 32, > - uint 0, > - { }* null, > - { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section > "llvm.metadata" > -%str2 = internal constant [6 x i8] c"Color\00", section > "llvm.metadata" > +!2 = metadata !{ > + i32 458771, ;; Tag > + metadata !1, ;; Context > + metadata !"Color", ;; Name > + metadata !1, ;; Compile unit > + i32 1, ;; Line number > + i64 96, ;; Size in bits > + i64 32, ;; Align in bits > + i64 0, ;; Offset in bits > + i32 0, ;; Flags > + null, ;; Derived From > + metadata !3, ;; Elements > + i32 0 ;; Runtime Language > +} > > ;; > ;; Define the Red field. > ;; > -%llvm.dbg.derivedtype1 = > internal constant % href="#format_derived_type">llvm.dbg.derivedtype.type { > - uint add(uint 13, uint 262144), > - { }* null, > - i8* getelementptr ([4 x i8]* %str3, int 0, int 0), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - int 2, > - uint 32, > - uint 32, > - uint 0, > - { }* cast (% href="#format_basic_type">llvm.dbg.basictype.type* % href="#format_basic_type">llvm.dbg.basictype to { }*) }, > section "llvm.metadata" > -%str3 = internal constant [4 x i8] c"Red\00", section "llvm.metadata" > +!4 = metadata !{ > + i32 458765, ;; Tag > + metadata !1, ;; Context > + metadata !"Red", ;; Name > + metadata !1, ;; Compile Unit > + i32 2, ;; Line number > + i64 32, ;; Size in bits > + i64 32, ;; Align in bits > + i64 0, ;; Offset in bits > + i32 0, ;; Flags > + metadata !5 ;; Derived From type > +} > > ;; > ;; Define the Green field. > ;; > -%llvm.dbg.derivedtype2 = > internal constant % href="#format_derived_type">llvm.dbg.derivedtype.type { > - uint add(uint 13, uint 262144), > - { }* null, > - i8* getelementptr ([6 x i8]* %str4, int 0, int 0), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - int 3, > - uint 32, > - uint 32, > - uint 32, > - { }* cast (% href="#format_basic_type">llvm.dbg.basictype.type* % href="#format_basic_type">llvm.dbg.basictype to { }*) }, > section "llvm.metadata" > -%str4 = internal constant [6 x i8] c"Green\00", section > "llvm.metadata" > +!6 = metadata !{ > + i32 458765, ;; Tag > + metadata !1, ;; Context > + metadata !"Green", ;; Name > + metadata !1, ;; Compile Unit > + i32 3, ;; Line number > + i64 32, ;; Size in bits > + i64 32, ;; Align in bits > + i64 32, ;; Offset in bits > + i32 0, ;; Flags > + metadata !5 ;; Derived From type > +} > > ;; > ;; Define the Blue field. > ;; > -%llvm.dbg.derivedtype3 = > internal constant % href="#format_derived_type">llvm.dbg.derivedtype.type { > - uint add(uint 13, uint 262144), > - { }* null, > - i8* getelementptr ([5 x i8]* %str5, int 0, int 0), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - int 4, > - uint 32, > - uint 32, > - uint 64, > - { }* cast (% href="#format_basic_type">llvm.dbg.basictype.type* % href="#format_basic_type">llvm.dbg.basictype to { }*) }, > section "llvm.metadata" > -%str5 = internal constant [5 x 8] c"Blue\00", section "llvm.metadata" > +!7 = metadata !{ > + i32 458765, ;; Tag > + metadata !1, ;; Context > + metadata !"Blue", ;; Name > + metadata !1, ;; Compile Unit > + i32 4, ;; Line number > + i64 32, ;; Size in bits > + i64 32, ;; Align in bits > + i64 64, ;; Offset in bits > + i32 0, ;; Flags > + metadata !5 ;; Derived From type > +} > > ;; > ;; Define the array of fields used by the composite type Color. > ;; > -%llvm.dbg.array = internal constant [3 x { }*] [ > - { }* cast (% href="#format_derived_type">llvm.dbg.derivedtype.type* % href="#format_derived_type">llvm.dbg.derivedtype1 to { }*), > - { }* cast (% href="#format_derived_type">llvm.dbg.derivedtype.type* % href="#format_derived_type">llvm.dbg.derivedtype2 to { }*), > - { }* cast (% href="#format_derived_type">llvm.dbg.derivedtype.type* % href="#format_derived_type">llvm.dbg.derivedtype3 to { }*) ], > section "llvm.metadata" > +!3 = metadata !{metadata !4, metadata !6, metadata !7} > >
> > @@ -1803,53 +1762,41 @@ > ;; > ;; Define composite type for enum Trees > ;; > -%llvm.dbg.compositetype = > internal constant % href="#format_composite_type">llvm.dbg.compositetype.type { > - uint add(uint 4, uint 262144), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - i8* getelementptr ([6 x i8]* %str1, int 0, int 0), > - { }* cast (% href="#format_compile_units">llvm.dbg.compile_unit.type* % href="#format_compile_units">llvm.dbg.compile_unit to { }*), > - int 1, > - uint 32, > - uint 32, > - uint 0, > - { }* null, > - { }* cast ([3 x { }*]* %llvm.dbg.array to { }*) }, section > "llvm.metadata" > -%str1 = internal constant [6 x i8] c"Trees\00", section > "llvm.metadata" > +!2 = metadata !{ > + i32 458756, ;; Tag > + metadata !1, ;; Context > + metadata !"Trees", ;; Name > + metadata !1, ;; Compile unit > + i32 1, ;; Line number > + i64 32, ;; Size in bits > + i64 32, ;; Align in bits > + i64 0, ;; Offset in bits > + i32 0, ;; Flags > + null, ;; Derived From type > + metadata !3, ;; Elements > + i32 0 ;; Runtime language > +} > + > +;; > +;; Define the array of enumerators used by composite type Trees. > +;; > +!3 = metadata !{metadata !4, metadata !5, metadata !6} > > ;; > ;; Define Spruce enumerator. > ;; > -%llvm.dbg.enumerator1 = internal > constant %llvm.dbg.enumerator.type { > - uint add(uint 40, uint 262144), > - i8* getelementptr ([7 x i8]* %str2, int 0, int 0), > - int 100 }, section "llvm.metadata" > -%str2 = internal constant [7 x i8] c"Spruce\00", section > "llvm.metadata" > +!4 = metadata !{i32 458792, metadata !"Spruce", i64 100} > > ;; > ;; Define Oak enumerator. > ;; > -%llvm.dbg.enumerator2 = internal > constant %llvm.dbg.enumerator.type { > - uint add(uint 40, uint 262144), > - i8* getelementptr ([4 x i8]* %str3, int 0, int 0), > - int 200 }, section "llvm.metadata" > -%str3 = internal constant [4 x i8] c"Oak\00", section "llvm.metadata" > +!5 = metadata !{i32 458792, metadata !"Oak", i64 200} > > ;; > ;; Define Maple enumerator. > ;; > -%llvm.dbg.enumerator3 = internal > constant %llvm.dbg.enumerator.type { > - uint add(uint 40, uint 262144), > - i8* getelementptr ([6 x i8]* %str4, int 0, int 0), > - int 300 }, section "llvm.metadata" > -%str4 = internal constant [6 x i8] c"Maple\00", section > "llvm.metadata" > +!6 = metadata !{i32 458792, metadata !"Maple", i64 300} > > -;; > -;; Define the array of enumerators used by composite type Trees. > -;; > -%llvm.dbg.array = internal constant [3 x { }*] [ > - { }* cast (% href="#format_enumeration">llvm.dbg.enumerator.type* % href="#format_enumeration">llvm.dbg.enumerator1 to { }*), > - { }* cast (% href="#format_enumeration">llvm.dbg.enumerator.type* % href="#format_enumeration">llvm.dbg.enumerator2 to { }*), > - { }* cast (% href="#format_enumeration">llvm.dbg.enumerator.type* % href="#format_enumeration">llvm.dbg.enumerator3 to { }*) ], > section "llvm.metadata" > >
> > > Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) > +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Aug 25 00:24:07 > 2009 > @@ -17,6 +17,7 @@ > #ifndef LLVM_ANALYSIS_DEBUGINFO_H > #define LLVM_ANALYSIS_DEBUGINFO_H > > +#include "llvm/Metadata.h" > #include "llvm/Target/TargetMachine.h" > #include "llvm/ADT/StringMap.h" > #include "llvm/ADT/DenseMap.h" > @@ -44,12 +45,12 @@ > > class DIDescriptor { > protected: > - GlobalVariable *DbgGV; > + MDNode *DbgNode; > > - /// DIDescriptor constructor. If the specified GV is non-null, > this checks > + /// DIDescriptor constructor. If the specified node is non- > null, check > /// to make sure that the tag in the descriptor matches > 'RequiredTag'. If > /// not, the debug info is corrupt and we ignore it. > - DIDescriptor(GlobalVariable *GV, unsigned RequiredTag); > + DIDescriptor(MDNode *N, unsigned RequiredTag); > > const std::string &getStringField(unsigned Elt, std::string > &Result) const; > unsigned getUnsignedField(unsigned Elt) const { > @@ -60,18 +61,18 @@ > > template > DescTy getFieldAs(unsigned Elt) const { > - return DescTy(getDescriptorField(Elt).getGV()); > + return DescTy(getDescriptorField(Elt).getNode()); > } > > GlobalVariable *getGlobalVariableField(unsigned Elt) const; > > public: > - explicit DIDescriptor() : DbgGV(0) {} > - explicit DIDescriptor(GlobalVariable *GV) : DbgGV(GV) {} > + explicit DIDescriptor() : DbgNode(0) {} > + explicit DIDescriptor(MDNode *N) : DbgNode(N) {} > > - bool isNull() const { return DbgGV == 0; } > + bool isNull() const { return DbgNode == 0; } > > - GlobalVariable *getGV() const { return DbgGV; } > + MDNode *getNode() const { return DbgNode; } > > unsigned getVersion() const { > return getUnsignedField(0) & LLVMDebugVersionMask; > @@ -81,8 +82,8 @@ > return getUnsignedField(0) & ~LLVMDebugVersionMask; > } > > - /// ValidDebugInfo - Return true if V represents valid debug > info value. > - static bool ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel); > + /// ValidDebugInfo - Return true if N represents valid debug > info value. > + static bool ValidDebugInfo(MDNode *N, CodeGenOpt::Level > OptLevel); > > /// dump - print descriptor. > void dump() const; > @@ -91,8 +92,8 @@ > /// DISubrange - This is used to represent ranges, for array bounds. > class DISubrange : public DIDescriptor { > public: > - explicit DISubrange(GlobalVariable *GV = 0) > - : DIDescriptor(GV, dwarf::DW_TAG_subrange_type) {} > + explicit DISubrange(MDNode *N = 0) > + : DIDescriptor(N, dwarf::DW_TAG_subrange_type) {} > > int64_t getLo() const { return (int64_t)getUInt64Field(1); } > int64_t getHi() const { return (int64_t)getUInt64Field(2); } > @@ -101,7 +102,8 @@ > /// DIArray - This descriptor holds an array of descriptors. > class DIArray : public DIDescriptor { > public: > - explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {} > + explicit DIArray(MDNode *N = 0) > + : DIDescriptor(N) {} > > unsigned getNumElements() const; > DIDescriptor getElement(unsigned Idx) const { > @@ -112,8 +114,8 @@ > /// DICompileUnit - A wrapper for a compile unit. > class DICompileUnit : public DIDescriptor { > public: > - explicit DICompileUnit(GlobalVariable *GV = 0) > - : DIDescriptor(GV, dwarf::DW_TAG_compile_unit) {} > + explicit DICompileUnit(MDNode *N = 0) > + : DIDescriptor(N, dwarf::DW_TAG_compile_unit) {} > > unsigned getLanguage() const { return getUnsignedField(2); } > const std::string &getFilename(std::string &F) const { > @@ -154,8 +156,8 @@ > /// type/precision or a file/line pair for location info. > class DIEnumerator : public DIDescriptor { > public: > - explicit DIEnumerator(GlobalVariable *GV = 0) > - : DIDescriptor(GV, dwarf::DW_TAG_enumerator) {} > + explicit DIEnumerator(MDNode *N = 0) > + : DIDescriptor(N, dwarf::DW_TAG_enumerator) {} > > const std::string &getName(std::string &F) const { > return getStringField(1, F); > @@ -175,10 +177,11 @@ > }; > > protected: > - DIType(GlobalVariable *GV, unsigned Tag) : DIDescriptor(GV, > Tag) {} > + DIType(MDNode *N, unsigned Tag) > + : DIDescriptor(N, Tag) {} > // This ctor is used when the Tag has already been validated by > a derived > // ctor. > - DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {} > + DIType(MDNode *N, bool, bool) : DIDescriptor(N) {} > > public: > /// isDerivedType - Return true if the specified tag is legal for > @@ -198,7 +201,7 @@ > /// Verify - Verify that a type descriptor is well formed. > bool Verify() const; > public: > - explicit DIType(GlobalVariable *GV); > + explicit DIType(MDNode *N); > explicit DIType() {} > virtual ~DIType() {} > > @@ -231,8 +234,8 @@ > /// DIBasicType - A basic type, like 'int' or 'float'. > class DIBasicType : public DIType { > public: > - explicit DIBasicType(GlobalVariable *GV) > - : DIType(GV, dwarf::DW_TAG_base_type) {} > + explicit DIBasicType(MDNode *N = 0) > + : DIType(N, dwarf::DW_TAG_base_type) {} > > unsigned getEncoding() const { return getUnsignedField(9); } > > @@ -244,13 +247,13 @@ > /// a typedef, a pointer or reference, etc. > class DIDerivedType : public DIType { > protected: > - explicit DIDerivedType(GlobalVariable *GV, bool, bool) > - : DIType(GV, true, true) {} > + explicit DIDerivedType(MDNode *N, bool, bool) > + : DIType(N, true, true) {} > public: > - explicit DIDerivedType(GlobalVariable *GV) > - : DIType(GV, true, true) { > - if (GV && !isDerivedType(getTag())) > - DbgGV = 0; > + explicit DIDerivedType(MDNode *N = 0) > + : DIType(N, true, true) { > + if (DbgNode && !isDerivedType(getTag())) > + DbgNode = 0; > } > > DIType getTypeDerivedFrom() const { return getFieldAs > (9); } > @@ -272,10 +275,10 @@ > /// FIXME: Why is this a DIDerivedType?? > class DICompositeType : public DIDerivedType { > public: > - explicit DICompositeType(GlobalVariable *GV) > - : DIDerivedType(GV, true, true) { > - if (GV && !isCompositeType(getTag())) > - DbgGV = 0; > + explicit DICompositeType(MDNode *N = 0) > + : DIDerivedType(N, true, true) { > + if (N && !isCompositeType(getTag())) > + DbgNode = 0; > } > > DIArray getTypeArray() const { return getFieldAs(10); } > @@ -291,8 +294,8 @@ > /// DIGlobal - This is a common class for global variables and > subprograms. > class DIGlobal : public DIDescriptor { > protected: > - explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag) > - : DIDescriptor(GV, RequiredTag) {} > + explicit DIGlobal(MDNode *N, unsigned RequiredTag) > + : DIDescriptor(N, RequiredTag) {} > > /// isSubprogram - Return true if the specified tag is legal for > /// DISubprogram. > @@ -335,8 +338,8 @@ > /// DISubprogram - This is a wrapper for a subprogram (e.g. a > function). > class DISubprogram : public DIGlobal { > public: > - explicit DISubprogram(GlobalVariable *GV = 0) > - : DIGlobal(GV, dwarf::DW_TAG_subprogram) {} > + explicit DISubprogram(MDNode *N = 0) > + : DIGlobal(N, dwarf::DW_TAG_subprogram) {} > > DICompositeType getType() const { return > getFieldAs(8); } > > @@ -346,7 +349,7 @@ > DICompositeType DCT(getFieldAs(8)); > if (!DCT.isNull()) { > DIArray A = DCT.getTypeArray(); > - DIType T(A.getElement(0).getGV()); > + DIType T(A.getElement(0).getNode()); > return T.getName(F); > } > DIType T(getFieldAs(8)); > @@ -367,8 +370,8 @@ > /// DIGlobalVariable - This is a wrapper for a global variable. > class DIGlobalVariable : public DIGlobal { > public: > - explicit DIGlobalVariable(GlobalVariable *GV = 0) > - : DIGlobal(GV, dwarf::DW_TAG_variable) {} > + explicit DIGlobalVariable(MDNode *N = 0) > + : DIGlobal(N, dwarf::DW_TAG_variable) {} > > GlobalVariable *getGlobal() const { return getGlobalVariableField > (11); } > > @@ -383,10 +386,10 @@ > /// global etc). > class DIVariable : public DIDescriptor { > public: > - explicit DIVariable(GlobalVariable *GV = 0) > - : DIDescriptor(GV) { > - if (GV && !isVariable(getTag())) > - DbgGV = 0; > + explicit DIVariable(MDNode *N = 0) > + : DIDescriptor(N) { > + if (DbgNode && !isVariable(getTag())) > + DbgNode = 0; > } > > DIDescriptor getContext() const { return getDescriptorField(1); } > @@ -410,8 +413,8 @@ > /// DIBlock - This is a wrapper for a block (e.g. a function, > scope, etc). > class DIBlock : public DIDescriptor { > public: > - explicit DIBlock(GlobalVariable *GV = 0) > - : DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {} > + explicit DIBlock(MDNode *N = 0) > + : DIDescriptor(N, dwarf::DW_TAG_lexical_block) {} > > DIDescriptor getContext() const { return getDescriptorField(1); } > }; > @@ -538,10 +541,6 @@ > > private: > Constant *GetTagConstant(unsigned TAG); > - Constant *GetStringConstant(const std::string &String); > - > - /// getCastToEmpty - Return the descriptor as a Constant* with > type '{}*'. > - Constant *getCastToEmpty(DIDescriptor D); > }; > > /// Finds the stoppoint coressponding to this instruction, that is > the > @@ -603,7 +602,6 @@ > > /// isInlinedFnEnd - Return true if REI is ending an inlined > function. > bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function > *CurrentFn); > - > /// DebugInfoFinder - This object collects DebugInfo from a module. > class DebugInfoFinder { > > @@ -647,7 +645,7 @@ > bool addType(DIType DT); > > public: > - typedef SmallVector::iterator iterator; > + typedef SmallVector::iterator iterator; > iterator compile_unit_begin() { return CUs.begin(); } > iterator compile_unit_end() { return CUs.end(); } > iterator subprogram_begin() { return SPs.begin(); } > @@ -663,12 +661,11 @@ > unsigned type_count() { return TYs.size(); } > > private: > - SmallVector CUs; // Compile Units > - SmallVector SPs; // Subprograms > - SmallVector GVs; // Global Variables > - SmallVector TYs; // Types > - SmallPtrSet NodesSeen; > - > + SmallVector CUs; // Compile Units > + SmallVector SPs; // Subprograms > + SmallVector GVs; // Global Variables; > + SmallVector TYs; // Types > + SmallPtrSet NodesSeen; > }; > } // end namespace llvm > > > Modified: llvm/trunk/include/llvm/AutoUpgrade.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/AutoUpgrade.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/AutoUpgrade.h (original) > +++ llvm/trunk/include/llvm/AutoUpgrade.h Tue Aug 25 00:24:07 2009 > @@ -15,6 +15,7 @@ > #define LLVM_AUTOUPGRADE_H > > namespace llvm { > + class Module; > class Function; > class CallInst; > > @@ -34,6 +35,9 @@ > /// so that it can update all calls to the old function. > void UpgradeCallsToIntrinsic(Function* F); > > + /// This function checks debug info intrinsics. If an intrinsic > is invalid > + /// then this function simply removes the intrinsic. > + void CheckDebugInfoIntrinsics(Module *M); > } // End llvm namespace > > #endif > > Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) > +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Tue Aug 25 > 00:24:07 2009 > @@ -33,7 +33,7 @@ > class MachineInstr; > class Value; > class Module; > -class GlobalVariable; > +class MDNode; > class MCAsmInfo; > class raw_ostream; > class Instruction; > @@ -88,17 +88,17 @@ > unsigned RecordSourceLine(unsigned Line, unsigned Col, > DICompileUnit CU); > > /// RecordRegionStart - Indicate the start of a region. > - unsigned RecordRegionStart(GlobalVariable *V); > + unsigned RecordRegionStart(MDNode *N); > > /// RecordRegionEnd - Indicate the end of a region. > - unsigned RecordRegionEnd(GlobalVariable *V); > + unsigned RecordRegionEnd(MDNode *N); > > /// getRecordSourceLineCount - Count source lines. > unsigned getRecordSourceLineCount(); > > /// RecordVariable - Indicate the declaration of a local variable. > /// > - void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); > + void RecordVariable(MDNode *N, unsigned FrameIndex); > > /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging > declarations should > /// be emitted. > > Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Tue Aug 25 > 00:24:07 2009 > @@ -327,7 +327,7 @@ > /// getOrCreateDebugLocID - Look up the DebugLocTuple index with > the given > /// source file, line, and column. If none currently exists, > create a new > /// DebugLocTuple, and insert it into the DebugIdMap. > - unsigned getOrCreateDebugLocID(GlobalVariable *CompileUnit, > + unsigned getOrCreateDebugLocID(MDNode *CompileUnit, > unsigned Line, unsigned Col); > > /// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc > object. > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Aug 25 > 00:24:07 2009 > @@ -322,7 +322,7 @@ > SDValue getValueType(EVT); > SDValue getRegister(unsigned Reg, EVT VT); > SDValue getDbgStopPoint(DebugLoc DL, SDValue Root, > - unsigned Line, unsigned Col, Value *CU); > + unsigned Line, unsigned Col, MDNode *CU); > SDValue getLabel(unsigned Opcode, DebugLoc dl, SDValue Root, > unsigned LabelID); > > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Aug 25 > 00:24:07 2009 > @@ -2015,10 +2015,10 @@ > SDUse Chain; > unsigned Line; > unsigned Column; > - Value *CU; > + MDNode *CU; > friend class SelectionDAG; > DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c, > - Value *cu) > + MDNode *cu) > : SDNode(ISD::DBG_STOPPOINT, DebugLoc::getUnknownLoc(), > getSDVTList(MVT::Other)), Line(l), Column(c), CU(cu) { > InitOperands(&Chain, ch); > @@ -2026,7 +2026,7 @@ > public: > unsigned getLine() const { return Line; } > unsigned getColumn() const { return Column; } > - Value *getCompileUnit() const { return CU; } > + MDNode *getCompileUnit() const { return CU; } > > static bool classof(const DbgStopPointSDNode *) { return true; } > static bool classof(const SDNode *N) { > > Modified: llvm/trunk/include/llvm/IntrinsicInst.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicInst.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/IntrinsicInst.h (original) > +++ llvm/trunk/include/llvm/IntrinsicInst.h Tue Aug 25 00:24:07 2009 > @@ -25,6 +25,7 @@ > #define LLVM_INTRINSICINST_H > > #include "llvm/Constants.h" > +#include "llvm/Metadata.h" > #include "llvm/Function.h" > #include "llvm/Instructions.h" > #include "llvm/Intrinsics.h" > @@ -85,8 +86,8 @@ > struct DbgStopPointInst : public DbgInfoIntrinsic { > Value *getLineValue() const { return const_cast > (getOperand(1)); } > Value *getColumnValue() const { return const_cast > (getOperand(2)); } > - Value *getContext() const { > - return StripCast(getOperand(3)); > + MDNode *getContext() const { > + return cast(getOperand(3)); > } > > unsigned getLine() const { > @@ -112,7 +113,7 @@ > /// DbgFuncStartInst - This represents the llvm.dbg.func.start > instruction. > /// > struct DbgFuncStartInst : public DbgInfoIntrinsic { > - Value *getSubprogram() const { return StripCast(getOperand(1)); } > + MDNode *getSubprogram() const { return cast(getOperand > (1)); } > > // Methods for support type inquiry through isa, cast, and > dyn_cast: > static inline bool classof(const DbgFuncStartInst *) { return > true; } > @@ -127,7 +128,7 @@ > /// DbgRegionStartInst - This represents the llvm.dbg.region.start > /// instruction. > struct DbgRegionStartInst : public DbgInfoIntrinsic { > - Value *getContext() const { return StripCast(getOperand(1)); } > + MDNode *getContext() const { return cast(getOperand > (1)); } > > // Methods for support type inquiry through isa, cast, and > dyn_cast: > static inline bool classof(const DbgRegionStartInst *) { return > true; } > @@ -142,7 +143,7 @@ > /// DbgRegionEndInst - This represents the llvm.dbg.region.end > instruction. > /// > struct DbgRegionEndInst : public DbgInfoIntrinsic { > - Value *getContext() const { return StripCast(getOperand(1)); } > + MDNode *getContext() const { return cast(getOperand > (1)); } > > // Methods for support type inquiry through isa, cast, and > dyn_cast: > static inline bool classof(const DbgRegionEndInst *) { return > true; } > @@ -158,7 +159,7 @@ > /// > struct DbgDeclareInst : public DbgInfoIntrinsic { > Value *getAddress() const { return getOperand(1); } > - Value *getVariable() const { return StripCast(getOperand(2)); } > + MDNode *getVariable() const { return cast(getOperand > (2)); } > > // Methods for support type inquiry through isa, cast, and > dyn_cast: > static inline bool classof(const DbgDeclareInst *) { return > true; } > > Modified: llvm/trunk/include/llvm/Intrinsics.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Intrinsics.td (original) > +++ llvm/trunk/include/llvm/Intrinsics.td Tue Aug 25 00:24:07 2009 > @@ -110,6 +110,7 @@ > def llvm_anyptr_ty : LLVMAnyPointerType; // > (space)i8* > def llvm_empty_ty : LLVMType; // > { } > def llvm_descriptor_ty : LLVMPointerType; // > { }* > +def llvm_metadata_ty : > LLVMType; // !{...} > > def llvm_v2i8_ty : LLVMType; // 2 x i8 > def llvm_v4i8_ty : LLVMType; // 4 x i8 > @@ -278,12 +279,12 @@ > let Properties = [IntrNoMem] in { > def int_dbg_stoppoint : Intrinsic<[llvm_void_ty], > [llvm_i32_ty, llvm_i32_ty, > - llvm_descriptor_ty]>; > - def int_dbg_region_start : Intrinsic<[llvm_void_ty], > [llvm_descriptor_ty]>; > - def int_dbg_region_end : Intrinsic<[llvm_void_ty], > [llvm_descriptor_ty]>; > - def int_dbg_func_start : Intrinsic<[llvm_void_ty], > [llvm_descriptor_ty]>; > + llvm_metadata_ty]>; > + def int_dbg_region_start : Intrinsic<[llvm_void_ty], > [llvm_metadata_ty]>; > + def int_dbg_region_end : Intrinsic<[llvm_void_ty], > [llvm_metadata_ty]>; > + def int_dbg_func_start : Intrinsic<[llvm_void_ty], > [llvm_metadata_ty]>; > def int_dbg_declare : Intrinsic<[llvm_void_ty], > - [llvm_descriptor_ty, > llvm_descriptor_ty]>; > + [llvm_descriptor_ty, > llvm_metadata_ty]>; > } > > //===------------------ Exception Handling > Intrinsics----------------------===// > > Modified: llvm/trunk/include/llvm/Metadata.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Metadata.h (original) > +++ llvm/trunk/include/llvm/Metadata.h Tue Aug 25 00:24:07 2009 > @@ -110,7 +110,6 @@ > unsigned getNumOperands() { return User::getNumOperands(); } > > SmallVector Node; > - > friend struct ConstantCreator >; > protected: > explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned > NumVals); > > Modified: llvm/trunk/include/llvm/Support/DebugLoc.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/DebugLoc.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Support/DebugLoc.h (original) > +++ llvm/trunk/include/llvm/Support/DebugLoc.h Tue Aug 25 00:24:07 > 2009 > @@ -19,19 +19,19 @@ > #include > > namespace llvm { > - class GlobalVariable; > + class MDNode; > > /// DebugLocTuple - Debug location tuple of filename id, line and > column. > /// > struct DebugLocTuple { > - GlobalVariable *CompileUnit; > + MDNode *CompileUnit; > unsigned Line, Col; > > DebugLocTuple() > : CompileUnit(0), Line(~0U), Col(~0U) {}; > > - DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c) > - : CompileUnit(v), Line(l), Col(c) {}; > + DebugLocTuple(MDNode *n, unsigned l, unsigned c) > + : CompileUnit(n), Line(l), Col(c) {}; > > bool operator==(const DebugLocTuple &DLT) const { > return CompileUnit == DLT.CompileUnit && > @@ -69,10 +69,10 @@ > return DebugLocTuple(0, ~0U, ~0U); > } > static inline DebugLocTuple getTombstoneKey() { > - return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U); > + return DebugLocTuple((MDNode*)~1U, ~1U, ~1U); > } > static unsigned getHashValue(const DebugLocTuple &Val) { > - return DenseMapInfo::getHashValue > (Val.CompileUnit) ^ > + return DenseMapInfo::getHashValue(Val.CompileUnit) ^ > DenseMapInfo::getHashValue(Val.Line) ^ > DenseMapInfo::getHashValue(Val.Col); > } > > Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) > +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Tue Aug 25 00:24:07 > 2009 > @@ -90,7 +90,7 @@ > } > > void PrintDbgInfo::printFuncStart(const DbgFuncStartInst *FS) { > - DISubprogram Subprogram(cast(FS->getSubprogram())); > + DISubprogram Subprogram(FS->getSubprogram()); > std::string Res1, Res2; > Out << "; fully qualified function name: " << > Subprogram.getDisplayName(Res1) > << " return type: " << Subprogram.getReturnTypeName(Res2) > > Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) > +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Aug 25 00:24:07 2009 > @@ -21,6 +21,7 @@ > #include "llvm/LLVMContext.h" > #include "llvm/Module.h" > #include "llvm/Analysis/ValueTracking.h" > +#include "llvm/ADT/SmallPtrSet.h" > #include "llvm/Support/Dwarf.h" > #include "llvm/Support/DebugLoc.h" > #include "llvm/Support/raw_ostream.h" > @@ -32,18 +33,12 @@ > // > = > = > = > ----------------------------------------------------------------------= > ==// > > /// ValidDebugInfo - Return true if V represents valid debug info > value. > -bool DIDescriptor::ValidDebugInfo(Value *V, CodeGenOpt::Level > OptLevel) { > - if (!V) > +/// FIXME : Add DIDescriptor.isValid() > +bool DIDescriptor::ValidDebugInfo(MDNode *N, CodeGenOpt::Level > OptLevel) { > + if (!N) > return false; > > - GlobalVariable *GV = dyn_cast(V->stripPointerCasts > ()); > - if (!GV) > - return false; > - > - if (!GV->hasInternalLinkage () && !GV->hasLinkOnceLinkage()) > - return false; > - > - DIDescriptor DI(GV); > + DIDescriptor DI(N); > > // Check current version. Allow Version6 for now. > unsigned Version = DI.getVersion(); > @@ -53,13 +48,13 @@ > unsigned Tag = DI.getTag(); > switch (Tag) { > case DW_TAG_variable: > - assert(DIVariable(GV).Verify() && "Invalid DebugInfo value"); > + assert(DIVariable(N).Verify() && "Invalid DebugInfo value"); > break; > case DW_TAG_compile_unit: > - assert(DICompileUnit(GV).Verify() && "Invalid DebugInfo value"); > + assert(DICompileUnit(N).Verify() && "Invalid DebugInfo value"); > break; > case DW_TAG_subprogram: > - assert(DISubprogram(GV).Verify() && "Invalid DebugInfo value"); > + assert(DISubprogram(N).Verify() && "Invalid DebugInfo value"); > break; > case DW_TAG_lexical_block: > // FIXME: This interfers with the quality of generated code during > @@ -74,67 +69,58 @@ > return true; > } > > -DIDescriptor::DIDescriptor(GlobalVariable *GV, unsigned > RequiredTag) { > - DbgGV = GV; > +DIDescriptor::DIDescriptor(MDNode *N, unsigned RequiredTag) { > + DbgNode = N; > > // If this is non-null, check to see if the Tag matches. If not, > set to null. > - if (GV && getTag() != RequiredTag) > - DbgGV = 0; > + if (N && getTag() != RequiredTag) { > + DbgNode = 0; > + } > } > > const std::string & > DIDescriptor::getStringField(unsigned Elt, std::string &Result) > const { > - if (DbgGV == 0) { > - Result.clear(); > + Result.clear(); > + if (DbgNode == 0) > return Result; > - } > - > - Constant *C = DbgGV->getInitializer(); > - if (C == 0 || Elt >= C->getNumOperands()) { > - Result.clear(); > - return Result; > - } > - > - // Fills in the string if it succeeds > - if (!GetConstantStringInfo(C->getOperand(Elt), Result)) > - Result.clear(); > > + if (Elt < DbgNode->getNumElements()) > + if (MDString *MDS = dyn_cast_or_null(DbgNode- > >getElement(Elt))) { > + Result.assign(MDS->begin(), MDS->begin() + MDS->length()); > + return Result; > + } > + > return Result; > } > > uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const { > - if (DbgGV == 0) return 0; > - if (!DbgGV->hasInitializer()) return 0; > - > - Constant *C = DbgGV->getInitializer(); > - if (C == 0 || Elt >= C->getNumOperands()) > + if (DbgNode == 0) > return 0; > > - if (ConstantInt *CI = dyn_cast(C->getOperand(Elt))) > - return CI->getZExtValue(); > + if (Elt < DbgNode->getNumElements()) > + if (ConstantInt *CI = dyn_cast(DbgNode->getElement > (Elt))) > + return CI->getZExtValue(); > + > return 0; > } > > DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { > - if (DbgGV == 0) return DIDescriptor(); > - > - Constant *C = DbgGV->getInitializer(); > - if (C == 0 || Elt >= C->getNumOperands()) > + if (DbgNode == 0) > return DIDescriptor(); > > - C = C->getOperand(Elt); > - return DIDescriptor(dyn_cast(C->stripPointerCasts > ())); > + if (Elt < DbgNode->getNumElements() && DbgNode->getElement(Elt)) > + return DIDescriptor(dyn_cast(DbgNode->getElement(Elt))); > + > + return DIDescriptor(); > } > > GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) > const { > - if (DbgGV == 0) return 0; > - > - Constant *C = DbgGV->getInitializer(); > - if (C == 0 || Elt >= C->getNumOperands()) > + if (DbgNode == 0) > return 0; > > - C = C->getOperand(Elt); > - return dyn_cast(C->stripPointerCasts()); > + if (Elt < DbgNode->getNumElements()) > + return dyn_cast(DbgNode->getElement(Elt)); > + return 0; > } > > // > = > = > = > ----------------------------------------------------------------------= > ==// > @@ -142,12 +128,13 @@ > // > = > = > = > ----------------------------------------------------------------------= > ==// > > // Needed by DIVariable::getType(). > -DIType::DIType(GlobalVariable *GV) : DIDescriptor(GV) { > - if (!GV) return; > +DIType::DIType(MDNode *N) : DIDescriptor(N) { > + if (!N) return; > unsigned tag = getTag(); > if (tag != dwarf::DW_TAG_base_type && !DIDerivedType::isDerivedType > (tag) && > - !DICompositeType::isCompositeType(tag)) > - DbgGV = 0; > + !DICompositeType::isCompositeType(tag)) { > + DbgNode = 0; > + } > } > > /// isDerivedType - Return true if the specified tag is legal for > @@ -164,9 +151,8 @@ > case dwarf::DW_TAG_inheritance: > return true; > default: > - // FIXME: Even though it doesn't make sense, CompositeTypes are > current > - // modelled as DerivedTypes, this should return true for them > as well. > - return false; > + // CompositeTypes are currently modelled as DerivedTypes. > + return isCompositeType(Tag); > } > } > > @@ -200,10 +186,8 @@ > } > > unsigned DIArray::getNumElements() const { > - assert (DbgGV && "Invalid DIArray"); > - Constant *C = DbgGV->getInitializer(); > - assert (C && "Invalid DIArray initializer"); > - return C->getNumOperands(); > + assert (DbgNode && "Invalid DIArray"); > + return DbgNode->getNumElements(); > } > > /// replaceAllUsesWith - Replace all uses of debug info referenced by > @@ -214,8 +198,8 @@ > return; > > assert (!D.isNull() && "Can not replace with null"); > - getGV()->replaceAllUsesWith(D.getGV()); > - getGV()->eraseFromParent(); > + DbgNode->replaceAllUsesWith(D.getNode()); > + delete DbgNode; > } > > /// Verify - Verify that a compile unit is well formed. > @@ -341,8 +325,8 @@ > > /// dump - Print descriptor. > void DIDescriptor::dump() const { > - errs() << "[" << dwarf::TagString(getTag()) << "] [GV:"; > - errs().write_hex((intptr_t)DbgGV) << ']'; > + errs() << "[" << dwarf::TagString(getTag()) << "] "; > + errs().write_hex((intptr_t)DbgNode) << ']'; > } > > /// dump - Print compile unit. > @@ -383,11 +367,11 @@ > errs() << " [fwd] "; > > if (isBasicType(Tag)) > - DIBasicType(DbgGV).dump(); > + DIBasicType(DbgNode).dump(); > else if (isDerivedType(Tag)) > - DIDerivedType(DbgGV).dump(); > + DIDerivedType(DbgNode).dump(); > else if (isCompositeType(Tag)) > - DICompositeType(DbgGV).dump(); > + DICompositeType(DbgNode).dump(); > else { > errs() << "Invalid DIType\n"; > return; > @@ -434,7 +418,7 @@ > errs() << " [def] "; > > if (isGlobalVariable(Tag)) > - DIGlobalVariable(DbgGV).dump(); > + DIGlobalVariable(DbgNode).dump(); > > errs() << "\n"; > } > @@ -474,43 +458,12 @@ > EmptyStructPtr = PointerType::getUnqual(StructType::get(VMContext)); > } > > -/// getCastToEmpty - Return this descriptor as a Constant* with > type '{}*'. > -/// This is only valid when the descriptor is non-null. > -Constant *DIFactory::getCastToEmpty(DIDescriptor D) { > - if (D.isNull()) return llvm::Constant::getNullValue > (EmptyStructPtr); > - return ConstantExpr::getBitCast(D.getGV(), EmptyStructPtr); > -} > - > Constant *DIFactory::GetTagConstant(unsigned TAG) { > assert((TAG & LLVMDebugVersionMask) == 0 && > "Tag too large for debug encoding!"); > return ConstantInt::get(Type::getInt32Ty(VMContext), TAG | > LLVMDebugVersion); > } > > -Constant *DIFactory::GetStringConstant(const std::string &String) { > - // Check string cache for previous edition. > - Constant *&Slot = StringCache[String]; > - > - // Return Constant if previously defined. > - if (Slot) return Slot; > - > - const PointerType *DestTy = PointerType::getUnqual(Type::getInt8Ty > (VMContext)); > - > - // If empty string then use a i8* null instead. > - if (String.empty()) > - return Slot = ConstantPointerNull::get(DestTy); > - > - // Construct string as an llvm constant. > - Constant *ConstStr = ConstantArray::get(VMContext, String); > - > - // Otherwise create and return a new string global. > - GlobalVariable *StrGV = new GlobalVariable(M, ConstStr->getType > (), true, > - > GlobalVariable::InternalLinkage, > - ConstStr, ".str"); > - StrGV->setSection("llvm.metadata"); > - return Slot = ConstantExpr::getBitCast(StrGV, DestTy); > -} > - > // > = > = > = > ----------------------------------------------------------------------= > ==// > // DIFactory: Primary Constructors > // > = > = > = > ----------------------------------------------------------------------= > ==// > @@ -518,50 +471,27 @@ > /// GetOrCreateArray - Create an descriptor for an array of > descriptors. > /// This implicitly uniques the arrays created. > DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned > NumTys) { > - SmallVector Elts; > + SmallVector Elts; > > - for (unsigned i = 0; i != NumTys; ++i) > - Elts.push_back(getCastToEmpty(Tys[i])); > + if (NumTys == 0) > + Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty > (VMContext))); > + else > + for (unsigned i = 0; i != NumTys; ++i) > + Elts.push_back(Tys[i].getNode()); > > - Constant *Init = ConstantArray::get(ArrayType::get(EmptyStructPtr, > - Elts.size()), > - Elts.data(), Elts.size()); > - // If we already have this array, just return the uniqued version. > - DIDescriptor &Entry = SimpleConstantCache[Init]; > - if (!Entry.isNull()) return DIArray(Entry.getGV()); > - > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, "llvm.dbg.array"); > - GV->setSection("llvm.metadata"); > - Entry = DIDescriptor(GV); > - return DIArray(GV); > + return DIArray(MDNode::get(VMContext,Elts.data(), Elts.size())); > } > > /// GetOrCreateSubrange - Create a descriptor for a value range. This > /// implicitly uniques the values returned. > DISubrange DIFactory::GetOrCreateSubrange(int64_t Lo, int64_t Hi) { > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(dwarf::DW_TAG_subrange_type), > ConstantInt::get(Type::getInt64Ty(VMContext), Lo), > ConstantInt::get(Type::getInt64Ty(VMContext), Hi) > }; > > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - // If we already have this range, just return the uniqued version. > - DIDescriptor &Entry = SimpleConstantCache[Init]; > - if (!Entry.isNull()) return DISubrange(Entry.getGV()); > - > - M.addTypeName("llvm.dbg.subrange.type", Init->getType()); > - > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, "llvm.dbg.subrange"); > - GV->setSection("llvm.metadata"); > - Entry = DIDescriptor(GV); > - return DISubrange(GV); > + return DISubrange(MDNode::get(VMContext, &Elts[0], 3)); > } > > > @@ -576,47 +506,31 @@ > bool isOptimized, > const char *Flags, > unsigned RunTimeVer) { > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(dwarf::DW_TAG_compile_unit), > - llvm::Constant::getNullValue(EmptyStructPtr), > + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), > ConstantInt::get(Type::getInt32Ty(VMContext), LangID), > - GetStringConstant(Filename), > - GetStringConstant(Directory), > - GetStringConstant(Producer), > + MDString::get(VMContext, Filename), > + MDString::get(VMContext, Directory), > + MDString::get(VMContext, Producer), > ConstantInt::get(Type::getInt1Ty(VMContext), isMain), > ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized), > - GetStringConstant(Flags), > + MDString::get(VMContext, Flags), > ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer) > }; > - > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.compile_unit.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, > "llvm.dbg.compile_unit"); > - GV->setSection("llvm.metadata"); > - return DICompileUnit(GV); > + > + return DICompileUnit(MDNode::get(VMContext, &Elts[0], 10)); > } > > /// CreateEnumerator - Create a single enumerator value. > DIEnumerator DIFactory::CreateEnumerator(const std::string &Name, > uint64_t Val){ > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(dwarf::DW_TAG_enumerator), > - GetStringConstant(Name), > + MDString::get(VMContext, Name), > ConstantInt::get(Type::getInt64Ty(VMContext), Val) > }; > - > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.enumerator.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, > "llvm.dbg.enumerator"); > - GV->setSection("llvm.metadata"); > - return DIEnumerator(GV); > + > + return DIEnumerator(MDNode::get(VMContext, &Elts[0], 3)); > } > > > @@ -629,11 +543,11 @@ > uint64_t AlignInBits, > uint64_t OffsetInBits, > unsigned Flags, > unsigned Encoding) { > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(dwarf::DW_TAG_base_type), > - getCastToEmpty(Context), > - GetStringConstant(Name), > - getCastToEmpty(CompileUnit), > + Context.getNode(), > + MDString::get(VMContext, Name), > + CompileUnit.getNode(), > ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), > ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), > ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), > @@ -642,15 +556,7 @@ > ConstantInt::get(Type::getInt32Ty(VMContext), Encoding) > }; > > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.basictype.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, > "llvm.dbg.basictype"); > - GV->setSection("llvm.metadata"); > - return DIBasicType(GV); > + return DIBasicType(MDNode::get(VMContext, &Elts[0], 10)); > } > > /// CreateDerivedType - Create a derived type like const qualified > type, > @@ -665,28 +571,20 @@ > uint64_t OffsetInBits, > unsigned Flags, > DIType DerivedFrom) { > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(Tag), > - getCastToEmpty(Context), > - GetStringConstant(Name), > - getCastToEmpty(CompileUnit), > + Context.getNode(), > + MDString::get(VMContext, Name), > + CompileUnit.getNode(), > ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), > ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), > ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), > ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits), > ConstantInt::get(Type::getInt32Ty(VMContext), Flags), > - getCastToEmpty(DerivedFrom) > + DerivedFrom.getNode(), > }; > - > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.derivedtype.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, > "llvm.dbg.derivedtype"); > - GV->setSection("llvm.metadata"); > - return DIDerivedType(GV); > + > + return DIDerivedType(MDNode::get(VMContext, &Elts[0], 10)); > } > > /// CreateCompositeType - Create a composite type like array, > struct, etc. > @@ -703,30 +601,22 @@ > DIArray Elements, > unsigned RuntimeLang) { > > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(Tag), > - getCastToEmpty(Context), > - GetStringConstant(Name), > - getCastToEmpty(CompileUnit), > + Context.getNode(), > + MDString::get(VMContext, Name), > + CompileUnit.getNode(), > ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), > ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), > ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), > ConstantInt::get(Type::getInt64Ty(VMContext), OffsetInBits), > ConstantInt::get(Type::getInt32Ty(VMContext), Flags), > - getCastToEmpty(DerivedFrom), > - getCastToEmpty(Elements), > + DerivedFrom.getNode(), > + Elements.getNode(), > ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang) > }; > - > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.composite.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, > "llvm.dbg.composite"); > - GV->setSection("llvm.metadata"); > - return DICompositeType(GV); > + > + return DICompositeType(MDNode::get(VMContext, &Elts[0], 12)); > } > > > @@ -742,29 +632,21 @@ > bool isLocalToUnit, > bool isDefinition) { > > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(dwarf::DW_TAG_subprogram), > - llvm::Constant::getNullValue(EmptyStructPtr), > - getCastToEmpty(Context), > - GetStringConstant(Name), > - GetStringConstant(DisplayName), > - GetStringConstant(LinkageName), > - getCastToEmpty(CompileUnit), > + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), > + Context.getNode(), > + MDString::get(VMContext, Name), > + MDString::get(VMContext, DisplayName), > + MDString::get(VMContext, LinkageName), > + CompileUnit.getNode(), > ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), > - getCastToEmpty(Type), > + Type.getNode(), > ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), > ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition) > }; > > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.subprogram.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, > "llvm.dbg.subprogram"); > - GV->setSection("llvm.metadata"); > - return DISubprogram(GV); > + return DISubprogram(MDNode::get(VMContext, &Elts[0], 11)); > } > > /// CreateGlobalVariable - Create a new descriptor for the specified > global. > @@ -775,30 +657,29 @@ > DICompileUnit CompileUnit, > unsigned LineNo, DIType Type,bool > isLocalToUnit, > bool isDefinition, > llvm::GlobalVariable *Val) { > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(dwarf::DW_TAG_variable), > - llvm::Constant::getNullValue(EmptyStructPtr), > - getCastToEmpty(Context), > - GetStringConstant(Name), > - GetStringConstant(DisplayName), > - GetStringConstant(LinkageName), > - getCastToEmpty(CompileUnit), > + llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), > + Context.getNode(), > + MDString::get(VMContext, Name), > + MDString::get(VMContext, DisplayName), > + MDString::get(VMContext, LinkageName), > + CompileUnit.getNode(), > ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), > - getCastToEmpty(Type), > + Type.getNode(), > ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), > ConstantInt::get(Type::getInt1Ty(VMContext), isDefinition), > - ConstantExpr::getBitCast(Val, EmptyStructPtr) > + Val > }; > - > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.global_variable.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::LinkOnceAnyLinkage, > - Init, > "llvm.dbg.global_variable"); > - GV->setSection("llvm.metadata"); > - return DIGlobalVariable(GV); > + > + Value *const *Vs = &Elts[0]; > + MDNode *Node = MDNode::get(VMContext,Vs, 12); > + > + // Create a named metadata so that we do not lose this mdnode. > + NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv"); > + NMD->addElement(Node); > + > + return DIGlobalVariable(Node); > } > > > @@ -807,44 +688,28 @@ > const std::string &Name, > DICompileUnit CompileUnit, > unsigned LineNo, > DIType Type) { > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(Tag), > - getCastToEmpty(Context), > - GetStringConstant(Name), > - getCastToEmpty(CompileUnit), > + Context.getNode(), > + MDString::get(VMContext, Name), > + CompileUnit.getNode(), > ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), > - getCastToEmpty(Type) > + Type.getNode(), > }; > > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.variable.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, "llvm.dbg.variable"); > - GV->setSection("llvm.metadata"); > - return DIVariable(GV); > + return DIVariable(MDNode::get(VMContext, &Elts[0], 6)); > } > > > /// CreateBlock - This creates a descriptor for a lexical block with > the > /// specified parent VMContext. > DIBlock DIFactory::CreateBlock(DIDescriptor Context) { > - Constant *Elts[] = { > + Value *Elts[] = { > GetTagConstant(dwarf::DW_TAG_lexical_block), > - getCastToEmpty(Context) > + Context.getNode() > }; > - > - Constant *Init = ConstantStruct::get(VMContext, Elts, > - sizeof(Elts)/sizeof(Elts[0])); > - > - M.addTypeName("llvm.dbg.block.type", Init->getType()); > - GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true, > - > GlobalValue::InternalLinkage, > - Init, "llvm.dbg.block"); > - GV->setSection("llvm.metadata"); > - return DIBlock(GV); > + > + return DIBlock(MDNode::get(VMContext, &Elts[0], 2)); > } > > > @@ -866,7 +731,7 @@ > Value *Args[] = { > ConstantInt::get(llvm::Type::getInt32Ty(VMContext), LineNo), > ConstantInt::get(llvm::Type::getInt32Ty(VMContext), ColNo), > - getCastToEmpty(CU) > + CU.getNode() > }; > CallInst::Create(StopPointFn, Args, Args+3, "", BB); > } > @@ -879,7 +744,7 @@ > FuncStartFn = Intrinsic::getDeclaration(&M, > Intrinsic::dbg_func_start); > > // Call llvm.dbg.func.start which also implicitly sets a stoppoint. > - CallInst::Create(FuncStartFn, getCastToEmpty(SP), "", BB); > + CallInst::Create(FuncStartFn, SP.getNode(), "", BB); > } > > /// InsertRegionStart - Insert a new llvm.dbg.region.start intrinsic > call to > @@ -890,7 +755,7 @@ > RegionStartFn = Intrinsic::getDeclaration(&M, > Intrinsic::dbg_region_start); > > // Call llvm.dbg.func.start. > - CallInst::Create(RegionStartFn, getCastToEmpty(D), "", BB); > + CallInst::Create(RegionStartFn, D.getNode(), "", BB); > } > > /// InsertRegionEnd - Insert a new llvm.dbg.region.end intrinsic > call to > @@ -901,7 +766,7 @@ > RegionEndFn = Intrinsic::getDeclaration(&M, > Intrinsic::dbg_region_end); > > // Call llvm.dbg.region.end. > - CallInst::Create(RegionEndFn, getCastToEmpty(D), "", BB); > + CallInst::Create(RegionEndFn, D.getNode(), "", BB); > } > > /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. > @@ -912,17 +777,19 @@ > if (!DeclareFn) > DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); > > - Value *Args[] = { Storage, getCastToEmpty(D) }; > + Value *Args[] = { Storage, D.getNode() }; > CallInst::Create(DeclareFn, Args, Args+2, "", BB); > } > > + > // > = > = > = > ----------------------------------------------------------------------= > ==// > // DebugInfoFinder implementations. > // > = > = > = > ----------------------------------------------------------------------= > ==// > > /// processModule - Process entire module and collect debug info. > void DebugInfoFinder::processModule(Module &M) { > - > + > + > for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) > for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI ! > = FE; ++FI) > for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end > (); BI != BE; > @@ -938,15 +805,13 @@ > else if (DbgDeclareInst *DDI = dyn_cast(BI)) > processDeclare(DDI); > } > - > - for (Module::global_iterator GVI = M.global_begin(), GVE = > M.global_end(); > - GVI != GVE; ++GVI) { > - GlobalVariable *GV = GVI; > - if (!GV->hasName() || !GV->isConstant() > - || strncmp(GV->getName().data(), > "llvm.dbg.global_variable", 24) > - || !GV->hasInitializer()) > - continue; > - DIGlobalVariable DIG(GV); > + > + NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv"); > + if (!NMD) > + return; > + > + for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { > + DIGlobalVariable DIG(cast(NMD->getElement(i))); > if (addGlobalVariable(DIG)) { > addCompileUnit(DIG.getCompileUnit()); > processType(DIG.getType()); > @@ -961,20 +826,20 @@ > > addCompileUnit(DT.getCompileUnit()); > if (DT.isCompositeType(DT.getTag())) { > - DICompositeType DCT(DT.getGV()); > + DICompositeType DCT(DT.getNode()); > processType(DCT.getTypeDerivedFrom()); > DIArray DA = DCT.getTypeArray(); > if (!DA.isNull()) > for (unsigned i = 0, e = DA.getNumElements(); i != e; ++i) { > DIDescriptor D = DA.getElement(i); > - DIType TypeE = DIType(D.getGV()); > + DIType TypeE = DIType(D.getNode()); > if (!TypeE.isNull()) > processType(TypeE); > else > - processSubprogram(DISubprogram(D.getGV())); > + processSubprogram(DISubprogram(D.getNode())); > } > } else if (DT.isDerivedType(DT.getTag())) { > - DIDerivedType DDT(DT.getGV()); > + DIDerivedType DDT(DT.getNode()); > if (!DDT.isNull()) > processType(DDT.getTypeDerivedFrom()); > } > @@ -992,35 +857,35 @@ > > /// processStopPoint - Process DbgStopPointInst. > void DebugInfoFinder::processStopPoint(DbgStopPointInst *SPI) { > - GlobalVariable *Context = dyn_cast(SPI->getContext > ()); > + MDNode *Context = dyn_cast(SPI->getContext()); > addCompileUnit(DICompileUnit(Context)); > } > > /// processFuncStart - Process DbgFuncStartInst. > void DebugInfoFinder::processFuncStart(DbgFuncStartInst *FSI) { > - GlobalVariable *SP = dyn_cast(FSI->getSubprogram > ()); > + MDNode *SP = dyn_cast(FSI->getSubprogram()); > processSubprogram(DISubprogram(SP)); > } > > /// processRegionStart - Process DbgRegionStart. > void DebugInfoFinder::processRegionStart(DbgRegionStartInst *DRS) { > - GlobalVariable *SP = dyn_cast(DRS->getContext()); > + MDNode *SP = dyn_cast(DRS->getContext()); > processSubprogram(DISubprogram(SP)); > } > > /// processRegionEnd - Process DbgRegionEnd. > void DebugInfoFinder::processRegionEnd(DbgRegionEndInst *DRE) { > - GlobalVariable *SP = dyn_cast(DRE->getContext()); > + MDNode *SP = dyn_cast(DRE->getContext()); > processSubprogram(DISubprogram(SP)); > } > > /// processDeclare - Process DbgDeclareInst. > void DebugInfoFinder::processDeclare(DbgDeclareInst *DDI) { > - DIVariable DV(cast(DDI->getVariable())); > + DIVariable DV(cast(DDI->getVariable())); > if (DV.isNull()) > return; > > - if (!NodesSeen.insert(DV.getGV())) > + if (!NodesSeen.insert(DV.getNode())) > return; > > addCompileUnit(DV.getCompileUnit()); > @@ -1032,10 +897,10 @@ > if (DT.isNull()) > return false; > > - if (!NodesSeen.insert(DT.getGV())) > + if (!NodesSeen.insert(DT.getNode())) > return false; > > - TYs.push_back(DT.getGV()); > + TYs.push_back(DT.getNode()); > return true; > } > > @@ -1044,10 +909,10 @@ > if (CU.isNull()) > return false; > > - if (!NodesSeen.insert(CU.getGV())) > + if (!NodesSeen.insert(CU.getNode())) > return false; > > - CUs.push_back(CU.getGV()); > + CUs.push_back(CU.getNode()); > return true; > } > > @@ -1056,10 +921,10 @@ > if (DIG.isNull()) > return false; > > - if (!NodesSeen.insert(DIG.getGV())) > + if (!NodesSeen.insert(DIG.getNode())) > return false; > > - GVs.push_back(DIG.getGV()); > + GVs.push_back(DIG.getNode()); > return true; > } > > @@ -1068,10 +933,10 @@ > if (SP.isNull()) > return false; > > - if (!NodesSeen.insert(SP.getGV())) > + if (!NodesSeen.insert(SP.getNode())) > return false; > > - SPs.push_back(SP.getGV()); > + SPs.push_back(SP.getNode()); > return true; > } > > @@ -1124,31 +989,17 @@ > > Value *findDbgGlobalDeclare(GlobalVariable *V) { > const Module *M = V->getParent(); > + NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.gv"); > + if (!NMD) > + return 0; > > - const Type *Ty = M->getTypeByName > ("llvm.dbg.global_variable.type"); > - if (!Ty) return 0; > - > - Ty = PointerType::get(Ty, 0); > - > - Value *Val = V->stripPointerCasts(); > - for (Value::use_iterator I = Val->use_begin(), E = Val->use_end > (); > - I != E; ++I) { > - if (ConstantExpr *CE = dyn_cast(I)) { > - if (CE->getOpcode() == Instruction::BitCast) { > - Value *VV = CE; > - > - while (VV->hasOneUse()) > - VV = *VV->use_begin(); > - > - if (VV->getType() == Ty) > - return VV; > - } > - } > + for (unsigned i = 0, e = NMD->getNumElements(); i != e; ++i) { > + DIGlobalVariable DIG(cast_or_null(NMD->getElement(i))); > + if (DIG.isNull()) > + continue; > + if (DIG.getGlobal() == V) > + return DIG.getNode(); > } > - > - if (Val->getType() == Ty) > - return Val; > - > return 0; > } > > @@ -1185,7 +1036,7 @@ > if (GlobalVariable *GV = dyn_cast > (const_cast(V))) { > Value *DIGV = findDbgGlobalDeclare(GV); > if (!DIGV) return false; > - DIGlobalVariable Var(cast(DIGV)); > + DIGlobalVariable Var(cast(DIGV)); > > Var.getDisplayName(DisplayName); > LineNo = Var.getLineNumber(); > @@ -1194,7 +1045,7 @@ > } else { > const DbgDeclareInst *DDI = findDbgDeclare(V); > if (!DDI) return false; > - DIVariable Var(cast(DDI->getVariable())); > + DIVariable Var(cast(DDI->getVariable())); > > Var.getName(DisplayName); > LineNo = Var.getLineNumber(); > @@ -1252,7 +1103,7 @@ > Value *Context = SPI.getContext(); > > // If this location is already tracked then use it. > - DebugLocTuple Tuple(cast(Context), SPI.getLine(), > + DebugLocTuple Tuple(cast(Context), SPI.getLine(), > SPI.getColumn()); > DenseMap::iterator II > = DebugLocInfo.DebugIdMap.find(Tuple); > @@ -1274,12 +1125,12 @@ > DebugLoc DL; > Value *SP = FSI.getSubprogram(); > > - DISubprogram Subprogram(cast(SP)); > + DISubprogram Subprogram(cast(SP)); > unsigned Line = Subprogram.getLineNumber(); > DICompileUnit CU(Subprogram.getCompileUnit()); > > // If this location is already tracked then use it. > - DebugLocTuple Tuple(CU.getGV(), Line, /* Column */ 0); > + DebugLocTuple Tuple(CU.getNode(), Line, /* Column */ 0); > DenseMap::iterator II > = DebugLocInfo.DebugIdMap.find(Tuple); > if (II != DebugLocInfo.DebugIdMap.end()) > @@ -1295,7 +1146,7 @@ > > /// isInlinedFnStart - Return true if FSI is starting an inlined > function. > bool isInlinedFnStart(DbgFuncStartInst &FSI, const Function > *CurrentFn) { > - DISubprogram Subprogram(cast(FSI.getSubprogram > ())); > + DISubprogram Subprogram(cast(FSI.getSubprogram())); > if (Subprogram.describes(CurrentFn)) > return false; > > @@ -1304,11 +1155,10 @@ > > /// isInlinedFnEnd - Return true if REI is ending an inlined > function. > bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function > *CurrentFn) { > - DISubprogram Subprogram(cast(REI.getContext())); > + DISubprogram Subprogram(cast(REI.getContext())); > if (Subprogram.isNull() || Subprogram.describes(CurrentFn)) > return false; > > return true; > } > - > } > > Modified: llvm/trunk/lib/AsmParser/LLParser.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) > +++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Aug 25 00:24:07 2009 > @@ -98,6 +98,8 @@ > for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ) > UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we > remove > > + // Check debug info intrinsics. > + CheckDebugInfoIntrinsics(M); > return false; > } > > > Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) > +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Aug 25 > 00:24:07 2009 > @@ -16,7 +16,7 @@ > #include "llvm/Constants.h" > #include "llvm/DerivedTypes.h" > #include "llvm/InlineAsm.h" > -#include "llvm/Instructions.h" > +#include "llvm/IntrinsicInst.h" > #include "llvm/LLVMContext.h" > #include "llvm/Metadata.h" > #include "llvm/Module.h" > @@ -2192,7 +2192,10 @@ > } > } > std::vector >().swap > (UpgradedIntrinsics); > - > + > + // Check debug info intrinsics. > + CheckDebugInfoIntrinsics(TheModule); > + > return TheModule; > } > > > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) > +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Aug 25 > 00:24:07 2009 > @@ -1739,11 +1739,10 @@ > // Print source line info. > O.PadToColumn(MAI->getCommentColumn()); > O << MAI->getCommentString() << " SrcLine "; > - if (DLT.CompileUnit->hasInitializer()) { > - Constant *Name = DLT.CompileUnit->getInitializer(); > - if (ConstantArray *NameString = dyn_cast(Name)) > - if (NameString->isString()) > - O << NameString->getAsString() << " "; > + if (DLT.CompileUnit) { > + std::string Str; > + DICompileUnit CU(DLT.CompileUnit); > + O << CU.getFilename(Str) << " "; > } > O << DLT.Line; > if (DLT.Col != 0) > @@ -1761,11 +1760,10 @@ > // Print source line info > O.PadToColumn(MAI->getCommentColumn()); > O << MAI->getCommentString() << " SrcLine "; > - if (DLT.CompileUnit->hasInitializer()) { > - Constant *Name = DLT.CompileUnit->getInitializer(); > - if (ConstantArray *NameString = dyn_cast(Name)) > - if (NameString->isString()) > - O << NameString->getAsString() << " "; > + if (DLT.CompileUnit) { > + std::string Str; > + DICompileUnit CU(DLT.CompileUnit); > + O << CU.getFilename(Str) << " "; > } > O << DLT.Line; > if (DLT.Col != 0) > > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Aug 25 > 00:24:07 2009 > @@ -10,7 +10,7 @@ > // This file contains support for writing dwarf debug info into asm > files. > // > // > = > = > = > ----------------------------------------------------------------------= > ==// > - > +#define DEBUG_TYPE "dwarfdebug" > #include "DwarfDebug.h" > #include "llvm/Module.h" > #include "llvm/CodeGen/MachineFunction.h" > @@ -24,6 +24,7 @@ > #include "llvm/Target/TargetRegisterInfo.h" > #include "llvm/ADT/StringExtras.h" > #include "llvm/Support/Timer.h" > +#include "llvm/Support/Debug.h" > #include "llvm/System/Path.h" > using namespace llvm; > > @@ -56,11 +57,13 @@ > > /// GVToDieMap - Tracks the mapping of unit level debug informaton > /// variables to debug information entries. > - std::map GVToDieMap; > + /// FIXME : Rename GVToDieMap -> NodeToDieMap > + std::map GVToDieMap; > > /// GVToDIEEntryMap - Tracks the mapping of unit level debug > informaton > /// descriptors to debug information entries using a DIEEntry proxy. > - std::map GVToDIEEntryMap; > + /// FIXME : Rename > + std::map GVToDIEEntryMap; > > /// Globals - A map of globally visible named entities for this > unit. > /// > @@ -89,12 +92,12 @@ > > /// getDieMapSlotFor - Returns the debug information entry map > slot for the > /// specified debug variable. > - DIE *&getDieMapSlotFor(GlobalVariable *GV) { return GVToDieMap > [GV]; } > + DIE *&getDieMapSlotFor(MDNode *N) { return GVToDieMap[N]; } > > /// getDIEEntrySlotFor - Returns the debug information entry proxy > slot for > /// the specified debug variable. > - DIEEntry *&getDIEEntrySlotFor(GlobalVariable *GV) { > - return GVToDIEEntryMap[GV]; > + DIEEntry *&getDIEEntrySlotFor(MDNode *N) { > + return GVToDIEEntryMap[N]; > } > > /// AddDie - Adds or interns the DIE to the compile unit. > @@ -239,7 +242,7 @@ > for (unsigned j = 0, M = Values.size(); j < M; ++j) > delete Values[j]; > > - for (DenseMap::iterator > + for (DenseMap::iterator > I = AbstractInstanceRootMap.begin(), > E = AbstractInstanceRootMap.end(); I != E;++I) > delete I->second; > @@ -531,7 +534,7 @@ > return; > > // Check for pre-existence. > - DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getGV()); > + DIEEntry *&Slot = DW_Unit->getDIEEntrySlotFor(Ty.getNode()); > > // If it exists then use the existing value. > if (Slot) { > @@ -545,19 +548,20 @@ > // Construct type. > DIE Buffer(dwarf::DW_TAG_base_type); > if (Ty.isBasicType(Ty.getTag())) > - ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getGV())); > - else if (Ty.isDerivedType(Ty.getTag())) > - ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getGV())); > + ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getNode())); > + else if (Ty.isCompositeType(Ty.getTag())) > + ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getNode())); > else { > - assert(Ty.isCompositeType(Ty.getTag()) && "Unknown kind of > DIType"); > - ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV())); > + assert(Ty.isDerivedType(Ty.getTag()) && "Unknown kind of > DIType"); > + ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getNode())); > + > } > > // Add debug information entry to entity and appropriate context. > DIE *Die = NULL; > DIDescriptor Context = Ty.getContext(); > if (!Context.isNull()) > - Die = DW_Unit->getDieMapSlotFor(Context.getGV()); > + Die = DW_Unit->getDieMapSlotFor(Context.getNode()); > > if (Die) { > DIE *Child = new DIE(Buffer); > @@ -642,7 +646,7 @@ > // Add enumerators to enumeration type. > for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { > DIE *ElemDie = NULL; > - DIEnumerator Enum(Elements.getElement(i).getGV()); > + DIEnumerator Enum(Elements.getElement(i).getNode()); > ElemDie = ConstructEnumTypeDIE(DW_Unit, &Enum); > Buffer.AddChild(ElemDie); > } > @@ -652,7 +656,7 @@ > // Add return type. > DIArray Elements = CTy.getTypeArray(); > DIDescriptor RTy = Elements.getElement(0); > - AddType(DW_Unit, &Buffer, DIType(RTy.getGV())); > + AddType(DW_Unit, &Buffer, DIType(RTy.getNode())); > > // Add prototype flag. > AddUInt(&Buffer, dwarf::DW_AT_prototyped, dwarf::DW_FORM_flag, 1); > @@ -661,7 +665,7 @@ > for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { > DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter); > DIDescriptor Ty = Elements.getElement(i); > - AddType(DW_Unit, Arg, DIType(Ty.getGV())); > + AddType(DW_Unit, Arg, DIType(Ty.getNode())); > Buffer.AddChild(Arg); > } > } > @@ -679,13 +683,15 @@ > // Add elements to structure type. > for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { > DIDescriptor Element = Elements.getElement(i); > + if (Element.isNull()) > + continue; > DIE *ElemDie = NULL; > if (Element.getTag() == dwarf::DW_TAG_subprogram) > ElemDie = CreateSubprogramDIE(DW_Unit, > - DISubprogram(Element.getGV())); > + DISubprogram(Element.getNode > ())); > else > ElemDie = CreateMemberDIE(DW_Unit, > - DIDerivedType(Element.getGV())); > + DIDerivedType(Element.getNode())); > Buffer.AddChild(ElemDie); > } > > @@ -765,7 +771,7 @@ > for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { > DIDescriptor Element = Elements.getElement(i); > if (Element.getTag() == dwarf::DW_TAG_subrange_type) > - ConstructSubrangeDIE(Buffer, DISubrange(Element.getGV()), > IndexTy); > + ConstructSubrangeDIE(Buffer, DISubrange(Element.getNode()), > IndexTy); > } > } > > @@ -892,7 +898,7 @@ > if (Args.isNull() || SPTag != dwarf::DW_TAG_subroutine_type) > AddType(DW_Unit, SPDie, SPTy); > else > - AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV())); > + AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getNode())); > } > > if (!SP.isDefinition()) { > @@ -903,7 +909,7 @@ > if (SPTag == dwarf::DW_TAG_subroutine_type) > for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { > DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter); > - AddType(DW_Unit, Arg, DIType(Args.getElement(i).getGV())); > + AddType(DW_Unit, Arg, DIType(Args.getElement(i).getNode())); > AddUInt(Arg, dwarf::DW_AT_artificial, dwarf::DW_FORM_flag, > 1); // ?? > SPDie->AddChild(Arg); > } > @@ -913,7 +919,7 @@ > AddUInt(SPDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1); > > // DW_TAG_inlined_subroutine may refer to this DIE. > - DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getGV()); > + DIE *&Slot = DW_Unit->getDieMapSlotFor(SP.getNode()); > Slot = SPDie; > return SPDie; > } > @@ -922,7 +928,7 @@ > /// > CompileUnit &DwarfDebug::FindCompileUnit(DICompileUnit Unit) const { > DenseMap::const_iterator I = > - CompileUnitMap.find(Unit.getGV()); > + CompileUnitMap.find(Unit.getNode()); > assert(I != CompileUnitMap.end() && "Missing compile unit."); > return *I->second; > } > @@ -975,26 +981,26 @@ > > /// getOrCreateScope - Returns the scope associated with the given > descriptor. > /// > -DbgScope *DwarfDebug::getOrCreateScope(GlobalVariable *V) { > - DbgScope *&Slot = DbgScopeMap[V]; > +DbgScope *DwarfDebug::getOrCreateScope(MDNode *N) { > + DbgScope *&Slot = DbgScopeMap[N]; > if (Slot) return Slot; > > DbgScope *Parent = NULL; > - DIBlock Block(V); > + DIBlock Block(N); > > // Don't create a new scope if we already created one for an > inlined function. > - DenseMap::iterator > - II = AbstractInstanceRootMap.find(V); > + DenseMap::iterator > + II = AbstractInstanceRootMap.find(N); > if (II != AbstractInstanceRootMap.end()) > return LexicalScopeStack.back(); > > if (!Block.isNull()) { > DIDescriptor ParentDesc = Block.getContext(); > Parent = > - ParentDesc.isNull() ? NULL : getOrCreateScope > (ParentDesc.getGV()); > + ParentDesc.isNull() ? NULL : getOrCreateScope > (ParentDesc.getNode()); > } > > - Slot = new DbgScope(Parent, DIDescriptor(V)); > + Slot = new DbgScope(Parent, DIDescriptor(N)); > > if (Parent) > Parent->AddScope(Slot); > @@ -1103,10 +1109,10 @@ > return; > > // Get the subprogram debug information entry. > - DISubprogram SPD(Desc.getGV()); > + DISubprogram SPD(Desc.getNode()); > > // Get the subprogram die. > - DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getGV()); > + DIE *SPDie = ModuleCU->getDieMapSlotFor(SPD.getNode()); > assert(SPDie && "Missing subprogram descriptor"); > > if (!AbstractScope) { > @@ -1179,8 +1185,8 @@ > return SrcId; > } > > -void DwarfDebug::ConstructCompileUnit(GlobalVariable *GV) { > - DICompileUnit DIUnit(GV); > +void DwarfDebug::ConstructCompileUnit(MDNode *N) { > + DICompileUnit DIUnit(N); > std::string Dir, FN, Prod; > unsigned ID = GetOrCreateSourceID(DIUnit.getDirectory(Dir), > DIUnit.getFilename(FN)); > @@ -1217,15 +1223,15 @@ > ModuleCU = Unit; > } > > - CompileUnitMap[DIUnit.getGV()] = Unit; > + CompileUnitMap[DIUnit.getNode()] = Unit; > CompileUnits.push_back(Unit); > } > > -void DwarfDebug::ConstructGlobalVariableDIE(GlobalVariable *GV) { > - DIGlobalVariable DI_GV(GV); > +void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) { > + DIGlobalVariable DI_GV(N); > > // Check for pre-existence. > - DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getGV()); > + DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getNode()); > if (Slot) > return; > > @@ -1251,11 +1257,11 @@ > return; > } > > -void DwarfDebug::ConstructSubprogram(GlobalVariable *GV) { > - DISubprogram SP(GV); > +void DwarfDebug::ConstructSubprogram(MDNode *N) { > + DISubprogram SP(N); > > // Check for pre-existence. > - DIE *&Slot = ModuleCU->getDieMapSlotFor(GV); > + DIE *&Slot = ModuleCU->getDieMapSlotFor(N); > if (Slot) > return; > > @@ -1538,6 +1544,9 @@ > /// correspondence to the source line list. > unsigned DwarfDebug::RecordSourceLine(unsigned Line, unsigned Col, > DICompileUnit CU) { > + if (!MMI) > + return 0; > + > if (TimePassesIsEnabled) > DebugTimer->startTimer(); > > @@ -1572,11 +1581,11 @@ > } > > /// RecordRegionStart - Indicate the start of a region. > -unsigned DwarfDebug::RecordRegionStart(GlobalVariable *V) { > +unsigned DwarfDebug::RecordRegionStart(MDNode *N) { > if (TimePassesIsEnabled) > DebugTimer->startTimer(); > > - DbgScope *Scope = getOrCreateScope(V); > + DbgScope *Scope = getOrCreateScope(N); > unsigned ID = MMI->NextLabelID(); > if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); > LexicalScopeStack.push_back(Scope); > @@ -1588,11 +1597,11 @@ > } > > /// RecordRegionEnd - Indicate the end of a region. > -unsigned DwarfDebug::RecordRegionEnd(GlobalVariable *V) { > +unsigned DwarfDebug::RecordRegionEnd(MDNode *N) { > if (TimePassesIsEnabled) > DebugTimer->startTimer(); > > - DbgScope *Scope = getOrCreateScope(V); > + DbgScope *Scope = getOrCreateScope(N); > unsigned ID = MMI->NextLabelID(); > Scope->setEndLabelID(ID); > // FIXME : region.end() may not be in the last basic block. > @@ -1609,41 +1618,36 @@ > } > > /// RecordVariable - Indicate the declaration of a local variable. > -void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned > FrameIndex) { > +void DwarfDebug::RecordVariable(MDNode *N, unsigned FrameIndex) { > if (TimePassesIsEnabled) > DebugTimer->startTimer(); > > - DIDescriptor Desc(GV); > + DIDescriptor Desc(N); > DbgScope *Scope = NULL; > bool InlinedFnVar = false; > > - if (Desc.getTag() == dwarf::DW_TAG_variable) { > - // GV is a global variable. > - DIGlobalVariable DG(GV); > - Scope = getOrCreateScope(DG.getContext().getGV()); > - } else { > + if (Desc.getTag() == dwarf::DW_TAG_variable) > + Scope = getOrCreateScope(DIGlobalVariable(N).getContext > ().getNode()); > + else { > bool InlinedVar = false; > - DIVariable DV(GV); > - GlobalVariable *V = DV.getContext().getGV(); > - DISubprogram SP(V); > + MDNode *Context = DIVariable(N).getContext().getNode(); > + DISubprogram SP(Context); > if (!SP.isNull()) { > // SP is inserted into DbgAbstractScopeMap when inlined function > // start was recorded by RecordInlineFnStart. > - DenseMap::iterator > - I = DbgAbstractScopeMap.find(SP.getGV()); > + DenseMap::iterator > + I = DbgAbstractScopeMap.find(SP.getNode()); > if (I != DbgAbstractScopeMap.end()) { > InlinedVar = true; > Scope = I->second; > } > } > - if (!InlinedVar) { > - // GV is a local variable. > - Scope = getOrCreateScope(V); > - } > + if (!InlinedVar) > + Scope = getOrCreateScope(Context); > } > > assert(Scope && "Unable to find the variable's scope"); > - DbgVariable *DV = new DbgVariable(DIVariable(GV), FrameIndex, > InlinedFnVar); > + DbgVariable *DV = new DbgVariable(DIVariable(N), FrameIndex, > InlinedFnVar); > Scope->AddVariable(DV); > > if (TimePassesIsEnabled) > @@ -1661,17 +1665,17 @@ > if (TimePassesIsEnabled) > DebugTimer->startTimer(); > > - GlobalVariable *GV = SP.getGV(); > - DenseMap::iterator > - II = AbstractInstanceRootMap.find(GV); > + MDNode *Node = SP.getNode(); > + DenseMap::iterator > + II = AbstractInstanceRootMap.find(Node); > > if (II == AbstractInstanceRootMap.end()) { > // Create an abstract instance entry for this inlined function > if it doesn't > // already exist. > - DbgScope *Scope = new DbgScope(NULL, DIDescriptor(GV)); > + DbgScope *Scope = new DbgScope(NULL, DIDescriptor(Node)); > > // Get the compile unit context. > - DIE *SPDie = ModuleCU->getDieMapSlotFor(GV); > + DIE *SPDie = ModuleCU->getDieMapSlotFor(Node); > if (!SPDie) > SPDie = CreateSubprogramDIE(ModuleCU, SP, false, true); > > @@ -1683,18 +1687,18 @@ > AddUInt(SPDie, dwarf::DW_AT_inline, 0, > dwarf::DW_INL_declared_not_inlined); > > // Keep track of the abstract scope for this function. > - DbgAbstractScopeMap[GV] = Scope; > + DbgAbstractScopeMap[Node] = Scope; > > - AbstractInstanceRootMap[GV] = Scope; > + AbstractInstanceRootMap[Node] = Scope; > AbstractInstanceRootList.push_back(Scope); > } > > // Create a concrete inlined instance for this inlined function. > - DbgConcreteScope *ConcreteScope = new DbgConcreteScope > (DIDescriptor(GV)); > + DbgConcreteScope *ConcreteScope = new DbgConcreteScope > (DIDescriptor(Node)); > DIE *ScopeDie = new DIE(dwarf::DW_TAG_inlined_subroutine); > ScopeDie->setAbstractCompileUnit(ModuleCU); > > - DIE *Origin = ModuleCU->getDieMapSlotFor(GV); > + DIE *Origin = ModuleCU->getDieMapSlotFor(Node); > AddDIEEntry(ScopeDie, dwarf::DW_AT_abstract_origin, > dwarf::DW_FORM_ref4, Origin); > AddUInt(ScopeDie, dwarf::DW_AT_call_file, 0, ModuleCU->getID()); > @@ -1708,20 +1712,20 @@ > LexicalScopeStack.back()->AddConcreteInst(ConcreteScope); > > // Keep track of the concrete scope that's inlined into this > function. > - DenseMap >::iterator > - SI = DbgConcreteScopeMap.find(GV); > + DenseMap >::iterator > + SI = DbgConcreteScopeMap.find(Node); > > if (SI == DbgConcreteScopeMap.end()) > - DbgConcreteScopeMap[GV].push_back(ConcreteScope); > + DbgConcreteScopeMap[Node].push_back(ConcreteScope); > else > SI->second.push_back(ConcreteScope); > > // Track the start label for this inlined function. > - DenseMap >::iterator > - I = InlineInfo.find(GV); > + DenseMap >::iterator > + I = InlineInfo.find(Node); > > if (I == InlineInfo.end()) > - InlineInfo[GV].push_back(LabelID); > + InlineInfo[Node].push_back(LabelID); > else > I->second.push_back(LabelID); > > @@ -1739,9 +1743,9 @@ > if (TimePassesIsEnabled) > DebugTimer->startTimer(); > > - GlobalVariable *GV = SP.getGV(); > - DenseMap >::iterator > - I = DbgConcreteScopeMap.find(GV); > + MDNode *Node = SP.getNode(); > + DenseMap >::iterator > + I = DbgConcreteScopeMap.find(Node); > > if (I == DbgConcreteScopeMap.end()) { > // FIXME: Can this situation actually happen? And if so, should > it? > @@ -2446,11 +2450,11 @@ > Asm->EmitInt16(dwarf::DWARF_VERSION); Asm->EOL("Dwarf Version"); > Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Address Size (in > bytes)"); > > - for (DenseMap > >::iterator > + for (DenseMap >::iterator > I = InlineInfo.begin(), E = InlineInfo.end(); I != E; ++I) { > - GlobalVariable *GV = I->first; > + MDNode *Node = I->first; > SmallVector &Labels = I->second; > - DISubprogram SP(GV); > + DISubprogram SP(Node); > std::string Name; > std::string LName; > > @@ -2476,7 +2480,7 @@ > > for (SmallVector::iterator LI = Labels.begin(), > LE = Labels.end(); LI != LE; ++LI) { > - DIE *SP = ModuleCU->getDieMapSlotFor(GV); > + DIE *SP = ModuleCU->getDieMapSlotFor(Node); > Asm->EmitInt32(SP->getOffset()); Asm->EOL("DIE offset"); > > if (TD->getPointerSize() == sizeof(int32_t)) > > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original) > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Aug 25 > 00:24:07 2009 > @@ -139,25 +139,25 @@ > DbgScope *FunctionDbgScope; > > /// DbgScopeMap - Tracks the scopes in the current function. > - DenseMap DbgScopeMap; > + DenseMap DbgScopeMap; > > /// DbgAbstractScopeMap - Tracks abstract instance scopes in the > current > /// function. > - DenseMap DbgAbstractScopeMap; > + DenseMap DbgAbstractScopeMap; > > /// DbgConcreteScopeMap - Tracks concrete instance scopes in the > current > /// function. > - DenseMap + DenseMap SmallVector > DbgConcreteScopeMap; > > /// InlineInfo - Keep track of inlined functions and their > location. This > /// information is used to populate debug_inlined section. > - DenseMap > InlineInfo; > + DenseMap > InlineInfo; > > /// AbstractInstanceRootMap - Map of abstract instance roots of > inlined > /// functions. These are subroutine entries that contain a > DW_AT_inline > /// attribute. > - DenseMap > AbstractInstanceRootMap; > + DenseMap AbstractInstanceRootMap; > > /// AbstractInstanceRootList - List of abstract instance roots of > inlined > /// functions. These are subroutine entries that contain a > DW_AT_inline > @@ -335,7 +335,7 @@ > > /// getOrCreateScope - Returns the scope associated with the given > descriptor. > /// > - DbgScope *getOrCreateScope(GlobalVariable *V); > + DbgScope *getOrCreateScope(MDNode *N); > > /// ConstructDbgScope - Construct the components of a scope. > /// > @@ -448,11 +448,11 @@ > unsigned GetOrCreateSourceID(const std::string &DirName, > const std::string &FileName); > > - void ConstructCompileUnit(GlobalVariable *GV); > + void ConstructCompileUnit(MDNode *N); > > - void ConstructGlobalVariableDIE(GlobalVariable *GV); > + void ConstructGlobalVariableDIE(MDNode *N); > > - void ConstructSubprogram(GlobalVariable *GV); > + void ConstructSubprogram(MDNode *N); > > public: > // > = > = > =-------------------------------------------------------------------- > ===// > @@ -506,13 +506,13 @@ > const std::string &FileName); > > /// RecordRegionStart - Indicate the start of a region. > - unsigned RecordRegionStart(GlobalVariable *V); > + unsigned RecordRegionStart(MDNode *N); > > /// RecordRegionEnd - Indicate the end of a region. > - unsigned RecordRegionEnd(GlobalVariable *V); > + unsigned RecordRegionEnd(MDNode *N); > > /// RecordVariable - Indicate the declaration of a local variable. > - void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); > + void RecordVariable(MDNode *N, unsigned FrameIndex); > > //// RecordInlinedFnStart - Indicate the start of inlined > subroutine. > unsigned RecordInlinedFnStart(DISubprogram &SP, DICompileUnit CU, > > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Aug 25 > 00:24:07 2009 > @@ -80,13 +80,13 @@ > } > > /// RecordRegionStart - Indicate the start of a region. > -unsigned DwarfWriter::RecordRegionStart(GlobalVariable *V) { > - return DD->RecordRegionStart(V); > +unsigned DwarfWriter::RecordRegionStart(MDNode *N) { > + return DD->RecordRegionStart(N); > } > > /// RecordRegionEnd - Indicate the end of a region. > -unsigned DwarfWriter::RecordRegionEnd(GlobalVariable *V) { > - return DD->RecordRegionEnd(V); > +unsigned DwarfWriter::RecordRegionEnd(MDNode *N) { > + return DD->RecordRegionEnd(N); > } > > /// getRecordSourceLineCount - Count source lines. > @@ -96,8 +96,8 @@ > > /// RecordVariable - Indicate the declaration of a local variable. > /// > -void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned > FrameIndex) { > - DD->RecordVariable(GV, FrameIndex); > +void DwarfWriter::RecordVariable(MDNode *N, unsigned FrameIndex) { > + DD->RecordVariable(N, FrameIndex); > } > > /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging > declarations should > @@ -106,8 +106,7 @@ > return DD && DD->ShouldEmitDwarfDebug(); > } > > -//// RecordInlinedFnStart - Global variable GV is inlined at the > location marked > -//// by LabelID label. > +//// RecordInlinedFnStart > unsigned DwarfWriter::RecordInlinedFnStart(DISubprogram SP, > DICompileUnit CU, > unsigned Line, unsigned > Col) { > return DD->RecordInlinedFnStart(SP, CU, Line, Col); > > Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Aug 25 00:24:07 > 2009 > @@ -333,7 +333,7 @@ > /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the > given > /// source file, line, and column. If none currently exists, create > a new > /// DebugLocTuple, and insert it into the DebugIdMap. > -unsigned MachineFunction::getOrCreateDebugLocID(GlobalVariable > *CompileUnit, > +unsigned MachineFunction::getOrCreateDebugLocID(MDNode *CompileUnit, > unsigned Line, > unsigned Col) { > DebugLocTuple Tuple(CompileUnit, Line, Col); > DenseMap::iterator II > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Aug 25 > 00:24:07 2009 > @@ -335,7 +335,7 @@ > if (isValidDebugInfoIntrinsic(*RSI, CodeGenOpt::None) && DW > && DW->ShouldEmitDwarfDebug()) { > unsigned ID = > - DW->RecordRegionStart(cast(RSI->getContext > ())); > + DW->RecordRegionStart(RSI->getContext()); > const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); > BuildMI(MBB, DL, II).addImm(ID); > } > @@ -346,7 +346,7 @@ > if (isValidDebugInfoIntrinsic(*REI, CodeGenOpt::None) && DW > && DW->ShouldEmitDwarfDebug()) { > unsigned ID = 0; > - DISubprogram Subprogram(cast(REI->getContext > ())); > + DISubprogram Subprogram(REI->getContext()); > if (isInlinedFnEnd(*REI, MF.getFunction())) { > // This is end of an inlined function. > const TargetInstrDesc &II = TII.get > (TargetInstrInfo::DBG_LABEL); > @@ -359,7 +359,7 @@ > BuildMI(MBB, DL, II).addImm(ID); > } else { > const TargetInstrDesc &II = TII.get > (TargetInstrInfo::DBG_LABEL); > - ID = DW->RecordRegionEnd(cast(REI- > >getContext())); > + ID = DW->RecordRegionEnd(REI->getContext()); > BuildMI(MBB, DL, II).addImm(ID); > } > } > @@ -384,7 +384,7 @@ > setCurDebugLoc(ExtractDebugLocation(*FSI, MF.getDebugLocInfo > ())); > > DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); > - DISubprogram SP(cast(FSI->getSubprogram())); > + DISubprogram SP(FSI->getSubprogram()); > unsigned LabelID = DW->RecordInlinedFnStart(SP, > DICompileUnit > (PrevLocTpl.CompileUnit), > PrevLocTpl.Line, > @@ -398,7 +398,7 @@ > MF.setDefaultDebugLoc(ExtractDebugLocation(*FSI, > MF.getDebugLocInfo())); > > // llvm.dbg.func_start also defines beginning of function scope. > - DW->RecordRegionStart(cast(FSI->getSubprogram > ())); > + DW->RecordRegionStart(FSI->getSubprogram()); > return true; > } > case Intrinsic::dbg_declare: { > @@ -419,10 +419,7 @@ > if (SI == StaticAllocaMap.end()) break; // VLAs. > int FI = SI->second; > > - // Determine the debug globalvariable. > - GlobalValue *GV = cast(Variable); > - > - DW->RecordVariable(cast(GV), FI); > + DW->RecordVariable(cast(Variable), FI); > return true; > } > case Intrinsic::eh_exception: { > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Aug 25 > 00:24:07 2009 > @@ -1593,9 +1593,9 @@ > bool useLABEL = TLI.isOperationLegalOrCustom(ISD::DBG_LABEL, > MVT::Other); > > const DbgStopPointSDNode *DSP = cast(Node); > - GlobalVariable *CU_GV = cast(DSP->getCompileUnit > ()); > - if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) { > - DICompileUnit CU(cast(DSP->getCompileUnit())); > + MDNode *CU_Node = DSP->getCompileUnit(); > + if (DW && (useDEBUG_LOC || useLABEL)) { > + DICompileUnit CU(CU_Node); > > unsigned Line = DSP->getLine(); > unsigned Col = DSP->getColumn(); > @@ -1607,7 +1607,7 @@ > return DAG.getNode(ISD::DEBUG_LOC, dl, MVT::Other, Node- > >getOperand(0), > DAG.getConstant(Line, MVT::i32), > DAG.getConstant(Col, MVT::i32), > - DAG.getSrcValue(CU.getGV())); > + DAG.getSrcValue(CU.getNode())); > } else { > unsigned ID = DW->RecordSourceLine(Line, Col, CU); > return DAG.getLabel(ISD::DBG_LABEL, dl, Node->getOperand(0), > ID); > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 25 > 00:24:07 2009 > @@ -1286,7 +1286,7 @@ > > SDValue SelectionDAG::getDbgStopPoint(DebugLoc DL, SDValue Root, > unsigned Line, unsigned Col, > - Value *CU) { > + MDNode *CU) { > SDNode *N = NodeAllocator.Allocate(); > new (N) DbgStopPointSDNode(Root, Line, Col, CU); > N->setDebugLoc(DL); > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp > (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue > Aug 25 00:24:07 2009 > @@ -3876,7 +3876,7 @@ > if (isValidDebugInfoIntrinsic(RSI, OptLevel) && DW > && DW->ShouldEmitDwarfDebug()) { > unsigned LabelID = > - DW->RecordRegionStart(cast(RSI.getContext > ())); > + DW->RecordRegionStart(RSI.getContext()); > DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), > getRoot(), LabelID)); > } > @@ -3891,7 +3891,7 @@ > return 0; > > MachineFunction &MF = DAG.getMachineFunction(); > - DISubprogram Subprogram(cast(REI.getContext())); > + DISubprogram Subprogram(REI.getContext()); > > if (isInlinedFnEnd(REI, MF.getFunction())) { > // This is end of inlined function. Debugging information for > inlined > @@ -3910,7 +3910,7 @@ > } > > unsigned LabelID = > - DW->RecordRegionEnd(cast(REI.getContext())); > + DW->RecordRegionEnd(REI.getContext()); > DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(), > getRoot(), LabelID)); > return 0; > @@ -3942,7 +3942,7 @@ > if (!DW || !DW->ShouldEmitDwarfDebug()) > return 0; > DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); > - DISubprogram SP(cast(FSI.getSubprogram())); > + DISubprogram SP(FSI.getSubprogram()); > DICompileUnit CU(PrevLocTpl.CompileUnit); > unsigned LabelID = DW->RecordInlinedFnStart(SP, CU, > PrevLocTpl.Line, > @@ -3958,7 +3958,7 @@ > if (!DW || !DW->ShouldEmitDwarfDebug()) > return 0; > // llvm.dbg.func_start also defines beginning of function scope. > - DW->RecordRegionStart(cast(FSI.getSubprogram())); > + DW->RecordRegionStart(FSI.getSubprogram()); > return 0; > } > case Intrinsic::dbg_declare: { > @@ -3981,7 +3981,7 @@ > if (!AI) > return 0; > int FI = FuncInfo.StaticAllocaMap[AI]; > - DW->RecordVariable(cast(Variable), FI); > + DW->RecordVariable(cast(Variable), FI); > return 0; > } > case Intrinsic::eh_exception: { > > Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp (original) > +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp Tue Aug 25 > 00:24:07 2009 > @@ -1,3 +1,4 @@ > + > //===-- PIC16DebugInfo.cpp - Implementation for PIC16 Debug > Information ======// > // > // The LLVM Compiler Infrastructure > @@ -69,7 +70,7 @@ > > // We also need to encode the the information about the base type of > // pointer in TypeNo. > - DIType BaseType = DIDerivedType(Ty.getGV()).getTypeDerivedFrom(); > + DIType BaseType = DIDerivedType(Ty.getNode()).getTypeDerivedFrom(); > PopulateDebugInfo(BaseType, TypeNo, HasAux, Aux, TagName); > } > > @@ -78,7 +79,7 @@ > bool &HasAux, int Aux[], > std::string &TagName) { > > - DICompositeType CTy = DICompositeType(Ty.getGV()); > + DICompositeType CTy = DICompositeType(Ty.getNode()); > DIArray Elements = CTy.getTypeArray(); > unsigned short size = 1; > unsigned short Dimension[4]={0,0,0,0}; > @@ -87,7 +88,7 @@ > if (Element.getTag() == dwarf::DW_TAG_subrange_type) { > TypeNo = TypeNo << PIC16Dbg::S_DERIVED; > TypeNo = TypeNo | PIC16Dbg::DT_ARY; > - DISubrange SubRange = DISubrange(Element.getGV()); > + DISubrange SubRange = DISubrange(Element.getNode()); > Dimension[i] = SubRange.getHi() - SubRange.getLo() + 1; > // Each dimension is represented by 2 bytes starting at byte 9. > Aux[8+i*2+0] = Dimension[i]; > @@ -110,7 +111,7 @@ > unsigned short > &TypeNo, > bool &HasAux, int > Aux[], > std::string > &TagName) { > - DICompositeType CTy = DICompositeType(Ty.getGV()); > + DICompositeType CTy = DICompositeType(Ty.getNode()); > TypeNo = TypeNo << PIC16Dbg::S_BASIC; > if (Ty.getTag() == dwarf::DW_TAG_structure_type) > TypeNo = TypeNo | PIC16Dbg::T_STRUCT; > @@ -123,7 +124,7 @@ > // llvm.dbg.composite* global variable. Since we need to revisit > // PIC16DebugInfo implementation anyways after the MDNodes based > // framework is done, let us continue with the way it is. > - std::string UniqueSuffix = "." + Ty.getGV()->getNameStr().substr > (18); > + std::string UniqueSuffix = "." + Ty.getNode()->getNameStr().substr > (18); > TagName += UniqueSuffix; > unsigned short size = CTy.getSizeInBits()/8; > // 7th and 8th byte represent size. > @@ -210,11 +211,10 @@ > DbgFinder.processModule(M); > if (DbgFinder.compile_unit_count() != 0) { > // FIXME : What if more then one CUs are present in a module ? > - GlobalVariable *CU = *DbgFinder.compile_unit_begin(); > + MDNode *CU = *DbgFinder.compile_unit_begin(); > EmitDebugDirectives = true; > SwitchToCU(CU); > } > - > // Emit debug info for decls of composite types. > EmitCompositeTypeDecls(M); > } > @@ -259,7 +259,7 @@ > if (! EmitDebugDirectives) return; > assert (! DL.isUnknown() && "can't change to invalid debug loc"); > > - GlobalVariable *CU = MF.getDebugLocTuple(DL).CompileUnit; > + MDNode *CU = MF.getDebugLocTuple(DL).CompileUnit; > unsigned line = MF.getDebugLocTuple(DL).Line; > > SwitchToCU(CU); > @@ -306,8 +306,7 @@ > int ElementAux[PIC16Dbg::AuxSize] = { 0 }; > std::string TagName = ""; > std::string ElementName; > - GlobalVariable *GV = Element.getGV(); > - DIDerivedType DITy(GV); > + DIDerivedType DITy(Element.getNode()); > DITy.getName(ElementName); > unsigned short ElementSize = DITy.getSizeInBits()/8; > // Get mangleddd name for this structure/union element. > @@ -343,7 +342,7 @@ > CTy.getName(Name); > // Get the number after llvm.dbg.composite and make > UniqueSuffix from > // it. > - std::string DIVar = CTy.getGV()->getNameStr(); > + std::string DIVar = CTy.getNode()->getNameStr(); > std::string UniqueSuffix = "." + DIVar.substr(18); > std::string MangledCTyName = Name + UniqueSuffix; > unsigned short size = CTy.getSizeInBits()/8; > @@ -441,7 +440,7 @@ > void PIC16DbgInfo::EmitVarDebugInfo(Module &M) { > DebugInfoFinder DbgFinder; > DbgFinder.processModule(M); > - > + > for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin > (), > E = DbgFinder.global_variable_end(); I != E; ++I) { > DIGlobalVariable DIGV(*I); > @@ -466,7 +465,7 @@ > > /// SwitchToCU - Switch to a new compilation unit. > /// > -void PIC16DbgInfo::SwitchToCU(GlobalVariable *CU) { > +void PIC16DbgInfo::SwitchToCU(MDNode *CU) { > // Get the file path from CU. > DICompileUnit cu(CU); > std::string DirName, FileName; > > Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h (original) > +++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h Tue Aug 25 00:24:07 > 2009 > @@ -117,7 +117,7 @@ > > > private: > - void SwitchToCU (GlobalVariable *CU); > + void SwitchToCU (MDNode *CU); > void SwitchToLine (unsigned Line, bool IsInBeginFunction = false); > > void PopulateDebugInfo (DIType Ty, unsigned short &TypeNo, bool > &HasAux, > > Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Tue Aug 25 > 00:24:07 2009 > @@ -203,167 +203,56 @@ > // llvm.dbg.region.end calls, and any globals they point to if now > dead. > static bool StripDebugInfo(Module &M) { > > - SmallPtrSet llvmUsedValues; > - findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues); > - findUsedValues(M.getGlobalVariable("llvm.compiler.used"), > llvmUsedValues); > - > - DebugInfoFinder DbgFinder; > - DbgFinder.processModule(M); > - > - // These anchors use LinkOnce linkage so that the optimizer does > not > - // remove them accidently. Set InternalLinkage for all these debug > - // info anchors. > - for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(), > - E = DbgFinder.compile_unit_end(); I != E; ++I) > - (*I)->setLinkage(GlobalValue::InternalLinkage); > - for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin > (), > - E = DbgFinder.global_variable_end(); I != E; ++I) > - (*I)->setLinkage(GlobalValue::InternalLinkage); > - for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(), > - E = DbgFinder.subprogram_end(); I != E; ++I) > - (*I)->setLinkage(GlobalValue::InternalLinkage); > - > - > - // Delete all dbg variables. > - for (Module::global_iterator I = M.global_begin(), E = > M.global_end(); > - I != E; ++I) { > - GlobalVariable *GV = dyn_cast(I); > - if (!GV) continue; > - if (!GV->use_empty() && llvmUsedValues.count(I) == 0) { > - if (GV->getName().startswith("llvm.dbg")) { > - GV->replaceAllUsesWith(UndefValue::get(GV->getType())); > - } > - } > - } > - > + // Remove all of the calls to the debugger intrinsics, and remove > them from > + // the module. > Function *FuncStart = M.getFunction("llvm.dbg.func.start"); > Function *StopPoint = M.getFunction("llvm.dbg.stoppoint"); > Function *RegionStart = M.getFunction("llvm.dbg.region.start"); > Function *RegionEnd = M.getFunction("llvm.dbg.region.end"); > Function *Declare = M.getFunction("llvm.dbg.declare"); > > - std::vector DeadConstants; > - > - // Remove all of the calls to the debugger intrinsics, and remove > them from > - // the module. > if (FuncStart) { > while (!FuncStart->use_empty()) { > CallInst *CI = cast(FuncStart->use_back()); > - Value *Arg = CI->getOperand(1); > - assert(CI->use_empty() && "llvm.dbg intrinsic should have > void result"); > CI->eraseFromParent(); > - if (Arg->use_empty()) > - if (Constant *C = dyn_cast(Arg)) > - DeadConstants.push_back(C); > } > FuncStart->eraseFromParent(); > } > if (StopPoint) { > while (!StopPoint->use_empty()) { > CallInst *CI = cast(StopPoint->use_back()); > - Value *Arg = CI->getOperand(3); > - assert(CI->use_empty() && "llvm.dbg intrinsic should have > void result"); > CI->eraseFromParent(); > - if (Arg->use_empty()) > - if (Constant *C = dyn_cast(Arg)) > - DeadConstants.push_back(C); > } > StopPoint->eraseFromParent(); > } > if (RegionStart) { > while (!RegionStart->use_empty()) { > CallInst *CI = cast(RegionStart->use_back()); > - Value *Arg = CI->getOperand(1); > - assert(CI->use_empty() && "llvm.dbg intrinsic should have > void result"); > CI->eraseFromParent(); > - if (Arg->use_empty()) > - if (Constant *C = dyn_cast(Arg)) > - DeadConstants.push_back(C); > } > RegionStart->eraseFromParent(); > } > if (RegionEnd) { > while (!RegionEnd->use_empty()) { > CallInst *CI = cast(RegionEnd->use_back()); > - Value *Arg = CI->getOperand(1); > - assert(CI->use_empty() && "llvm.dbg intrinsic should have > void result"); > CI->eraseFromParent(); > - if (Arg->use_empty()) > - if (Constant *C = dyn_cast(Arg)) > - DeadConstants.push_back(C); > } > RegionEnd->eraseFromParent(); > } > if (Declare) { > while (!Declare->use_empty()) { > CallInst *CI = cast(Declare->use_back()); > - Value *Arg1 = CI->getOperand(1); > - Value *Arg2 = CI->getOperand(2); > - assert(CI->use_empty() && "llvm.dbg intrinsic should have > void result"); > CI->eraseFromParent(); > - if (Arg1->use_empty()) { > - if (Constant *C = dyn_cast(Arg1)) > - DeadConstants.push_back(C); > - else > - RecursivelyDeleteTriviallyDeadInstructions(Arg1); > - } > - if (Arg2->use_empty()) > - if (Constant *C = dyn_cast(Arg2)) > - DeadConstants.push_back(C); > } > Declare->eraseFromParent(); > } > > - // llvm.dbg.compile_units and llvm.dbg.subprograms are marked as > linkonce > - // but since we are removing all debug information, make them > internal now. > - // FIXME: Use private linkage maybe? > - if (Constant *C = M.getNamedGlobal("llvm.dbg.compile_units")) > - if (GlobalVariable *GV = dyn_cast(C)) > - GV->setLinkage(GlobalValue::InternalLinkage); > - > - if (Constant *C = M.getNamedGlobal("llvm.dbg.subprograms")) > - if (GlobalVariable *GV = dyn_cast(C)) > - GV->setLinkage(GlobalValue::InternalLinkage); > - > - if (Constant *C = M.getNamedGlobal("llvm.dbg.global_variables")) > - if (GlobalVariable *GV = dyn_cast(C)) > - GV->setLinkage(GlobalValue::InternalLinkage); > - > - // Delete all dbg variables. > - for (Module::global_iterator I = M.global_begin(), E = > M.global_end(); > - I != E; ++I) { > - GlobalVariable *GV = dyn_cast(I); > - if (!GV) continue; > - if (GV->use_empty() && llvmUsedValues.count(I) == 0 > - && (!GV->hasSection() > - || strcmp(GV->getSection().c_str(), "llvm.metadata") == > 0)) > - DeadConstants.push_back(GV); > - } > - > - if (DeadConstants.empty()) > - return false; > - > - // Delete any internal globals that were only used by the > debugger intrinsics. > - while (!DeadConstants.empty()) { > - Constant *C = DeadConstants.back(); > - DeadConstants.pop_back(); > - if (GlobalVariable *GV = dyn_cast(C)) { > - if (GV->hasLocalLinkage()) > - RemoveDeadConstant(GV); > - } > - else > - RemoveDeadConstant(C); > - } > + NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv"); > + if (NMD) > + NMD->eraseFromParent(); > > - // Remove all llvm.dbg types. > - TypeSymbolTable &ST = M.getTypeSymbolTable(); > - for (TypeSymbolTable::iterator TI = ST.begin(), TE = ST.end(); > TI != TE; ) { > - if (!strncmp(TI->first.c_str(), "llvm.dbg.", 9)) > - ST.remove(TI++); > - else > - ++TI; > - } > - > + // Remove dead metadata. > + M.getContext().RemoveDeadMetadata(); > return true; > } > > > Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Tue Aug 25 > 00:24:07 2009 > @@ -238,7 +238,7 @@ > // Do not clone llvm.dbg.region.end. It will be adjusted by the > inliner. > if (const DbgFuncStartInst *DFSI = dyn_cast > (II)) { > if (DbgFnStart == NULL) { > - DISubprogram SP(cast(DFSI->getSubprogram())); > + DISubprogram SP(DFSI->getSubprogram()); > if (SP.describes(BB->getParent())) > DbgFnStart = DFSI->getSubprogram(); > } > > Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Tue Aug 25 > 00:24:07 2009 > @@ -207,17 +207,17 @@ > /// to the llvm.dbg.func.start of the function F. Otherwise return > NULL. > static const DbgRegionEndInst *findFnRegionEndMarker(const Function > *F) { > > - GlobalVariable *FnStart = NULL; > + MDNode *FnStart = NULL; > const DbgRegionEndInst *FnEnd = NULL; > for (Function::const_iterator FI = F->begin(), FE =F->end(); FI != > FE; ++FI) > for (BasicBlock::const_iterator BI = FI->begin(), BE = FI->end > (); BI != BE; > ++BI) { > if (FnStart == NULL) { > if (const DbgFuncStartInst *FSI = dyn_cast > (BI)) { > - DISubprogram SP(cast(FSI->getSubprogram > ())); > + DISubprogram SP(FSI->getSubprogram()); > assert (SP.isNull() == false && "Invalid > llvm.dbg.func.start"); > if (SP.describes(F)) > - FnStart = SP.getGV(); > + FnStart = SP.getNode(); > } > } else { > if (const DbgRegionEndInst *REI = dyn_cast > (BI)) > > Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original) > +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Tue Aug 25 00:24:07 2009 > @@ -16,8 +16,7 @@ > #include "llvm/Function.h" > #include "llvm/LLVMContext.h" > #include "llvm/Module.h" > -#include "llvm/Instructions.h" > -#include "llvm/Intrinsics.h" > +#include "llvm/IntrinsicInst.h" > #include "llvm/ADT/SmallVector.h" > #include "llvm/Support/ErrorHandling.h" > #include > @@ -434,3 +433,74 @@ > } > } > } > + > +/// This function checks debug info intrinsics. If an intrinsic is > invalid > +/// then this function simply removes the intrinsic. > +void llvm::CheckDebugInfoIntrinsics(Module *M) { > + > + > + if (Function *FuncStart = M->getFunction("llvm.dbg.func.start")) { > + if (!FuncStart->use_empty()) { > + DbgFuncStartInst *DFSI = cast(FuncStart- > >use_back()); > + if (!isa(DFSI->getOperand(1))) { > + while (!FuncStart->use_empty()) { > + CallInst *CI = cast(FuncStart->use_back()); > + CI->eraseFromParent(); > + } > + FuncStart->eraseFromParent(); > + } > + } > + } > + > + if (Function *StopPoint = M->getFunction("llvm.dbg.stoppoint")) { > + if (!StopPoint->use_empty()) { > + DbgStopPointInst *DSPI = cast(StopPoint- > >use_back()); > + if (!isa(DSPI->getOperand(3))) { > + while (!StopPoint->use_empty()) { > + CallInst *CI = cast(StopPoint->use_back()); > + CI->eraseFromParent(); > + } > + StopPoint->eraseFromParent(); > + } > + } > + } > + > + if (Function *RegionStart = M->getFunction > ("llvm.dbg.region.start")) { > + if (!RegionStart->use_empty()) { > + DbgRegionStartInst *DRSI = cast > (RegionStart->use_back()); > + if (!isa(DRSI->getOperand(1))) { > + while (!RegionStart->use_empty()) { > + CallInst *CI = cast(RegionStart->use_back()); > + CI->eraseFromParent(); > + } > + RegionStart->eraseFromParent(); > + } > + } > + } > + > + if (Function *RegionEnd = M->getFunction("llvm.dbg.region.end")) { > + if (!RegionEnd->use_empty()) { > + DbgRegionEndInst *DREI = cast(RegionEnd- > >use_back()); > + if (!isa(DREI->getOperand(1))) { > + while (!RegionEnd->use_empty()) { > + CallInst *CI = cast(RegionEnd->use_back()); > + CI->eraseFromParent(); > + } > + RegionEnd->eraseFromParent(); > + } > + } > + } > + > + if (Function *Declare = M->getFunction("llvm.dbg.declare")) { > + if (!Declare->use_empty()) { > + DbgDeclareInst *DDI = cast(Declare->use_back > ()); > + if (!isa(DDI->getOperand(2))) { > + while (!Declare->use_empty()) { > + CallInst *CI = cast(Declare->use_back()); > + CI->eraseFromParent(); > + } > + Declare->eraseFromParent(); > + } > + } > + } > +} > > Modified: llvm/trunk/lib/VMCore/Metadata.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Metadata.cpp (original) > +++ llvm/trunk/lib/VMCore/Metadata.cpp Tue Aug 25 00:24:07 2009 > @@ -82,7 +82,7 @@ > V.reserve(NumVals); > for (unsigned i = 0; i < NumVals; ++i) > V.push_back(Vals[i]); > - > + > return pImpl->MDNodes.getOrCreate(Type::getMetadataTy(Context), V); > } > > > Modified: llvm/trunk/lib/VMCore/ValueTypes.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ValueTypes.cpp?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/ValueTypes.cpp (original) > +++ llvm/trunk/lib/VMCore/ValueTypes.cpp Tue Aug 25 00:24:07 2009 > @@ -169,6 +169,7 @@ > case MVT::v8f32: return VectorType::get(Type::getFloatTy > (Context), 8); > case MVT::v2f64: return VectorType::get(Type::getDoubleTy > (Context), 2); > case MVT::v4f64: return VectorType::get(Type::getDoubleTy > (Context), 4); > + case MVT::Metadata: return Type::getMetadataTy(Context); > } > } > > > Removed: llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll (original) > +++ llvm/trunk/test/DebugInfo/2008-11-06-Mem2Reg.ll (removed) > @@ -1,56 +0,0 @@ > -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | grep alloca | 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 = "i386-apple-darwin9.5" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 393262, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 2, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { } > *), i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 393216, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 > x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str2, > i32 0, i32 0) }, section "llvm.metadata" ; < > %llvm.dbg.compile_unit.type*> [#uses=1] > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 393216, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [7 x i8] c"adce.c\00", section > "llvm.metadata" ; <[7 x i8]*> [#uses=1] > - at .str1 = internal constant [6 x i8] c"/tmp/\00", section > "llvm.metadata" ; <[6 x i8]*> [#uses=1] > - at .str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc. > build 5623) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x > i8]*> [#uses=1] > - at .str3 = internal constant [4 x i8] c"foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 393252, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str4, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at .str4 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 393472, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at .str5 = internal constant [2 x i8] c"i\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - > -define i32 @foo() nounwind { > -entry: > - %retval = alloca i32 ; [#uses=2] > - %i = alloca i32 ; [#uses=4] > - %0 = alloca i32 ; [#uses=2] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - %i1 = bitcast i32* %i to { }* ; <{ }*> [#uses=1] > - call void @llvm.dbg.declare({ }* %i1, { }* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) > - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - store i32 4, i32* %i, align 4 > - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %1 = load i32* %i, align 4 ; [#uses=1] > - %2 = mul i32 %1, 84 ; [#uses=1] > - store i32 %2, i32* %i, align 4 > - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - store i32 42, i32* %0, align 4 > - %3 = load i32* %0, align 4 ; [#uses=1] > - store i32 %3, i32* %retval, align 4 > - br label %return > - > -return: ; preds = %entry > - %retval2 = load i32* %retval ; [#uses=1] > - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - ret i32 %retval2 > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.declare({ }*, { }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > > Removed: llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll (original) > +++ llvm/trunk/test/DebugInfo/2008-11-19-InstCombine.ll (removed) > @@ -1,44 +0,0 @@ > -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep stoppoint > | count 3 > -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.5" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 393262, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 2, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { } > *), i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 393216, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 > x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str2, > i32 0, i32 0) }, section "llvm.metadata" ; < > %llvm.dbg.compile_unit.type*> [#uses=1] > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 393216, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [7 x i8] c"adce.c\00", section > "llvm.metadata" ; <[7 x i8]*> [#uses=1] > - at .str1 = internal constant [6 x i8] c"/tmp/\00", section > "llvm.metadata" ; <[6 x i8]*> [#uses=1] > - at .str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc. > build 5623) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x > i8]*> [#uses=1] > - at .str3 = internal constant [4 x i8] c"foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 393252, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str4, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at .str4 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 393472, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] > - at .str5 = internal constant [2 x i8] c"i\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - > -define i32 @foo() nounwind { > -entry: > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %0 = mul i32 4, 84 ; [#uses=0] > - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - br label %return > - > -return: ; preds = %entry > - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - ret i32 42 > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.declare({ }*, { }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > > Removed: llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll (original) > +++ llvm/trunk/test/DebugInfo/2009-01-28-ArrayType.ll (removed) > @@ -1,23 +0,0 @@ > -; RUN: llvm-as < %s | llc | grep 0x49 | count 3 > -; Count number of DW_AT_Type attributes. > -target triple = "i386-apple-darwin*" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, > i8*, i1, i1, i8* } > - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, { }*, { }* } > - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, > i8*, { }*, i32, { }*, i1, i1, { }* } > - %llvm.dbg.subrange.type = type { i32, i64, i64 } > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [8 x i8] c"array.c\00", section > "llvm.metadata" ; <[8 x i8]*> [#uses=1] > - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test > \00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at c = common global [3 x i32] zeroinitializer ; <[3 x i32]*> > [#uses=1] > - at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type > { i32 458785, i64 0, i64 2 }, section "llvm.metadata" ; < > %llvm.dbg.subrange.type*> [#uses=1] > - at llvm.dbg.array = internal constant [1 x { }*] [ { }* bitcast > (%llvm.dbg.subrange.type* @llvm.dbg.subrange to { }*) ], section > "llvm.metadata" ; <[1 x { }*]*> [#uses=1] > - at .str3 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type > { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 96, i64 32, i64 0, i32 0, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* > bitcast ([1 x { }*]* @llvm.dbg.array to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.global_variables = linkonce constant > %llvm.dbg.anchor.type { i32 458752, i32 52 }, section > "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] > - at .str4 = internal constant [2 x i8] c"c\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.global_variable = internal constant > %llvm.dbg.global_variable.type { i32 458804, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* > bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { } > *), i8* getelementptr ([2 x i8]* @.str4, i32 0, i32 0), i8* > getelementptr ([2 x i8]* @.str4, i32 0, i32 0), i8* null, { }* > bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { } > *), i32 2, { }* bitcast (%llvm.dbg.composite.type* > @llvm.dbg.composite to { }*), i1 false, i1 true, { }* bitcast ([3 x > i32]* @c to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.global_variable.type*> [#uses=0] > > Removed: llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll (original) > +++ llvm/trunk/test/DebugInfo/2009-01-29-HeaderLocation.ll (removed) > @@ -1,46 +0,0 @@ > -; RUN: llvm-as < %s | llc | grep "\\"m.h\\"" | count 1 > -target triple = "i386-apple-darwin9.6" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, > i8*, i1, i1, i8* } > - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, { }*, { }* } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [4 x i8] c"m.c\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test > \00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at .str3 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at llvm.dbg.array = internal constant [1 x { }*] [ { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section > "llvm.metadata" ; <[1 x { }*]*> [#uses=1] > - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type > { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]* > @llvm.dbg.array to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at .str4 = internal constant [4 x i8] c"m.h\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.compile_unit5 = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr > ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 false, i1 false, i8* null }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str6 = internal constant [5 x i8] c"main\00", section > "llvm.metadata" ; <[5 x i8]*> [#uses=1] > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([5 x i8]* @.str6, i32 0, i32 0), i8* getelementptr > ([5 x i8]* @.str6, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*), i32 > 2, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { } > *), i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - > -define i32 @main() nounwind { > -entry: > - %retval = alloca i32 ; [#uses=2] > - %0 = alloca i32 ; [#uses=2] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*)) > - store i32 0, i32* %0, align 4 > - %1 = load i32* %0, align 4 ; [#uses=1] > - store i32 %1, i32* %retval, align 4 > - br label %return > - > -return: ; preds = %entry > - %retval1 = load i32* %retval ; [#uses=1] > - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit5 to { }*)) > - call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - ret i32 %retval1 > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > > Removed: llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll > (original) > +++ llvm/trunk/test/DebugInfo/2009-01-29-MethodDeclaration.ll > (removed) > @@ -1,32 +0,0 @@ > -; RUN: llvm-as < %s | llc | grep 0x3C | count 1 > -; Check DW_AT_declaration attribute for class method foo. > -target triple = "i386-apple-darwin*" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32, i8*, i8* } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, > i8*, i1, i8* } > - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, { }*, { }*, i8*, i8* } > - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, > i64, i64, i64, i32, { }*, i8*, i8* } > - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, > i8*, { }*, i32, { }*, i1, i1, { }*, i8*, i8* } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1, i8*, i8* } > - %struct.A = type <{ i8 }> > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [6 x i8] c"cl.cc\00", section > "llvm.metadata" ; <[6 x i8]*> [#uses=1] > - at .str1 = internal constant [26 x i8] c"/Volumes/Nanpura/dbg.test > \00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8* > getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([26 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 false, i8* null }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at a = global %struct.A zeroinitializer ; <%struct.A*> [#uses=1] > - at .str3 = internal constant [2 x i8] c"A\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at .str4 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; < > %llvm.dbg.basictype.type*> [#uses=1] > - at llvm.dbg.derivedtype = internal constant > %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite9 to > { }*), i8* null, i8* null }, section "llvm.metadata" ; < > %llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.array = internal constant [2 x { }*] [ { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { } > *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] > - at llvm.dbg.composite5 = internal constant %llvm.dbg.composite.type > { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* > @llvm.dbg.array to { }*), i8* null, i8* null }, section > "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str6 = internal constant [4 x i8] c"foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at .str7 = internal constant [12 x i8] c"_ZN1A3fooEv\00", section > "llvm.metadata" ; <[12 x i8]*> [#uses=1] > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str6, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str6, i32 0, i32 0), i8* getelementptr ([12 x i8]* > @.str7, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 4, { }* bitcast > (%llvm.dbg.composite.type* @llvm.dbg.composite5 to { }*), i1 false, > i1 false, i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* > getelementptr ([26 x i8]* @.str1, i32 0, i32 0) }, section > "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] > - at llvm.dbg.array8 = internal constant [1 x { }*] [ { }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) ], section > "llvm.metadata" ; <[1 x { }*]*> [#uses=1] > - at llvm.dbg.composite9 = internal constant %llvm.dbg.composite.type > { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* > @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 2, i64 8, i64 8, i64 0, i32 0, > { }* null, { }* bitcast ([1 x { }*]* @llvm.dbg.array8 to { }*), i8* > getelementptr ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([26 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.global_variables = linkonce constant > %llvm.dbg.anchor.type { i32 458752, i32 52 }, section > "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] > - at .str10 = internal constant [2 x i8] c"a\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.global_variable = internal constant > %llvm.dbg.global_variable.type { i32 458804, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* > bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { } > *), i8* getelementptr ([2 x i8]* @.str10, i32 0, i32 0), i8* > getelementptr ([2 x i8]* @.str10, i32 0, i32 0), i8* null, { }* > bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { } > *), i32 7, { }* bitcast (%llvm.dbg.composite.type* > @llvm.dbg.composite9 to { }*), i1 false, i1 true, { }* bitcast > (%struct.A* @a to { }*), i8* getelementptr ([6 x i8]* @.str, i32 0, > i32 0), i8* getelementptr ([26 x i8]* @.str1, i32 0, i32 0) }, > section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] > > Removed: llvm/trunk/test/DebugInfo/2009-01-30-Method.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-30-Method.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2009-01-30-Method.ll (original) > +++ llvm/trunk/test/DebugInfo/2009-01-30-Method.ll (removed) > @@ -1,103 +0,0 @@ > -; RUN: llvm-as < %s | llc -O0 | grep "\\"foo" | count 3 > -; 1 declaration, 1 definition and 1 pubnames entry. > -target triple = "i386-apple-darwin*" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, > i8*, i1, i1, i8* } > - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, { }*, { }* } > - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, > i64, i64, i64, i32, { }* } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } > - %struct.Fibonancci = type { i32 } > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [10 x i8] c"method.cc\00", section > "llvm.metadata" ; <[10 x i8]*> [#uses=1] > - at .str1 = internal constant [64 x i8] c"/Volumes/Nanpura/mainline/ > llvmgcc42.build/gcc/../../../dbg.test\00", section > "llvm.metadata" ; <[64 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5636) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8* > getelementptr ([10 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([64 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at .str3 = internal constant [11 x i8] c"Fibonancci\00", section > "llvm.metadata" ; <[11 x i8]*> [#uses=1] > - at .str4 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at .str5 = internal constant [2 x i8] c"N\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.derivedtype = internal constant > %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 5, i64 32, i64 32, i64 0, i32 1, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.derivedtype6 = internal constant > %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to > { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> > [#uses=1] > - at llvm.dbg.array = internal constant [3 x { }*] [ { }* null, { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype6 to { } > *), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to > { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] > - at llvm.dbg.composite7 = internal constant %llvm.dbg.composite.type > { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* > @llvm.dbg.array to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str8 = internal constant [4 x i8] c"foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at .str9 = internal constant [22 x i8] c"_ZN10Fibonancci3fooEi\00", > section "llvm.metadata" ; <[22 x i8]*> [#uses=1] > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([22 x i8]* > @.str9, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast > (%llvm.dbg.composite.type* @llvm.dbg.composite7 to { }*), i1 false, > i1 false }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> > [#uses=1] > - at llvm.dbg.array10 = internal constant [2 x { }*] [ { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), { }* > bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) ], > section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] > - at llvm.dbg.composite11 = internal constant %llvm.dbg.composite.type > { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* > @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 3, i64 32, i64 32, i64 0, i32 > 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array10 to { } > *) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.derivedtype12 = internal constant > %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to > { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> > [#uses=1] > - at llvm.dbg.array13 = internal constant [3 x { }*] [ { }* null, { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 to { } > *), { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to > { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] > - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type > { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* > @llvm.dbg.array13 to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.subprogram14 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([22 x i8]* > @.str9, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast > (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, > i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> > [#uses=1] > - at llvm.dbg.derivedtype15 = internal constant > %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 > to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> > [#uses=1] > - at .str16 = internal constant [5 x i8] c"this\00", section > "llvm.metadata" ; <[5 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram14 to { }*), i8* getelementptr ([5 x i8]* > @.str16, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype15 to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at .str17 = internal constant [2 x i8] c"i\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.variable18 = internal constant %llvm.dbg.variable.type > { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram14 to { }*), i8* getelementptr ([2 x i8]* > @.str17, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 10, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at llvm.dbg.array19 = internal constant [1 x { }*] [ { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section > "llvm.metadata" ; <[1 x { }*]*> [#uses=1] > - at llvm.dbg.composite20 = internal constant %llvm.dbg.composite.type > { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]* > @llvm.dbg.array19 to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at .str21 = internal constant [5 x i8] c"main\00", section > "llvm.metadata" ; <[5 x i8]*> [#uses=1] > - at llvm.dbg.subprogram22 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([5 x i8]* @.str21, i32 0, i32 0), i8* getelementptr > ([5 x i8]* @.str21, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 14, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite20 to > { }*), i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at .str23 = internal constant [4 x i8] c"fib\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.variable24 = internal constant %llvm.dbg.variable.type > { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram22 to { }*), i8* getelementptr ([4 x i8]* > @.str23, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 15, { }* bitcast > (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - > -define void @_ZN10Fibonancci3fooEi(%struct.Fibonancci* %this, i32 > %i) nounwind { > -entry: > - %this_addr = alloca %struct.Fibonancci* ; <%struct.Fibonancci**> > [#uses=3] > - %i_addr = alloca i32 ; [#uses=3] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*)) > - %0 = bitcast %struct.Fibonancci** %this_addr to { }* ; <{ }*> > [#uses=1] > - call void @llvm.dbg.declare({ }* %0, { }* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) > - store %struct.Fibonancci* %this, %struct.Fibonancci** %this_addr > - %1 = bitcast i32* %i_addr to { }* ; <{ }*> [#uses=1] > - call void @llvm.dbg.declare({ }* %1, { }* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable18 to { }*)) > - store i32 %i, i32* %i_addr > - call void @llvm.dbg.stoppoint(i32 11, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %2 = load %struct.Fibonancci** %this_addr, align 4 ; < > %struct.Fibonancci*> [#uses=1] > - %3 = getelementptr %struct.Fibonancci* %2, i32 0, i32 0 ; > [#uses=1] > - %4 = load i32* %i_addr, align 4 ; [#uses=1] > - store i32 %4, i32* %3, align 4 > - call void @llvm.dbg.stoppoint(i32 12, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - br label %return > - > -return: ; preds = %entry > - call void @llvm.dbg.stoppoint(i32 12, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*)) > - ret void > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.declare({ }*, { }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > - > -define i32 @main() nounwind { > -entry: > - %retval = alloca i32 ; [#uses=2] > - %fib = alloca %struct.Fibonancci ; <%struct.Fibonancci*> [#uses=2] > - %0 = alloca i32 ; [#uses=2] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram22 to { }*)) > - %1 = bitcast %struct.Fibonancci* %fib to { }* ; <{ }*> [#uses=1] > - call void @llvm.dbg.declare({ }* %1, { }* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable24 to { }*)) > - call void @llvm.dbg.stoppoint(i32 16, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @_ZN10Fibonancci3fooEi(%struct.Fibonancci* %fib, i32 42) > nounwind > - call void @llvm.dbg.stoppoint(i32 17, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - store i32 0, i32* %0, align 4 > - %2 = load i32* %0, align 4 ; [#uses=1] > - store i32 %2, i32* %retval, align 4 > - br label %return > - > -return: ; preds = %entry > - %retval1 = load i32* %retval ; [#uses=1] > - call void @llvm.dbg.stoppoint(i32 17, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram22 to { }*)) > - ret i32 %retval1 > -} > > Removed: llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll (original) > +++ llvm/trunk/test/DebugInfo/2009-02-23-InstCombine.ll (removed) > @@ -1,41 +0,0 @@ > -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep stoppoint > | count 3 > -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" > -target triple = "i386-pc-linux-gnu" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, > i8*, i1, i1, i8*, i32 } > - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, { }*, { }*, i32 } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [8 x i8] c"brach.c\00", section > "llvm.metadata" ; <[8 x i8]*> [#uses=1] > - at .str1 = internal constant [38 x i8] c"/developer/home2/zsth/test/ > debug/tmp/\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([38 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 -1 }, > section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at .str3 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at llvm.dbg.array = internal constant [2 x { }*] [{ }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* > bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*)], > section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] > - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type > { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* > @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str4 = internal constant [4 x i8] c"foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { } > *), i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at .str5 = internal constant [2 x i8] c"x\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] > - > -define i32 @foo(i32 %x) nounwind { > -entry: > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %0 = icmp sgt i32 %x, 5 ; [#uses=1] > - %.0 = select i1 %0, i32 %x, i32 0 ; [#uses=1] > - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - ret i32 %.0 > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.declare({ }*, { }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > > Removed: llvm/trunk/test/DebugInfo/2009-03-02-sink.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-02-sink.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/2009-03-02-sink.ll (original) > +++ llvm/trunk/test/DebugInfo/2009-03-02-sink.ll (removed) > @@ -1,57 +0,0 @@ > -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext sdiv > 1 | grep {stoppoint(i32 2} > -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | %prcontext add > 1 | grep {stoppoint(i32 3} > -; ModuleID = 'sink.c' > -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.6" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, > i8*, i1, i1, i8*, i32 } > - %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, { }*, { }*, i32 } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [7 x i8] c"sink.c\00", section > "llvm.metadata" ; <[7 x i8]*> [#uses=1] > - at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", > section "llvm.metadata" ; <[23 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([7 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([23 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at .str3 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at llvm.dbg.array = internal constant [4 x { }*] [{ }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* > bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { } > * bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), > { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { } > *)], section "llvm.metadata" ; <[4 x { }*]*> [#uses=1] > - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type > { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([4 x { }*]* > @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str4 = internal constant [4 x i8] c"foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str4, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { } > *), i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at .str5 = internal constant [2 x i8] c"c\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at .str6 = internal constant [2 x i8] c"a\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.variable7 = internal constant %llvm.dbg.variable.type > { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str6, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at .str8 = internal constant [2 x i8] c"b\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.variable9 = internal constant %llvm.dbg.variable.type > { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str8, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 1, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - > -define i32 @foo(i32 %c, i32 %a, i32 %b) nounwind { > -entry: > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - call void @llvm.dbg.stoppoint(i32 2, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %tmp.2 = sdiv i32 %a, %b ; [#uses=1] > - call void @llvm.dbg.stoppoint(i32 3, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %tmp.9 = add i32 %b, %a ; [#uses=1] > - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %tmp.10 = icmp ne i32 %c, 0 ; [#uses=1] > - br i1 %tmp.10, label %bb, label %bb1 > - > -bb: ; preds = %entry > - call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - ret i32 %tmp.9 > - > -bb1: ; preds = %entry > - call void @llvm.dbg.stoppoint(i32 7, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - ret i32 %tmp.2 > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.declare({ }*, { }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > > Removed: llvm/trunk/test/DebugInfo/dataOnly.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dataOnly.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/dataOnly.ll (original) > +++ llvm/trunk/test/DebugInfo/dataOnly.ll (removed) > @@ -1,47 +0,0 @@ > -; RUN: llvm-as < %s | llc | grep DWARF > -; ModuleID = 'foo.c' > -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-darwin8" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, > i64, i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, > i8* } > - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, > i8*, i8*, { }*, i32, { }*, i1, i1, { }* } > - at x = common global i32 0 ; [#uses=1] > - at llvm.dbg.global_variable = internal constant > %llvm.dbg.global_variable.type { > - i32 393268, > - { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.global_variables to { }*), > - { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), > - i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0), > - i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0), > - i8* null, > - { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), > - i32 1, > - { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to > { }*), > - i1 false, > - i1 true, > - { }* bitcast (i32* @x to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.global_variable.type*> [#uses=0] > - at llvm.dbg.global_variables = linkonce constant > %llvm.dbg.anchor.type { i32 393216, i32 52 }, section > "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { > - i32 393233, > - { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units > to { }*), > - i32 1, > - i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), > - i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0), > - i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 393216, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [6 x i8] c"foo.c\00", section > "llvm.metadata" ; <[6 x i8]*> [#uses=1] > - at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", > section "llvm.metadata" ; <[23 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5555) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at .str3 = internal constant [2 x i8] c"x\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { > - i32 393252, > - { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), > - i8* getelementptr ([4 x i8]* @.str4, i32 0, i32 0), > - { }* null, > - i32 0, > - i64 32, > - i64 32, > - i64 0, > - i32 0, > - i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at .str4 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > > Removed: llvm/trunk/test/DebugInfo/forwardDecl.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/forwardDecl.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/forwardDecl.ll (original) > +++ llvm/trunk/test/DebugInfo/forwardDecl.ll (removed) > @@ -1,49 +0,0 @@ > -; RUN: llvm-as < %s | llc -O0 | %prcontext ST 1 | grep 0x1 | count 1 > - > -target triple = "i386-apple-darwin9.6" > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } > - %llvm.dbg.compositetype.type = type { i32, { }*, i8*, { }*, i32, > i64, i64, i64, i32, { }*, { }* } > - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, > i64, i64, i64, i32, { }* } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } > - %struct.ST = type opaque > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 393262, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr > ([4 x i8]* @.str3, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 3, { }* null, i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 393216, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 393233, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* > getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([36 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0) }, section "llvm.metadata" ; < > %llvm.dbg.compile_unit.type*> [#uses=1] > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 393216, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [4 x i8] c"t.c\00", section > "llvm.metadata" ; <[20 x i8]*> [#uses=1] > - at .str1 = internal constant [36 x i8] c"/Users/echeng/LLVM/radars/ > r6395152/\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5628) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at .str3 = internal constant [4 x i8] c"foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 393473, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str4, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at .str4 = internal constant [2 x i8] c"x\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.derivedtype = internal constant > %llvm.dbg.derivedtype.type { i32 393231, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 > 0, { }* bitcast (%llvm.dbg.compositetype.type* > @llvm.dbg.compositetype to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.compositetype = internal constant > %llvm.dbg.compositetype.type { i32 393235, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([3 x i8]* @.str5, i32 0, i32 0), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 1, i64 0, i64 8, i64 0, i32 4, { }* null, { }* bitcast ([0 x { }*]* > @llvm.dbg.array to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.compositetype.type*> [#uses=1] > - at .str5 = internal constant [3 x i8] c"ST\00", section > "llvm.metadata" ; <[3 x i8]*> [#uses=1] > - at llvm.dbg.array = internal constant [0 x { }*] zeroinitializer, > section "llvm.metadata" ; <[0 x { }*]*> [#uses=1] > - > -define void @foo(%struct.ST* %x1) nounwind { > -entry: > - %x_addr = alloca %struct.ST* ; <%struct.ST**> [#uses=2] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - %x = bitcast %struct.ST** %x_addr to { }* ; <{ }*> [#uses=1] > - call void @llvm.dbg.declare({ }* %x, { }* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) > - store %struct.ST* %x1, %struct.ST** %x_addr > - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - br label %return > - > -return: ; preds = %entry > - call void @llvm.dbg.stoppoint(i32 4, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - ret void > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.declare({ }*, { }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > > Removed: llvm/trunk/test/DebugInfo/printdbginfo.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/printdbginfo.ll (original) > +++ llvm/trunk/test/DebugInfo/printdbginfo.ll (removed) > @@ -1,136 +0,0 @@ > -; RUN: llvm-as < %s | opt -print-dbginfo -disable-output > %t1 > -; RUN: %prcontext {function name: Bar::bar return type: int at line > 12} 1 < %t1 | grep {(tst.cpp:14)} > -; RUN: %prcontext {%%tmp1} 1 < %t1 | grep -E {variable tmp.+at > tst.cpp:23} > -; RUN: %prcontext {; tst.cpp:24} 2 < %t1 | grep {%%6} > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } > - %llvm.dbg.compositetype.type = type { i32, { }*, i8*, { }*, i32, > i64, i64, i64, i32, { }*, { }* } > - %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, > i64, i64, i64, i32, { }* } > - %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, > { }*, i32, { }*, i1, i1 } > - %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* } > - %struct.Bar = type { %struct.Foo, i32 } > - %struct.Foo = type { i32 } > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr > ([9 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([14 x i8]* > @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 false, > i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> > [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 45872, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 4, i8* > getelementptr ([8 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([13 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0) }, section "llvm.metadata" ; < > %llvm.dbg.compile_unit.type*> [#uses=1] > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 45872, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [8 x i8] c"tst.cpp\00", section > "llvm.metadata" ; <[8 x i8]*> [#uses=1] > - at .str1 = internal constant [13 x i8] c"/home/edwin/\00", section > "llvm.metadata" ; <[13 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5623) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at .str3 = internal constant [4 x i8] c"bar\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at .str4 = internal constant [9 x i8] c"Bar::bar\00", section > "llvm.metadata" ; <[9 x i8]*> [#uses=1] > - at .str5 = internal constant [14 x i8] c"_ZN3Bar3barEv\00", section > "llvm.metadata" ; <[14 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* > @.str6, i32 0, i32 0), { }* null, i32 0, i64 32, i64 32, i64 0, i32 > 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at .str6 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([5 x i8]* @.str7, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] > - at .str7 = internal constant [5 x i8] c"this\00", section > "llvm.metadata" ; <[5 x i8]*> [#uses=1] > - at llvm.dbg.derivedtype = internal constant > %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast > (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.compositetype = internal constant > %llvm.dbg.compositetype.type { i32 458771, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str8, i32 0, i32 0), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 5, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([5 x { }*] > * @llvm.dbg.array36 to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.compositetype.type*> [#uses=1] > - at .str8 = internal constant [4 x i8] c"Bar\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.derivedtype9 = internal constant > %llvm.dbg.derivedtype.type { i32 458780, { }* null, i8* null, { }* > null, i32 0, i64 0, i64 0, i64 0, i32 0, { }* bitcast > (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.compositetype10 = internal constant > %llvm.dbg.compositetype.type { i32 458771, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str11, i32 0, i32 0), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 1, i64 32, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*] > * @llvm.dbg.array22 to { }*) }, section "llvm.metadata" ; < > %llvm.dbg.compositetype.type*> [#uses=1] > - at .str11 = internal constant [4 x i8] c"Foo\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.derivedtype12 = internal constant > %llvm.dbg.derivedtype.type { i32 458765, { }* null, i8* > getelementptr ([7 x i8]* @.str13, i32 0, i32 0), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 2, i64 32, i64 32, i64 0, i32 0, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at .str13 = internal constant [7 x i8] c"FooVar\00", section > "llvm.metadata" ; <[7 x i8]*> [#uses=1] > - at llvm.dbg.subprogram14 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str11, i32 0, i32 0), i8* getelementptr > ([9 x i8]* @.str15, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 12, { }* bitcast (%llvm.dbg.compositetype.type* > @llvm.dbg.compositetype16 to { }*), i1 false, i1 false }, section > "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] > - at .str15 = internal constant [9 x i8] c"Foo::Foo\00", section > "llvm.metadata" ; <[9 x i8]*> [#uses=1] > - at llvm.dbg.compositetype16 = internal constant > %llvm.dbg.compositetype.type { i32 458773, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* > bitcast ([3 x { }*]* @llvm.dbg.array to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] > - at llvm.dbg.derivedtype17 = internal constant > %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast > (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.derivedtype18 = internal constant > %llvm.dbg.derivedtype.type { i32 458768, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast > (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype10 to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.array = internal constant [3 x { }*] [ { }* null, { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype17 to { } > *), { }* bitcast (%llvm.dbg.derivedtype.type* > @llvm.dbg.derivedtype18 to { }*) ], section "llvm.metadata" ; <[3 x > { }*]*> [#uses=1] > - at llvm.dbg.subprogram19 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str11, i32 0, i32 0), i8* getelementptr > ([9 x i8]* @.str15, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 12, { }* bitcast (%llvm.dbg.compositetype.type* > @llvm.dbg.compositetype20 to { }*), i1 false, i1 false }, section > "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] > - at llvm.dbg.compositetype20 = internal constant > %llvm.dbg.compositetype.type { i32 458773, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* > bitcast ([2 x { }*]* @llvm.dbg.array21 to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] > - at llvm.dbg.array21 = internal constant [2 x { }*] [ { }* null, { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype17 to { } > *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] > - at llvm.dbg.array22 = internal constant [3 x { }*] [ { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype12 to { }*), { }* > bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram14 to { }*), > { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram19 to > { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] > - at llvm.dbg.derivedtype23 = internal constant > %llvm.dbg.derivedtype.type { i32 458765, { }* null, i8* > getelementptr ([7 x i8]* @.str24, i32 0, i32 0), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 6, i64 32, i64 32, i64 32, i32 1, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at .str24 = internal constant [7 x i8] c"BarVar\00", section > "llvm.metadata" ; <[7 x i8]*> [#uses=1] > - at llvm.dbg.subprogram25 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr > ([9 x i8]* @.str26, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 12, { }* bitcast (%llvm.dbg.compositetype.type* > @llvm.dbg.compositetype27 to { }*), i1 false, i1 false }, section > "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] > - at .str26 = internal constant [9 x i8] c"Bar::Bar\00", section > "llvm.metadata" ; <[9 x i8]*> [#uses=1] > - at llvm.dbg.compositetype27 = internal constant > %llvm.dbg.compositetype.type { i32 458773, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* > bitcast ([3 x { }*]* @llvm.dbg.array29 to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] > - at llvm.dbg.derivedtype28 = internal constant > %llvm.dbg.derivedtype.type { i32 458768, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 64, i64 64, i64 0, i32 0, { }* bitcast > (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.array29 = internal constant [3 x { }*] [ { }* null, { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), > { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype28 to > { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] > - at llvm.dbg.subprogram30 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str8, i32 0, i32 0), i8* getelementptr > ([9 x i8]* @.str26, i32 0, i32 0), i8* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 > 12, { }* bitcast (%llvm.dbg.compositetype.type* > @llvm.dbg.compositetype31 to { }*), i1 false, i1 false }, section > "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] > - at llvm.dbg.compositetype31 = internal constant > %llvm.dbg.compositetype.type { i32 458773, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* > bitcast ([2 x { }*]* @llvm.dbg.array32 to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] > - at llvm.dbg.array32 = internal constant [2 x { }*] [ { }* null, { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { } > *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] > - at llvm.dbg.subprogram33 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* null, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([4 x i8]* @.str3, i32 0, i32 0), i8* getelementptr > ([9 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([14 x i8]* > @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 12, { }* bitcast > (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype34 to { }*), > i1 false, i1 false }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at llvm.dbg.compositetype34 = internal constant > %llvm.dbg.compositetype.type { i32 458773, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > null, { }* null, i32 0, i64 8, i64 8, i64 0, i32 0, { }* null, { }* > bitcast ([2 x { }*]* @llvm.dbg.array35 to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] > - at llvm.dbg.array35 = internal constant [2 x { }*] [ { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { } > *) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] > - at llvm.dbg.array36 = internal constant [5 x { }*] [ { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype9 to { }*), { }* > bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype23 to { } > *), { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram25 > to { }*), { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram30 to { }*), { }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram33 to { }*) ], > section "llvm.metadata" ; <[5 x { }*]*> [#uses=1] > - at llvm.dbg.variable37 = internal constant %llvm.dbg.variable.type > { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to { }*), i8* getelementptr ([4 x i8]* @.str38, > i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 15, { }* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] > - at .str38 = internal constant [4 x i8] c"tmp\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.subprogram39 = internal constant > %llvm.dbg.subprogram.type { i32 458798, { }* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* > getelementptr ([7 x i8]* @.str40, i32 0, i32 0), i8* getelementptr > ([7 x i8]* @.str40, i32 0, i32 0), i8* getelementptr ([11 x i8]* > @.str41, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 21, { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), i1 > false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at .str40 = internal constant [7 x i8] c"foobar\00", section > "llvm.metadata" ; <[7 x i8]*> [#uses=1] > - at .str41 = internal constant [11 x i8] c"_Z6foobarv\00", section > "llvm.metadata" ; <[11 x i8]*> [#uses=1] > - at llvm.dbg.variable42 = internal constant %llvm.dbg.variable.type > { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram39 to { }*), i8* getelementptr ([4 x i8]* > @.str38, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to { }*), i32 23, { }* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) }, > section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0] > - > -define i32 @_ZN3Bar3barEv(%struct.Bar* %this1) nounwind { > -entry: > - tail call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - tail call void @llvm.dbg.stoppoint(i32 14, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %0 = getelementptr %struct.Bar* %this1, i64 0, i32 0, i32 0 ; > [#uses=1] > - %1 = load i32* %0, align 4 ; [#uses=1] > - %2 = icmp sgt i32 %1, 0 ; [#uses=1] > - br i1 %2, label %bb, label %bb3 > - > -bb: ; preds = %entry > - %3 = getelementptr %struct.Bar* %this1, i64 0, i32 1 ; > [#uses=1] > - %4 = load i32* %3, align 4 ; [#uses=1] > - %5 = shl i32 %4, 1 ; [#uses=1] > - tail call void @llvm.dbg.stoppoint(i32 16, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - br label %bb4 > - > -bb3: ; preds = %entry > - tail call void @llvm.dbg.stoppoint(i32 18, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - br label %bb4 > - > -bb4: ; preds = %bb3, %bb > - %.0 = phi i32 [ 0, %bb3 ], [ %5, %bb ] ; [#uses=1] > - tail call void @llvm.dbg.stoppoint(i32 18, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - tail call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) > - ret i32 %.0 > -} > - > -declare void @llvm.dbg.func.start({ }*) nounwind > - > -declare void @llvm.dbg.declare({ }*, { }*) nounwind > - > -declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind > - > -declare void @llvm.dbg.region.end({ }*) nounwind > - > -define %struct.Bar* @_Z6foobarv() { > -entry: > - %retval = alloca %struct.Bar* ; <%struct.Bar**> [#uses=2] > - %tmp = alloca %struct.Bar* ; <%struct.Bar**> [#uses=3] > - %0 = alloca %struct.Bar* ; <%struct.Bar**> [#uses=2] > - %1 = alloca %struct.Bar* ; <%struct.Bar**> [#uses=3] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram39 to { }*)) > - %tmp1 = bitcast %struct.Bar** %tmp to { }* ; <{ }*> [#uses=1] > - call void @llvm.dbg.declare({ }* %tmp1, { }* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable42 to { }*)) > - call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %2 = call i8* @_Znwm(i64 8) ; [#uses=1] > - %3 = bitcast i8* %2 to %struct.Bar* ; <%struct.Bar*> [#uses=1] > - store %struct.Bar* %3, %struct.Bar** %1, align 8 > - %4 = load %struct.Bar** %1, align 8 ; <%struct.Bar*> [#uses=1] > - call void @_ZN3BarC1Ev(%struct.Bar* %4) nounwind > - %5 = load %struct.Bar** %1, align 8 ; <%struct.Bar*> [#uses=1] > - store %struct.Bar* %5, %struct.Bar** %tmp, align 8 > - call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - %6 = load %struct.Bar** %tmp, align 8 ; <%struct.Bar*> [#uses=1] > - store %struct.Bar* %6, %struct.Bar** %0, align 8 > - %7 = load %struct.Bar** %0, align 8 ; <%struct.Bar*> [#uses=1] > - store %struct.Bar* %7, %struct.Bar** %retval, align 8 > - br label %return > - > -return: ; preds = %entry > - %retval2 = load %struct.Bar** %retval ; <%struct.Bar*> [#uses=1] > - call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) > - call void @llvm.dbg.region.end({ }* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram39 to { }*)) > - ret %struct.Bar* %retval2 > -} > - > -declare i8* @_Znwm(i64) > - > -declare void @_ZN3BarC1Ev(%struct.Bar*) nounwind > > Removed: llvm/trunk/test/DebugInfo/printdbginfo2.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo2.ll?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/DebugInfo/printdbginfo2.ll (original) > +++ llvm/trunk/test/DebugInfo/printdbginfo2.ll (removed) > @@ -1,74 +0,0 @@ > -; RUN: llvm-as < %s | opt -print-dbginfo -disable-output > %t1 > -; RUN: grep {%b is variable b of type x declared at x.c:7} %t1 > -; RUN: grep {%2 is variable b of type x declared at x.c:7} %t1 > -; RUN: grep {@c.1442 is variable c of type int declared at x.c:4} %t1 > - type { } ; type %0 > - %llvm.dbg.anchor.type = type { i32, i32 } > - %llvm.dbg.basictype.type = type { i32, %0*, i8*, %0*, i32, i64, > i64, i64, i32, i32 } > - %llvm.dbg.compile_unit.type = type { i32, %0*, i32, i8*, i8*, i8*, > i1, i1, i8*, i32 } > - %llvm.dbg.composite.type = type { i32, %0*, i8*, %0*, i32, i64, > i64, i64, i32, %0*, %0*, i32 } > - %llvm.dbg.derivedtype.type = type { i32, %0*, i8*, %0*, i32, i64, > i64, i64, i32, %0* } > - %llvm.dbg.global_variable.type = type { i32, %0*, %0*, i8*, i8*, > i8*, %0*, i32, %0*, i1, i1, %0* } > - %llvm.dbg.subprogram.type = type { i32, %0*, %0*, i8*, i8*, i8*, > %0*, i32, %0*, i1, i1 } > - %llvm.dbg.subrange.type = type { i32, i64, i64 } > - %llvm.dbg.variable.type = type { i32, %0*, i8*, %0*, i32, %0* } > - %struct..0x = type { i32 } > - at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 17 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str = internal constant [4 x i8] c"x.c\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at .str1 = internal constant [27 x i8] c"/home/edwin/llvm-svn/llvm/ > \00", section "llvm.metadata" ; <[27 x i8]*> [#uses=1] > - at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. > build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8] > *> [#uses=1] > - at llvm.dbg.compile_unit = internal constant > %llvm.dbg.compile_unit.type { i32 458769, %0* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %0*), i32 1, i8* > getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr > ([27 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* > @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section > "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] > - at .str3 = internal constant [4 x i8] c"int\00", section > "llvm.metadata" ; <[4 x i8]*> [#uses=1] > - at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type > { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to %0*), i8* getelementptr ([4 x i8]* @.str3, > i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, > i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> > [#uses=1] > - at llvm.dbg.array = internal constant [1 x %0*] [%0* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*)], section > "llvm.metadata" ; <[1 x %0*]*> [#uses=1] > - at llvm.dbg.composite = internal constant %llvm.dbg.composite.type > { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, > i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]* > @llvm.dbg.array to %0*), i32 0 }, section "llvm.metadata" ; < > %llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type > { i32 458752, i32 46 }, section "llvm.metadata" ; < > %llvm.dbg.anchor.type*> [#uses=1] > - at .str4 = internal constant [5 x i8] c"main\00", section > "llvm.metadata" ; <[5 x i8]*> [#uses=1] > - at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type > { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* > @llvm.dbg.subprograms to %0*), %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* > getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* getelementptr > ([5 x i8]* @.str4, i32 0, i32 0), i8* null, %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 2, > %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to %0*), > i1 false, i1 true }, section "llvm.metadata" ; < > %llvm.dbg.subprogram.type*> [#uses=1] > - at .str5 = internal constant [2 x i8] c"x\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at .str7 = internal constant [2 x i8] c"a\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.derivedtype = internal constant > %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*), i8* > getelementptr ([2 x i8]* @.str7, i32 0, i32 0), %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 6, > i64 32, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.basictype.type* > @llvm.dbg.basictype to %0*) }, section "llvm.metadata" ; < > %llvm.dbg.derivedtype.type*> [#uses=1] > - at llvm.dbg.array8 = internal constant [1 x %0*] [%0* bitcast > (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %0*)], section > "llvm.metadata" ; <[1 x %0*]*> [#uses=1] > - at llvm.dbg.composite9 = internal constant %llvm.dbg.composite.type > { i32 458771, %0* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str5, > i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to %0*), i32 5, i64 32, i64 32, i64 0, i32 0, > %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array8 to %0*), i32 0 }, > section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] > - at .str10 = internal constant [2 x i8] c"b\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.variable = internal constant %llvm.dbg.variable.type > { i32 459008, %0* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str10, > i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to %0*), i32 7, %0* bitcast > (%llvm.dbg.composite.type* @llvm.dbg.composite9 to %0*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type > { i32 458785, i64 0, i64 3 }, section "llvm.metadata" ; < > %llvm.dbg.subrange.type*> [#uses=1] > - at llvm.dbg.array11 = internal constant [1 x %0*] [%0* bitcast > (%llvm.dbg.subrange.type* @llvm.dbg.subrange to %0*)], section > "llvm.metadata" ; <[1 x %0*]*> [#uses=1] > - at llvm.dbg.composite12 = internal constant %llvm.dbg.composite.type > { i32 458753, %0* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, > i64 128, i64 32, i64 0, i32 0, %0* bitcast > (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*), %0* bitcast > ([1 x %0*]* @llvm.dbg.array11 to %0*), i32 0 }, section > "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] > - at llvm.dbg.variable13 = internal constant %llvm.dbg.variable.type > { i32 459008, %0* bitcast (%llvm.dbg.subprogram.type* > @llvm.dbg.subprogram to %0*), i8* getelementptr ([2 x i8]* @.str7, > i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* > @llvm.dbg.compile_unit to %0*), i32 3, %0* bitcast > (%llvm.dbg.composite.type* @llvm.dbg.composite12 to %0*) }, section > "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] > - at c.1442 = internal global i32 5 ; [#uses=2] > - at llvm.dbg.global_variables = linkonce constant > %llvm.dbg.anchor.type { i32 458752, i32 52 }, section > "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] > - at .str14 = internal constant [7 x i8] c"c.1442\00", section > "llvm.metadata" ; <[7 x i8]*> [#uses=1] > - at .str15 = internal constant [2 x i8] c"c\00", section > "llvm.metadata" ; <[2 x i8]*> [#uses=1] > - at llvm.dbg.global_variable = internal constant > %llvm.dbg.global_variable.type { i32 458804, %0* bitcast > (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to %0*), %0* > bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to > %0*), i8* getelementptr ([7 x i8]* @.str14, i32 0, i32 0), i8* > getelementptr ([2 x i8]* @.str15, i32 0, i32 0), i8* null, %0* > bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to > %0*), i32 4, %0* bitcast (%llvm.dbg.basictype.type* > @llvm.dbg.basictype to %0*), i1 true, i1 true, %0* bitcast (i32* @c. > 1442 to %0*) }, section "llvm.metadata" ; < > %llvm.dbg.global_variable.type*> [#uses=0] > - > -define i32 @main() nounwind { > -entry: > - %b = alloca %struct..0x ; <%struct..0x*> [#uses=2] > - %a = alloca [4 x i32] ; <[4 x i32]*> [#uses=1] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - call void @llvm.dbg.func.start(%0* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*)) > - %0 = bitcast %struct..0x* %b to %0* ; <%0*> [#uses=1] > - call void @llvm.dbg.declare(%0* %0, %0* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable to %0*)) > - %1 = bitcast [4 x i32]* %a to %0* ; <%0*> [#uses=1] > - call void @llvm.dbg.declare(%0* %1, %0* bitcast > (%llvm.dbg.variable.type* @llvm.dbg.variable13 to %0*)) > - call void @llvm.dbg.stoppoint(i32 8, i32 0, %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*)) > - %2 = getelementptr %struct..0x* %b, i32 0, i32 0 ; [#uses=1] > - store i32 5, i32* %2, align 4 > - call void @llvm.dbg.stoppoint(i32 9, i32 0, %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*)) > - %3 = load i32* @c.1442, align 4 ; [#uses=1] > - br label %return > - > -return: ; preds = %entry > - call void @llvm.dbg.stoppoint(i32 9, i32 0, %0* bitcast > (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*)) > - call void @llvm.dbg.region.end(%0* bitcast > (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*)) > - ret i32 %3 > -} > - > -declare void @llvm.dbg.func.start(%0*) nounwind readnone > - > -declare void @llvm.dbg.declare(%0*, %0*) nounwind readnone > - > -declare void @llvm.dbg.stoppoint(i32, i32, %0*) nounwind readnone > - > -declare void @llvm.dbg.region.end(%0*) nounwind readnone > > Removed: llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-02-16-AnonTypedef-Dbg.cpp?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp > (original) > +++ llvm/trunk/test/FrontendC++/2009-02-16-AnonTypedef-Dbg.cpp > (removed) > @@ -1,5 +0,0 @@ > -// Test on debug info to make sure that anon typedef info is emitted. > -// RUN: %llvmgcc -S --emit-llvm -x c++ -g %s -o - | grep composite > -typedef struct { int a; long b; } foo; > -foo x; > - > > Removed: llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m?rev=79976&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m > (original) > +++ llvm/trunk/test/FrontendObjC/2009-02-17-RunTimeVer-dbg.m (removed) > @@ -1,13 +0,0 @@ > -// RUN: %llvmgcc -x objective-c -S %s -g --emit-llvm -o - | grep > "dbg.compile_unit =" | grep "null, i32" > -// Last parameter represent i32 runtime version id. The previous > paramenter > -// encodes command line flags when certain env. variables are set. > In this > -// example it is the only compile_unit parameter that is null. This > test case > -// tests existence of new additional compile_unit parameter to encode > -// Objective-C runtime version number. > - > - at interface foo > - at end > - at implementation foo > - at end > - > -void fn(foo *f) {} > > Modified: llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll?rev=79977&r1=79976&r2=79977&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll (original) > +++ llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll Tue Aug 25 > 00:24:07 2009 > @@ -1,5 +1,3 @@ > -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep region | > count 2 > -; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | grep func.start > | count 2 > ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep "br > label" > > %llvm.dbg.anchor.type = type { i32, i32 } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From astifter at gmx.at Wed Aug 26 04:05:22 2009 From: astifter at gmx.at (Andreas Neustifter) Date: Wed, 26 Aug 2009 09:05:22 -0000 Subject: [llvm-commits] [llvm] r80076 - /llvm/trunk/tools/llvm-prof/llvm-prof.cpp Message-ID: <200908260905.n7Q95MsM020092@zion.cs.uiuc.edu> Author: astifter Date: Wed Aug 26 04:05:21 2009 New Revision: 80076 URL: http://llvm.org/viewvc/llvm-project?rev=80076&view=rev Log: Changed std::cout to outs(), retaining formating. Modified: llvm/trunk/tools/llvm-prof/llvm-prof.cpp Modified: llvm/trunk/tools/llvm-prof/llvm-prof.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-prof/llvm-prof.cpp?rev=80076&r1=80075&r2=80076&view=diff ============================================================================== --- llvm/trunk/tools/llvm-prof/llvm-prof.cpp (original) +++ llvm/trunk/tools/llvm-prof/llvm-prof.cpp Wed Aug 26 04:05:21 2009 @@ -27,6 +27,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/Format.h" #include "llvm/System/Signals.h" #include #include @@ -172,32 +173,32 @@ for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) TotalExecutions += FunctionCounts[i].second; - std::cout << "===" << std::string(73, '-') << "===\n" - << "LLVM profiling output for execution"; - if (PIL.getNumExecutions() != 1) std::cout << "s"; - std::cout << ":\n"; + outs() << "===" << std::string(73, '-') << "===\n" + << "LLVM profiling output for execution"; + if (PIL.getNumExecutions() != 1) outs() << "s"; + outs() << ":\n"; for (unsigned i = 0, e = PIL.getNumExecutions(); i != e; ++i) { - std::cout << " "; - if (e != 1) std::cout << i+1 << ". "; - std::cout << PIL.getExecution(i) << "\n"; + outs() << " "; + if (e != 1) outs() << i+1 << ". "; + outs() << PIL.getExecution(i) << "\n"; } - std::cout << "\n===" << std::string(73, '-') << "===\n"; - std::cout << "Function execution frequencies:\n\n"; + outs() << "\n===" << std::string(73, '-') << "===\n"; + outs() << "Function execution frequencies:\n\n"; // Print out the function frequencies... - std::cout << " ## Frequency\n"; + outs() << " ## Frequency\n"; for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) { if (FunctionCounts[i].second == 0) { - std::cout << "\n NOTE: " << e-i << " function" << - (e-i-1 ? "s were" : " was") << " never executed!\n"; + outs() << "\n NOTE: " << e-i << " function" + << (e-i-1 ? "s were" : " was") << " never executed!\n"; break; } - std::cout << std::setw(3) << i+1 << ". " - << std::setw(5) << FunctionCounts[i].second << "/" - << TotalExecutions << " " + outs() << format("%3d", i+1) << ". " + << format("%5.2g", FunctionCounts[i].second) << "/" + << format("%g", TotalExecutions) << " " << FunctionCounts[i].first->getNameStr() << "\n"; } @@ -211,29 +212,28 @@ sort(Counts.begin(), Counts.end(), PairSecondSortReverse()); - std::cout << "\n===" << std::string(73, '-') << "===\n"; - std::cout << "Top 20 most frequently executed basic blocks:\n\n"; + outs() << "\n===" << std::string(73, '-') << "===\n"; + outs() << "Top 20 most frequently executed basic blocks:\n\n"; // Print out the function frequencies... - std::cout <<" ## %% \tFrequency\n"; + outs() <<" ## %% \tFrequency\n"; unsigned BlocksToPrint = Counts.size(); if (BlocksToPrint > 20) BlocksToPrint = 20; for (unsigned i = 0; i != BlocksToPrint; ++i) { if (Counts[i].second == 0) break; Function *F = Counts[i].first->getParent(); - std::cout << std::setw(3) << i+1 << ". " - << std::setw(5) << std::setprecision(3) - << Counts[i].second/(double)TotalExecutions*100 << "% " - << std::setw(5) << Counts[i].second << "/" - << TotalExecutions << "\t" - << F->getNameStr() << "() - " - << Counts[i].first->getNameStr() << "\n"; + outs() << format("%3d", i+1) << ". " + << format("%5g", Counts[i].second/(double)TotalExecutions*100) << "% " + << format("%5.0f", Counts[i].second) << "/" + << format("%g", TotalExecutions) << "\t" + << F->getNameStr() << "() - " + << Counts[i].first->getNameStr() << "\n"; FunctionsToPrint.insert(F); } if (PrintAnnotatedLLVM || PrintAllCode) { - std::cout << "\n===" << std::string(73, '-') << "===\n"; - std::cout << "Annotated LLVM code for the module:\n\n"; + outs() << "\n===" << std::string(73, '-') << "===\n"; + outs() << "Annotated LLVM code for the module:\n\n"; ProfileAnnotator PA(PI); From daniel at zuster.org Wed Aug 26 04:16:35 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 09:16:35 -0000 Subject: [llvm-commits] [llvm] r80077 - /llvm/trunk/tools/llvm-mc/AsmParser.cpp Message-ID: <200908260916.n7Q9GZPQ021861@zion.cs.uiuc.edu> Author: ddunbar Date: Wed Aug 26 04:16:34 2009 New Revision: 80077 URL: http://llvm.org/viewvc/llvm-project?rev=80077&view=rev Log: llvm-mc: Make non-sensical max bytes to .align an error. Also, warn about overflow in alignment values. Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=80077&r1=80076&r2=80077&view=diff ============================================================================== --- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original) +++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Wed Aug 26 04:16:34 2009 @@ -1024,6 +1024,7 @@ /// ParseDirectiveAlign /// ::= {.align, ...} expression [ , expression [ , expression ]] bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) { + SMLoc AlignmentLoc = Lexer.getLoc(); int64_t Alignment; if (ParseAbsoluteExpression(Alignment)) return true; @@ -1070,15 +1071,19 @@ // Compute alignment in bytes. if (IsPow2) { // FIXME: Diagnose overflow. - Alignment = 1LL << Alignment; + if (Alignment >= 32) { + Error(AlignmentLoc, "invalid alignment value"); + Alignment = 31; + } + + Alignment = 1 << Alignment; } - // Diagnose non-sensical max bytes to fill, which are treated as missing (this - // matches 'as'). + // Diagnose non-sensical max bytes to align. if (MaxBytesLoc.isValid()) { if (MaxBytesToFill < 1) { - Warning(MaxBytesLoc, "alignment directive can never be satisfied in this " - "many bytes, ignoring maximum bytes expression"); + Error(MaxBytesLoc, "alignment directive can never be satisfied in this " + "many bytes, ignoring maximum bytes expression"); MaxBytesToFill = 0; } From daniel at zuster.org Wed Aug 26 04:16:46 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 09:16:46 -0000 Subject: [llvm-commits] [llvm] r80078 - in /llvm/trunk: include/llvm/MC/MCValue.h tools/llvm-mc/AsmExpr.cpp Message-ID: <200908260916.n7Q9GlGl021902@zion.cs.uiuc.edu> Author: ddunbar Date: Wed Aug 26 04:16:46 2009 New Revision: 80078 URL: http://llvm.org/viewvc/llvm-project?rev=80078&view=rev Log: llvm-mc: Make MCValue take const MCSymbol*s. Modified: llvm/trunk/include/llvm/MC/MCValue.h llvm/trunk/tools/llvm-mc/AsmExpr.cpp Modified: llvm/trunk/include/llvm/MC/MCValue.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCValue.h?rev=80078&r1=80077&r2=80078&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCValue.h (original) +++ llvm/trunk/include/llvm/MC/MCValue.h Wed Aug 26 04:16:46 2009 @@ -33,13 +33,13 @@ /// Note that this class must remain a simple POD value class, because we need /// it to live in unions etc. class MCValue { - MCSymbol *SymA, *SymB; + const MCSymbol *SymA, *SymB; int64_t Cst; public: int64_t getConstant() const { return Cst; } - MCSymbol *getSymA() const { return SymA; } - MCSymbol *getSymB() const { return SymB; } + const MCSymbol *getSymA() const { return SymA; } + const MCSymbol *getSymB() const { return SymB; } /// isAbsolute - Is this an absolute (as opposed to relocatable) value. bool isAbsolute() const { return !SymA && !SymB; } @@ -60,7 +60,8 @@ /// dump - Print the value to stderr. void dump() const; - static MCValue get(MCSymbol *SymA, MCSymbol *SymB = 0, int64_t Val = 0) { + static MCValue get(const MCSymbol *SymA, const MCSymbol *SymB = 0, + int64_t Val = 0) { MCValue R; assert((!SymB || SymA) && "Invalid relocatable MCValue!"); R.Cst = Val; Modified: llvm/trunk/tools/llvm-mc/AsmExpr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmExpr.cpp?rev=80078&r1=80077&r2=80078&view=diff ============================================================================== --- llvm/trunk/tools/llvm-mc/AsmExpr.cpp (original) +++ llvm/trunk/tools/llvm-mc/AsmExpr.cpp Wed Aug 26 04:16:46 2009 @@ -26,16 +26,16 @@ return true; } -static bool EvaluateSymbolicAdd(const MCValue &LHS, MCSymbol *RHS_A, - MCSymbol *RHS_B, int64_t RHS_Cst, +static bool EvaluateSymbolicAdd(const MCValue &LHS, const MCSymbol *RHS_A, + const MCSymbol *RHS_B, int64_t RHS_Cst, MCValue &Res) { // We can't add or subtract two symbols. if ((LHS.getSymA() && RHS_A) || (LHS.getSymB() && RHS_B)) return false; - MCSymbol *A = LHS.getSymA() ? LHS.getSymA() : RHS_A; - MCSymbol *B = LHS.getSymB() ? LHS.getSymB() : RHS_B; + const MCSymbol *A = LHS.getSymA() ? LHS.getSymA() : RHS_A; + const MCSymbol *B = LHS.getSymB() ? LHS.getSymB() : RHS_B; if (B) { // If we have a negated symbol, then we must have also have a non-negated // symbol in order to encode the expression. We can do this check later to From daniel at zuster.org Wed Aug 26 04:16:57 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 26 Aug 2009 09:16:57 -0000 Subject: [llvm-commits] [llvm] r80079 - in /llvm/trunk: include/llvm/MC/MCContext.h lib/MC/MCContext.cpp Message-ID: <200908260916.n7Q9Gvv5021937@zion.cs.uiuc.edu> Author: ddunbar Date: Wed Aug 26 04:16:57 2009 New Revision: 80079 URL: http://llvm.org/viewvc/llvm-project?rev=80079&view=rev Log: llvm-mc: Change MCContext value table to take const MCSymbol*s. Modified: llvm/trunk/include/llvm/MC/MCContext.h llvm/trunk/lib/MC/MCContext.cpp Modified: llvm/trunk/include/llvm/MC/MCContext.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=80079&r1=80078&r2=80079&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCContext.h (original) +++ llvm/trunk/include/llvm/MC/MCContext.h Wed Aug 26 04:16:57 2009 @@ -36,7 +36,7 @@ /// SymbolValues - Bindings of symbols to values. // // FIXME: Is there a good reason to not just put this in the MCSymbol? - DenseMap SymbolValues; + DenseMap SymbolValues; /// Allocator - Allocator object used for creating machine code objects. /// @@ -70,17 +70,15 @@ /// LookupSymbol - Get the symbol for @param Name, or null. MCSymbol *LookupSymbol(const StringRef &Name) const; - /// ClearSymbolValue - Erase a value binding for @param Symbol, if one - /// exists. - void ClearSymbolValue(MCSymbol *Symbol); - - /// SetSymbolValue - Set the value binding for @param Symbol to @param - /// Value. - void SetSymbolValue(MCSymbol *Symbol, const MCValue &Value); + /// ClearSymbolValue - Erase a value binding for @arg Symbol, if one exists. + void ClearSymbolValue(const MCSymbol *Symbol); - /// GetSymbolValue - Return the current value for @param Symbol, or null if + /// SetSymbolValue - Set the value binding for @arg Symbol to @arg Value. + void SetSymbolValue(const MCSymbol *Symbol, const MCValue &Value); + + /// GetSymbolValue - Return the current value for @arg Symbol, or null if /// none exists. - const MCValue *GetSymbolValue(MCSymbol *Symbol) const; + const MCValue *GetSymbolValue(const MCSymbol *Symbol) const; void *Allocate(unsigned Size, unsigned Align = 8) { return Allocator.Allocate(Size, Align); Modified: llvm/trunk/lib/MC/MCContext.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=80079&r1=80078&r2=80079&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCContext.cpp (original) +++ llvm/trunk/lib/MC/MCContext.cpp Wed Aug 26 04:16:57 2009 @@ -54,16 +54,16 @@ return Symbols.lookup(Name); } -void MCContext::ClearSymbolValue(MCSymbol *Sym) { +void MCContext::ClearSymbolValue(const MCSymbol *Sym) { SymbolValues.erase(Sym); } -void MCContext::SetSymbolValue(MCSymbol *Sym, const MCValue &Value) { +void MCContext::SetSymbolValue(const MCSymbol *Sym, const MCValue &Value) { SymbolValues[Sym] = Value; } -const MCValue *MCContext::GetSymbolValue(MCSymbol *Sym) const { - DenseMap::iterator it = SymbolValues.find(Sym); +const MCValue *MCContext::GetSymbolValue(const MCSymbol *Sym) const { + DenseMap::iterator it = SymbolValues.find(Sym); if (it == SymbolValues.end()) return 0; From baldrick at free.fr Wed Aug 26 04:51:02 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 26 Aug 2009 09:51:02 -0000 Subject: [llvm-commits] [gcc-plugin] r80080 - /gcc-plugin/trunk/llvm-backend.cpp Message-ID: <200908260951.n7Q9p2gS026212@zion.cs.uiuc.edu> Author: baldrick Date: Wed Aug 26 04:51:02 2009 New Revision: 80080 URL: http://llvm.org/viewvc/llvm-project?rev=80080&view=rev Log: Compile fix due to LLVM API change: F_Force no longer exists, it is now the default. Modified: gcc-plugin/trunk/llvm-backend.cpp Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=80080&r1=80079&r2=80080&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Wed Aug 26 04:51:02 2009 @@ -606,12 +606,9 @@ static void InitializeOutputStreams(bool Binary) { assert(!OutStream && "Output stream already initialized!"); std::string Error; - unsigned Flags = raw_fd_ostream::F_Force; - if (Binary) - Flags |= raw_fd_ostream::F_Binary; - - OutStream = new raw_fd_ostream(llvm_asm_file_name, Error, Flags); + OutStream = new raw_fd_ostream(llvm_asm_file_name, Error, + Binary ? raw_fd_ostream::F_Binary : 0); if (!Error.empty()) llvm_report_error(Error); From xerxes at zafena.se Wed Aug 26 06:05:51 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Wed, 26 Aug 2009 13:05:51 +0200 Subject: [llvm-commits] [patch] cmake make it possible to set LLVM_NATIVE_ARCH when cross compiling. Message-ID: <4A95170F.5000204@zafena.se> During cross compilation of llvm using cmake it are desirable to be able to set the LLVM_NATIVE_ARCH so that the correct JIT can get linked in and be used by the final cross compiled binarys. This patch enables the cmake option -DLLVM_NATIVE_ARCH=ARM If the value host are used then the cmake system will autodetect the setting from the host system. I have forced MSVC builds to use X86 as default. Ok to push? Cheers Xerxes -------------- next part -------------- A non-text attachment was scrubbed... Name: overridable_LLVM_NATIVE_ARCH.patch Type: text/x-patch Size: 1574 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090826/9c945838/attachment.bin From baldrick at free.fr Wed Aug 26 06:33:23 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 26 Aug 2009 11:33:23 -0000 Subject: [llvm-commits] [gcc-plugin] r80081 - in /gcc-plugin/trunk: i386/llvm-target.cpp llvm-backend.cpp llvm-convert.cpp llvm-debug.cpp llvm-types.cpp Message-ID: <200908261133.n7QBXN6E006338@zion.cs.uiuc.edu> Author: baldrick Date: Wed Aug 26 06:33:23 2009 New Revision: 80081 URL: http://llvm.org/viewvc/llvm-project?rev=80081&view=rev Log: Remove a bunch of unused variables. Modified: gcc-plugin/trunk/i386/llvm-target.cpp gcc-plugin/trunk/llvm-backend.cpp gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-debug.cpp gcc-plugin/trunk/llvm-types.cpp Modified: gcc-plugin/trunk/i386/llvm-target.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/i386/llvm-target.cpp?rev=80081&r1=80080&r2=80081&view=diff ============================================================================== --- gcc-plugin/trunk/i386/llvm-target.cpp (original) +++ gcc-plugin/trunk/i386/llvm-target.cpp Wed Aug 26 06:33:23 2009 @@ -1318,7 +1318,6 @@ return NULL; const StructType *STy = cast(Ty); - unsigned NumElements = STy->getNumElements(); std::vector ElementTypes; // Special handling for _Complex. @@ -1418,7 +1417,7 @@ } // Special treatement for _Complex. - if (const StructType *ComplexType = dyn_cast(DestElemType)) { + if (isa(DestElemType)) { llvm::Value *Idxs[3]; Idxs[0] = ConstantInt::get(llvm::Type::getInt32Ty(Context), 0); Idxs[1] = ConstantInt::get(llvm::Type::getInt32Ty(Context), DNO); Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=80081&r1=80080&r2=80081&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Wed Aug 26 06:33:23 2009 @@ -1119,8 +1119,6 @@ TREE_ASM_WRITTEN(decl) = 1; return; // Do not process broken code. } - - LLVMContext &Context = getGlobalContext(); //TODO timevar_push(TV_LLVM_GLOBALS); @@ -1318,8 +1316,6 @@ // been set. Don't crash. // We can also get here when DECL_LLVM has not been set for some object // referenced in the initializer. Don't crash then either. - LLVMContext &Context = getGlobalContext(); - if (errorcount || sorrycount) return; @@ -1385,8 +1381,6 @@ if (!TYPE_SIZE(TREE_TYPE(decl))) return; - LLVMContext &Context = getGlobalContext(); - //TODO timevar_push(TV_LLVM_GLOBALS); // Get or create the global variable now. @@ -1547,7 +1541,6 @@ /// well-formed. If not, emit error messages and return true. If so, return /// false. bool ValidateRegisterVariable(tree decl) { - LLVMContext &Context = getGlobalContext(); int RegNumber = decode_reg_name(extractRegisterName(decl)); const Type *Ty = ConvertType(TREE_TYPE(decl)); Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=80081&r1=80080&r2=80081&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Wed Aug 26 06:33:23 2009 @@ -2197,9 +2197,9 @@ if (UnwindBB) { CreateExceptionValues(); EmitBlock(UnwindBB); - // Fetch and store exception handler. - Value *Arg = Builder.CreateLoad(ExceptionValue, "eh_ptr"); abort();//FIXME +//FIXME // Fetch and store exception handler. +//FIXME Value *Arg = Builder.CreateLoad(ExceptionValue, "eh_ptr"); //FIXME assert(llvm_unwind_resume_libfunc && "no unwind resume function!"); //FIXME //FIXME // As we're emitting a naked call (not an expression) going through @@ -3495,8 +3495,6 @@ Value *TreeToLLVM::EmitTruthOp(tree exp, unsigned Opc) { Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); - bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))); - bool RHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1))); // This is a truth operation like the strict &&,||,^^. Convert to bool as // a test against zero @@ -4391,7 +4389,6 @@ for (tree Output = ASM_OUTPUTS(exp); Output; Output = TREE_CHAIN(Output), ++ValNum) { tree Operand = TREE_VALUE(Output); - tree type = TREE_TYPE(Operand); // Parse the output constraint. const char *Constraint = Constraints[ValNum]; @@ -6132,21 +6129,16 @@ return true; } - tree last_parm = tree_last(DECL_ARGUMENTS(current_function_decl)); tree chain = TREE_CHAIN(arglist); // Check for errors. if (fold_builtin_next_arg (chain, true)) return true; - tree arg = TREE_VALUE(chain); - Value *ArgVal = Emit(TREE_VALUE(arglist), 0); Constant *llvm_va_start_fn = Intrinsic::getDeclaration(TheModule, Intrinsic::vastart); - const Type *FTy = - cast(llvm_va_start_fn->getType())->getElementType(); ArgVal = BitCastToType(ArgVal, PointerType::getUnqual(Type::getInt8Ty(Context))); Builder.CreateCall(llvm_va_start_fn, ArgVal); return true; @@ -6391,7 +6383,6 @@ Value *TreeToLLVM::EmitFieldAnnotation(Value *FieldPtr, tree FieldDecl) { tree AnnotateAttr = lookup_attribute("annotate", DECL_ATTRIBUTES(FieldDecl)); - const Type *OrigPtrTy = FieldPtr->getType(); const Type *SBP = PointerType::getUnqual(Type::getInt8Ty(Context)); Function *Fn = Intrinsic::getDeclaration(TheModule, @@ -6775,6 +6766,7 @@ && (TREE_STATIC(exp) || DECL_EXTERNAL(exp))) { layout_decl(exp, 0); +#if 0 // This mirrors code in layout_decl for munging the RTL. Here we actually // emit a NEW declaration for the global variable, now that it has been // laid out. We then tell the compiler to "forward" any uses of the old @@ -6782,13 +6774,12 @@ if (Value *Val = DECL_LLVM_IF_SET(exp)) { //fprintf(stderr, "***\n*** SHOULD HANDLE GLOBAL VARIABLES!\n***\n"); //assert(0 && "Reimplement this with replace all uses!"); -#if 0 SET_DECL_LLVM(exp, 0); // Create a new global variable declaration llvm_assemble_external(exp); V2GV(Val)->ForwardedGlobal = V2GV(DECL_LLVM(exp)); -#endif } +#endif } } @@ -6887,7 +6878,7 @@ } else { // If the input is a scalar, emit to a temporary. Value *Dest = CreateTemporary(ConvertType(TREE_TYPE(Op))); - StoreInst *S = Builder.CreateStore(Emit(Op, 0), Dest); + Builder.CreateStore(Emit(Op, 0), Dest); // The type is the type of the expression. Dest = BitCastToType(Dest, PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); @@ -8061,7 +8052,6 @@ // BitStart - This is the actu