From sabre at nondot.org Mon Jul 27 00:32:17 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 05:32:17 -0000
Subject: [llvm-commits] [llvm] r77184 - in /llvm/trunk: include/llvm/Target/
lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/Target/ lib/Target/ARM/
lib/Target/ARM/AsmPrinter/ lib/Target/CellSPU/ lib/Target/MSP430/
lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/
lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/ lib/Target/SystemZ/
lib/Target/X86/ lib/Target/X86/AsmPrinter/ lib/Target/XCore/
Message-ID: <200907270532.n6R5WI4G011799@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 00:32:16 2009
New Revision: 77184
URL: http://llvm.org/viewvc/llvm-project?rev=77184&view=rev
Log:
Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.
Modified:
llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/ELFWriter.cpp
llvm/trunk/lib/CodeGen/ELFWriter.h
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp
llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp
llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.h
llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp
llvm/trunk/lib/Target/TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Mon Jul 27 00:32:16 2009
@@ -31,19 +31,16 @@
virtual const Section *
getSectionForMergeableConstant(SectionKind Kind) const;
- /// getFlagsForNamedSection - If this target wants to be able to infer
- /// section flags based on the name of the section specified for a global
- /// variable, it can implement this. This is used on ELF systems so that
- /// ".tbss" gets the TLS bit set etc.
- virtual unsigned getFlagsForNamedSection(const char *Section) const;
+ virtual SectionKind::Kind getKindForNamedSection(const char *Section,
+ SectionKind::Kind K) const;
+ void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const;
const char *getSectionPrefixForUniqueGlobal(SectionKind Kind) const;
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
SectionKind Kind) const;
- virtual void getSectionFlags(unsigned Flags,
- SmallVectorImpl &Str) const;
-
+
const Section *DataRelSection;
const Section *DataRelLocalSection;
const Section *DataRelROSection;
Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Jul 27 00:32:16 2009
@@ -22,6 +22,9 @@
namespace llvm {
template class SmallVectorImpl;
+ class TargetMachine;
+ class GlobalValue;
+ class Mangler;
// DWARF encoding query type
namespace DwarfEncoding {
@@ -39,8 +42,12 @@
///
/// The comments below describe these as if they were an inheritance hierarchy
/// in order to explain the predicates below.
- struct SectionKind {
+ class SectionKind {
+ public:
enum Kind {
+ /// Metadata - Debug info sections or other metadata.
+ Metadata,
+
/// Text - Text section, used for functions and other executable code.
Text,
@@ -140,6 +147,8 @@
bool isWeak() const { return Weak; }
bool hasExplicitSection() const { return ExplicitSection; }
+
+ bool isMetadata() const { return K == Metadata; }
bool isText() const { return K == Text; }
bool isReadOnly() const {
@@ -191,7 +200,7 @@
return K == ReadOnlyWithRelLocal;
}
- static SectionKind get(Kind K, bool isWeak,
+ static SectionKind get(Kind K, bool isWeak = false,
bool hasExplicitSection = false) {
SectionKind Res;
Res.K = K;
@@ -201,65 +210,18 @@
}
};
- namespace SectionFlags {
- const unsigned Invalid = -1U;
- const unsigned None = 0;
- const unsigned Code = 1 << 0; ///< Section contains code
- const unsigned Writable = 1 << 1; ///< Section is writeable
- const unsigned BSS = 1 << 2; ///< Section contains only zeroes
- const unsigned Mergeable = 1 << 3; ///< Section contains mergeable data
- const unsigned Strings = 1 << 4; ///< Section contains C-type strings
- const unsigned TLS = 1 << 5; ///< Section contains thread-local data
- const unsigned Debug = 1 << 6; ///< Section contains debug data
- const unsigned Linkonce = 1 << 7; ///< Section is linkonce
- const unsigned TypeFlags = 0xFF;
- // Some gap for future flags
-
- /// Named - True if this section should be printed with ".section ",
- /// false if the section name is something like ".const".
- const unsigned Named = 1 << 23; ///< Section is named
- const unsigned EntitySize = 0xFF << 24; ///< Entity size for mergeable stuff
-
- static inline unsigned getEntitySize(unsigned Flags) {
- return (Flags >> 24) & 0xFF;
- }
-
- // FIXME: Why does this return a value?
- static inline unsigned setEntitySize(unsigned Flags, unsigned Size) {
- return (Flags & ~EntitySize) | ((Size & 0xFF) << 24);
- }
-
- struct KeyInfo {
- static inline unsigned getEmptyKey() { return Invalid; }
- static inline unsigned getTombstoneKey() { return Invalid - 1; }
- static unsigned getHashValue(const unsigned &Key) { return Key; }
- static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
- static bool isPod() { return true; }
- };
- }
-
- class TargetMachine;
- class CallInst;
- class GlobalValue;
- class Type;
- class Mangler;
-
class Section {
friend class TargetAsmInfo;
friend class StringMapEntry;
friend class StringMap;
std::string Name;
- unsigned Flags;
- explicit Section(unsigned F = SectionFlags::Invalid) : Flags(F) { }
+ SectionKind Kind;
+ explicit Section() { }
public:
- unsigned getEntitySize() const { return (Flags >> 24) & 0xFF; }
-
const std::string &getName() const { return Name; }
- unsigned getFlags() const { return Flags; }
-
- bool hasFlag(unsigned F) const { return (Flags & F) != 0; }
+ SectionKind getKind() const { return Kind; }
};
/// TargetAsmInfo - This class is intended to be used as a base class for asm
@@ -678,9 +640,9 @@
virtual ~TargetAsmInfo();
const Section* getNamedSection(const char *Name,
- unsigned Flags = SectionFlags::None) const;
+ SectionKind::Kind K) const;
const Section* getUnnamedSection(const char *Directive,
- unsigned Flags = SectionFlags::None) const;
+ SectionKind::Kind K) const;
/// Measure the specified inline asm to determine an approximation of its
/// length.
@@ -717,12 +679,13 @@
return 0;
}
- /// getFlagsForNamedSection - If this target wants to be able to infer
+ /// getKindForNamedSection - If this target wants to be able to override
/// section flags based on the name of the section specified for a global
/// variable, it can implement this. This is used on ELF systems so that
/// ".tbss" gets the TLS bit set etc.
- virtual unsigned getFlagsForNamedSection(const char *Section) const {
- return 0;
+ virtual SectionKind::Kind getKindForNamedSection(const char *Section,
+ SectionKind::Kind K) const{
+ return K;
}
/// SectionForGlobal - This method computes the appropriate section to emit
@@ -741,10 +704,11 @@
return 0;
}
- /// Turn the specified flags into a string that can be printed to the
- /// assembly file.
- virtual void getSectionFlags(unsigned Flags,
- SmallVectorImpl &Str) const {
+ /// getSectionFlagsAsString - Turn the flags in the specified SectionKind
+ /// into a string that can be printed to the assembly file after the
+ /// ".section foo" part of a section directive.
+ virtual void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const {
}
// FIXME: Eliminate this.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Jul 27 00:32:16 2009
@@ -117,8 +117,8 @@
/// SwitchToSection - Switch to the specified section of the executable if we
/// are not already in it!
-void AsmPrinter::SwitchToSection(const Section* NS) {
- const std::string& NewSection = NS->getName();
+void AsmPrinter::SwitchToSection(const Section *NS) {
+ const std::string &NewSection = NS->getName();
// If we're already in this section, we're done.
if (CurrentSection == NewSection) return;
@@ -135,20 +135,20 @@
// If section is named we need to switch into it via special '.section'
// directive and also append funky flags. Otherwise - section name is just
// some magic assembler directive.
- if (NS->hasFlag(SectionFlags::Named)) {
- O << TAI->getSwitchToSectionDirective()
- << CurrentSection;
-
+ if (NS->getKind().hasExplicitSection()) {
SmallString<32> FlagsStr;
- TAI->getSectionFlags(NS->getFlags(), FlagsStr);
- O << FlagsStr.c_str();
+ TAI->getSectionFlagsAsString(NS->getKind(), FlagsStr);
+
+ O << TAI->getSwitchToSectionDirective()
+ << CurrentSection
+ << FlagsStr.c_str();
} else {
O << CurrentSection;
}
O << TAI->getDataSectionStartSuffix() << '\n';
}
- IsInTextSection = (NS->getFlags() & SectionFlags::Code);
+ IsInTextSection = NS->getKind().isText();
}
void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const {
@@ -404,7 +404,7 @@
bool JTInDiffSection = false;
if ((IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) ||
!JumpTableDataSection ||
- FuncSection->hasFlag(SectionFlags::Linkonce)) {
+ FuncSection->getKind().isWeak()) {
// In PIC mode, we need to emit the jump table to the same section as the
// function body itself, otherwise the label differences won't make sense.
// We should also do if the section name is NULL or function is declared in
Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Mon Jul 27 00:32:16 2009
@@ -228,18 +228,18 @@
// getElfSectionFlags - Get the ELF Section Header flags based
// on the flags defined in ELFTargetAsmInfo.
-unsigned ELFWriter::getElfSectionFlags(unsigned Flags) {
+unsigned ELFWriter::getElfSectionFlags(SectionKind Kind) {
unsigned ElfSectionFlags = ELFSection::SHF_ALLOC;
- if (Flags & SectionFlags::Code)
+ if (Kind.isText())
ElfSectionFlags |= ELFSection::SHF_EXECINSTR;
- if (Flags & SectionFlags::Writable)
+ if (Kind.isWriteable())
ElfSectionFlags |= ELFSection::SHF_WRITE;
- if (Flags & SectionFlags::Mergeable)
+ if (Kind.isMergeableConst())
ElfSectionFlags |= ELFSection::SHF_MERGE;
- if (Flags & SectionFlags::TLS)
+ if (Kind.isThreadLocal())
ElfSectionFlags |= ELFSection::SHF_TLS;
- if (Flags & SectionFlags::Strings)
+ if (Kind.isMergeableCString())
ElfSectionFlags |= ELFSection::SHF_STRINGS;
return ElfSectionFlags;
@@ -293,7 +293,7 @@
// Get ELF section from TAI
const Section *S = TAI->SectionForGlobal(GV);
- unsigned SectionFlags = getElfSectionFlags(S->getFlags());
+ unsigned SectionFlags = getElfSectionFlags(S->getKind());
// The symbol align should update the section alignment if needed
const TargetData *TD = TM.getTargetData();
Modified: llvm/trunk/lib/CodeGen/ELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.h?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.h (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.h Mon Jul 27 00:32:16 2009
@@ -34,6 +34,7 @@
class TargetAsmInfo;
class TargetELFWriterInfo;
class raw_ostream;
+ class SectionKind;
typedef std::vector::iterator ELFSymIter;
typedef std::vector::iterator ELFSectionIter;
@@ -209,7 +210,7 @@
unsigned getGlobalELFBinding(const GlobalValue *GV);
unsigned getGlobalELFType(const GlobalValue *GV);
unsigned getGlobalELFVisibility(const GlobalValue *GV);
- unsigned getElfSectionFlags(unsigned Flags);
+ unsigned getElfSectionFlags(SectionKind Kind);
// setGlobalSymLookup - Set global value 'GV' with 'Index' in the lookup map
void setGlobalSymLookup(const GlobalValue *GV, unsigned Index) {
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -59,8 +59,7 @@
ARMTargetAsmInfo(TM) {
Subtarget = &TM.getSubtarget();
- BSSSection_ = getUnnamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
NeedsSet = false;
HasLEB128 = true;
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Jul 27 00:32:16 2009
@@ -1130,9 +1130,10 @@
const Section *TheSection = TAI->SectionForGlobal(GVar);
SwitchToSection(TheSection);
+ // FIXME: get this stuff from section kind flags.
if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal() &&
// Don't put things that should go in the cstring section into "comm".
- !TheSection->hasFlag(SectionFlags::Strings)) {
+ !TheSection->getKind().isMergeableCString()) {
if (GVar->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
O << "\t.globl\t" << name << "\n";
Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -35,8 +35,7 @@
// BSS section needs to be emitted as ".section"
BSSSection = "\t.section\t.bss";
- BSSSection_ = getUnnamedSection("\t.section\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getUnnamedSection("\t.section\t.bss", SectionKind::BSS);
SupportsDebugInformation = true;
NeedsSet = true;
Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -29,28 +29,29 @@
: TargetAsmInfo(TM) {
CStringSection_ = getUnnamedSection("\t.cstring",
- SectionFlags::Mergeable |SectionFlags::Strings);
+ SectionKind::MergeableCString);
FourByteConstantSection = getUnnamedSection("\t.literal4\n",
- SectionFlags::Mergeable);
+ SectionKind::MergeableConst4);
EightByteConstantSection = getUnnamedSection("\t.literal8\n",
- SectionFlags::Mergeable);
+ SectionKind::MergeableConst8);
// Note: 16-byte constant section is subtarget specific and should be provided
// there, if needed.
SixteenByteConstantSection = 0;
- ReadOnlySection = getUnnamedSection("\t.const", SectionFlags::None);
+ ReadOnlySection = getUnnamedSection("\t.const", SectionKind::ReadOnly);
TextCoalSection =
getNamedSection("\t__TEXT,__textcoal_nt,coalesced,pure_instructions",
- SectionFlags::Code);
+ SectionKind::Text);
ConstTextCoalSection = getNamedSection("\t__TEXT,__const_coal,coalesced",
- SectionFlags::None);
+ SectionKind::Text);
ConstDataCoalSection = getNamedSection("\t__DATA,__const_coal,coalesced",
- SectionFlags::None);
- ConstDataSection = getUnnamedSection("\t.const_data", SectionFlags::None);
+ SectionKind::Text);
+ ConstDataSection = getUnnamedSection("\t.const_data",
+ SectionKind::ReadOnlyWithRel);
DataCoalSection = getNamedSection("\t__DATA,__datacoal_nt,coalesced",
- SectionFlags::Writable);
+ SectionKind::DataRel);
// Common settings for all Darwin targets.
Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -27,28 +27,24 @@
ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM)
: TargetAsmInfo(TM) {
- BSSSection_ = getUnnamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
- ReadOnlySection = getNamedSection("\t.rodata", SectionFlags::None);
- TLSDataSection = getNamedSection("\t.tdata",
- SectionFlags::Writable | SectionFlags::TLS);
- TLSBSSSection = getNamedSection("\t.tbss",
- SectionFlags::Writable | SectionFlags::TLS | SectionFlags::BSS);
+ ReadOnlySection = getNamedSection("\t.rodata", SectionKind::ReadOnly);
+ TLSDataSection = getNamedSection("\t.tdata", SectionKind::ThreadData);
+ TLSBSSSection = getNamedSection("\t.tbss", SectionKind::ThreadBSS);
- DataRelSection = getNamedSection("\t.data.rel", SectionFlags::Writable);
+ DataRelSection = getNamedSection("\t.data.rel", SectionKind::DataRel);
DataRelLocalSection = getNamedSection("\t.data.rel.local",
- SectionFlags::Writable);
+ SectionKind::DataRelLocal);
DataRelROSection = getNamedSection("\t.data.rel.ro",
- SectionFlags::Writable);
+ SectionKind::ReadOnlyWithRel);
DataRelROLocalSection = getNamedSection("\t.data.rel.ro.local",
- SectionFlags::Writable);
+ SectionKind::ReadOnlyWithRelLocal);
MergeableConst4Section = getNamedSection(".rodata.cst4",
- SectionFlags::setEntitySize(SectionFlags::Mergeable, 4));
+ SectionKind::MergeableConst4);
MergeableConst8Section = getNamedSection(".rodata.cst8",
- SectionFlags::setEntitySize(SectionFlags::Mergeable, 8));
+ SectionKind::MergeableConst8);
MergeableConst16Section = getNamedSection(".rodata.cst16",
- SectionFlags::setEntitySize(SectionFlags::Mergeable, 16));
+ SectionKind::MergeableConst16);
}
@@ -98,28 +94,30 @@
/// getFlagsForNamedSection - If this target wants to be able to infer
/// section flags based on the name of the section specified for a global
/// variable, it can implement this.
-unsigned ELFTargetAsmInfo::getFlagsForNamedSection(const char *Name) const {
- unsigned Flags = 0;
- if (Name[0] != '.') return 0;
+SectionKind::Kind ELFTargetAsmInfo::getKindForNamedSection(const char *Name,
+ SectionKind::Kind K) const {
+ if (Name[0] != '.') return K;
// Some lame default implementation based on some magic section names.
if (strncmp(Name, ".gnu.linkonce.b.", 16) == 0 ||
strncmp(Name, ".llvm.linkonce.b.", 17) == 0 ||
strncmp(Name, ".gnu.linkonce.sb.", 17) == 0 ||
strncmp(Name, ".llvm.linkonce.sb.", 18) == 0)
- Flags |= SectionFlags::BSS;
- else if (strcmp(Name, ".tdata") == 0 ||
- strncmp(Name, ".tdata.", 7) == 0 ||
- strncmp(Name, ".gnu.linkonce.td.", 17) == 0 ||
- strncmp(Name, ".llvm.linkonce.td.", 18) == 0)
- Flags |= SectionFlags::TLS;
- else if (strcmp(Name, ".tbss") == 0 ||
- strncmp(Name, ".tbss.", 6) == 0 ||
- strncmp(Name, ".gnu.linkonce.tb.", 17) == 0 ||
- strncmp(Name, ".llvm.linkonce.tb.", 18) == 0)
- Flags |= SectionFlags::BSS | SectionFlags::TLS;
+ return SectionKind::BSS;
- return Flags;
+ if (strcmp(Name, ".tdata") == 0 ||
+ strncmp(Name, ".tdata.", 7) == 0 ||
+ strncmp(Name, ".gnu.linkonce.td.", 17) == 0 ||
+ strncmp(Name, ".llvm.linkonce.td.", 18) == 0)
+ return SectionKind::ThreadData;
+
+ if (strcmp(Name, ".tbss") == 0 ||
+ strncmp(Name, ".tbss.", 6) == 0 ||
+ strncmp(Name, ".gnu.linkonce.tb.", 17) == 0 ||
+ strncmp(Name, ".llvm.linkonce.tb.", 18) == 0)
+ return SectionKind::ThreadBSS;
+
+ return K;
}
const char *
@@ -152,37 +150,36 @@
if (Size <= 16) {
assert(getCStringSection() && "Should have string section prefix");
- // We also need alignment here
+ // We also need alignment here.
+ // FIXME: this is getting the alignment of the character, not the alignment
+ // of the string!!
unsigned Align = TD->getPrefTypeAlignment(Ty);
if (Align < Size)
Align = Size;
std::string Name = getCStringSection() + utostr(Size) + '.' + utostr(Align);
- unsigned Flags = SectionFlags::setEntitySize(SectionFlags::Mergeable |
- SectionFlags::Strings,
- Size);
- return getNamedSection(Name.c_str(), Flags);
+ return getNamedSection(Name.c_str(), SectionKind::MergeableCString);
}
return getReadOnlySection();
}
-void ELFTargetAsmInfo::getSectionFlags(unsigned Flags,
- SmallVectorImpl &Str) const {
+void ELFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const {
Str.push_back(',');
Str.push_back('"');
- if (!(Flags & SectionFlags::Debug))
+ if (!Kind.isMetadata())
Str.push_back('a');
- if (Flags & SectionFlags::Code)
+ if (Kind.isText())
Str.push_back('x');
- if (Flags & SectionFlags::Writable)
+ if (Kind.isWriteable())
Str.push_back('w');
- if (Flags & SectionFlags::Mergeable)
+ if (Kind.isMergeableConst() || Kind.isMergeableCString())
Str.push_back('M');
- if (Flags & SectionFlags::Strings)
+ if (Kind.isMergeableCString())
Str.push_back('S');
- if (Flags & SectionFlags::TLS)
+ if (Kind.isThreadLocal())
Str.push_back('T');
Str.push_back('"');
@@ -195,16 +192,27 @@
Str.push_back('@');
const char *KindStr;
- if (Flags & SectionFlags::BSS)
+ if (Kind.isBSS())
KindStr = "nobits";
else
KindStr = "progbits";
Str.append(KindStr, KindStr+strlen(KindStr));
- if (unsigned entitySize = SectionFlags::getEntitySize(Flags)) {
+ if (Kind.isMergeableCString()) {
+ // TODO: Eventually handle multiple byte character strings. For now, all
+ // mergable C strings are single byte.
+ Str.push_back(',');
+ Str.push_back('1');
+ } else if (Kind.isMergeableConst4()) {
+ Str.push_back(',');
+ Str.push_back('4');
+ } else if (Kind.isMergeableConst8()) {
+ Str.push_back(',');
+ Str.push_back('8');
+ } else if (Kind.isMergeableConst16()) {
Str.push_back(',');
- std::string Size = utostr(entitySize);
- Str.append(Size.begin(), Size.end());
+ Str.push_back('1');
+ Str.push_back('6');
}
}
Modified: llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -18,6 +18,5 @@
: ELFTargetAsmInfo(TM) {
AlignmentIsInBytes = false;
- BSSSection_ = getUnnamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
}
Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -30,8 +30,7 @@
BSSSection = "\t.section\t.bss";
CStringSection = ".rodata.str";
- BSSSection_ = getUnnamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
if (!TM.getSubtarget().hasABICall())
JumpTableDirective = "\t.word\t";
Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Mon Jul 27 00:32:16 2009
@@ -61,8 +61,8 @@
// Now emit the instructions of function in its code section.
const char *codeSection = PAN::getCodeSectionName(CurrentFnName).c_str();
- const Section *fCodeSection = TAI->getNamedSection(codeSection,
- SectionFlags::Code);
+ const Section *fCodeSection =
+ TAI->getNamedSection(codeSection, SectionKind::Text);
// Start the Code Section.
O << "\n";
SwitchToSection(fCodeSection);
@@ -291,8 +291,8 @@
O << "\n";
const char *SectionName = PAN::getFrameSectionName(CurrentFnName).c_str();
- const Section *fPDataSection = TAI->getNamedSection(SectionName,
- SectionFlags::Writable);
+ const Section *fPDataSection =
+ TAI->getNamedSection(SectionName, SectionKind::DataRel);
SwitchToSection(fPDataSection);
// Emit function frame label
Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -37,18 +37,21 @@
ZeroDirective = NULL;
AsciiDirective = " dt ";
AscizDirective = NULL;
- BSSSection_ = getNamedSection("udata.# UDATA",
- SectionFlags::Writable | SectionFlags::BSS);
- ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionFlags::None);
- DataSection = getNamedSection("idata.# IDATA", SectionFlags::Writable);
+ BSSSection_ = getNamedSection("udata.# UDATA", SectionKind::BSS);
+ ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionKind::ReadOnly);
+ DataSection = getNamedSection("idata.# IDATA", SectionKind::DataRel);
SwitchToSectionDirective = "";
// Need because otherwise a .text symbol is emitted by DwarfWriter
// in BeginModule, and gpasm cribbs for that .text symbol.
- TextSection = getUnnamedSection("", SectionFlags::Code);
+ TextSection = getUnnamedSection("", SectionKind::Text);
PIC16Section *ROSection = new PIC16Section(getReadOnlySection());
ROSections.push_back(ROSection);
- ExternalVarDecls = new PIC16Section(getNamedSection("ExternalVarDecls"));
- ExternalVarDefs = new PIC16Section(getNamedSection("ExternalVarDefs"));
+
+ // FIXME: I don't know what the classification of these sections really is.
+ ExternalVarDecls = new PIC16Section(getNamedSection("ExternalVarDecls",
+ SectionKind::Metadata));
+ ExternalVarDefs = new PIC16Section(getNamedSection("ExternalVarDefs",
+ SectionKind::Metadata));
// Set it to false because we weed to generate c file name and not bc file
// name.
HasSingleParameterDotFile = false;
@@ -95,7 +98,9 @@
// No BSS section spacious enough was found. Crate a new one.
if (!FoundBSS) {
std::string name = PAN::getUdataSectionName(BSSSections.size());
- const Section *NewSection = getNamedSection(name.c_str());
+ const Section *NewSection = getNamedSection(name.c_str(),
+ // FIXME.
+ SectionKind::Metadata);
FoundBSS = new PIC16Section(NewSection);
@@ -135,7 +140,9 @@
// No IDATA section spacious enough was found. Crate a new one.
if (!FoundIDATA) {
std::string name = PAN::getIdataSectionName(IDATASections.size());
- const Section *NewSection = getNamedSection(name.c_str());
+ const Section *NewSection = getNamedSection(name.c_str(),
+ // FIXME.
+ SectionKind::Metadata);
FoundIDATA = new PIC16Section(NewSection);
@@ -168,7 +175,9 @@
// No Auto section was found. Crate a new one.
if (!FoundAutoSec) {
- const Section *NewSection = getNamedSection(name.c_str());
+ const Section *NewSection = getNamedSection(name.c_str(),
+ // FIXME.
+ SectionKind::Metadata);
FoundAutoSec = new PIC16Section(NewSection);
@@ -316,7 +325,7 @@
PIC16Section *NewBSS = FoundBSS;
if (NewBSS == NULL) {
- const Section *NewSection = getNamedSection(Name.c_str());
+ const Section *NewSection = getNamedSection(Name.c_str(), SectionKind::BSS);
NewBSS = new PIC16Section(NewSection);
BSSSections.push_back(NewBSS);
}
@@ -367,7 +376,9 @@
PIC16Section *NewIDATASec = FoundIDATASec;
if (NewIDATASec == NULL) {
- const Section *NewSection = getNamedSection(Name.c_str());
+ const Section *NewSection = getNamedSection(Name.c_str(),
+ // FIXME:
+ SectionKind::Metadata);
NewIDATASec = new PIC16Section(NewSection);
IDATASections.push_back(NewIDATASec);
}
@@ -405,7 +416,8 @@
PIC16Section *NewRomSec = FoundROSec;
if (NewRomSec == NULL) {
- const Section *NewSection = getNamedSection(Name.c_str());
+ const Section *NewSection = getNamedSection(Name.c_str(),
+ SectionKind::ReadOnly);
NewRomSec = new PIC16Section(NewSection);
ROSections.push_back(NewRomSec);
}
Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Mon Jul 27 00:32:16 2009
@@ -899,7 +899,7 @@
(GVar->hasLocalLinkage() || GVar->hasExternalLinkage() ||
GVar->isWeakForLinker()) &&
// Don't put things that should go in the cstring section into "comm".
- !TheSection->hasFlag(SectionFlags::Strings)) {
+ !TheSection->getKind().isMergeableCString()) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (GVar->hasExternalLinkage()) {
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -49,8 +49,7 @@
return DW_EH_PE_absptr;
}
-const char *
-PPCDarwinTargetAsmInfo::getEHGlobalPrefix() const {
+const char *PPCDarwinTargetAsmInfo::getEHGlobalPrefix() const {
const PPCSubtarget* Subtarget = &TM.getSubtarget();
if (Subtarget->getDarwinVers() > 9)
return PrivateGlobalPrefix;
@@ -72,8 +71,7 @@
BSSSection = "\t.section\t\".sbss\",\"aw\", at nobits";
// PPC/Linux normally uses named section for BSS.
- BSSSection_ = getNamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getNamedSection("\t.bss", SectionKind::BSS);
// Debug Information
AbsoluteDebugSectionOffsets = true;
Modified: llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -27,25 +27,24 @@
CStringSection=".rodata.str";
// Sparc normally uses named section for BSS.
- BSSSection_ = getNamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getNamedSection("\t.bss", SectionKind::BSS);
}
-void SparcELFTargetAsmInfo::getSectionFlags(unsigned Flags,
+void SparcELFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
SmallVectorImpl &Str) const {
- if (Flags & SectionFlags::Mergeable)
- return ELFTargetAsmInfo::getSectionFlags(Flags, Str);
+ if (Kind.isMergeableConst() || Kind.isMergeableCString())
+ return ELFTargetAsmInfo::getSectionFlagsAsString(Kind, Str);
// FIXME: Inefficient.
std::string Res;
- if (!(Flags & SectionFlags::Debug))
+ if (!Kind.isMetadata())
Res += ",#alloc";
- if (Flags & SectionFlags::Code)
+ if (Kind.isText())
Res += ",#execinstr";
- if (Flags & SectionFlags::Writable)
+ if (Kind.isWriteable())
Res += ",#write";
- if (Flags & SectionFlags::TLS)
+ if (Kind.isThreadLocal())
Res += ",#tls";
Str.append(Res.begin(), Res.end());
Modified: llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.h?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.h Mon Jul 27 00:32:16 2009
@@ -24,8 +24,8 @@
struct SparcELFTargetAsmInfo : public ELFTargetAsmInfo {
explicit SparcELFTargetAsmInfo(const TargetMachine &TM);
- virtual void getSectionFlags(unsigned Flags,
- SmallVectorImpl &Str) const;
+ virtual void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const;
};
Modified: llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -28,6 +28,5 @@
NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\", at progbits";
- BSSSection_ = getUnnamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
}
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -122,8 +122,8 @@
DwarfEHFrameSection = ".eh_frame";
DwarfExceptionSection = ".gcc_except_table";
AsmTransCBE = 0;
- TextSection = getUnnamedSection("\t.text", SectionFlags::Code);
- DataSection = getUnnamedSection("\t.data", SectionFlags::Writable);
+ TextSection = getUnnamedSection("\t.text", SectionKind::Text);
+ DataSection = getUnnamedSection("\t.data", SectionKind::DataRel);
}
TargetAsmInfo::~TargetAsmInfo() {
@@ -199,23 +199,6 @@
return false;
}
-static unsigned SectionFlagsForGlobal(SectionKind Kind) {
- // Decode flags from global and section kind.
- unsigned Flags = SectionFlags::None;
- if (Kind.isWeak())
- Flags |= SectionFlags::Linkonce;
- if (Kind.isBSS() || Kind.isThreadBSS())
- Flags |= SectionFlags::BSS;
- if (Kind.isThreadLocal())
- Flags |= SectionFlags::TLS;
- if (Kind.isText())
- Flags |= SectionFlags::Code;
- if (Kind.isWriteable())
- Flags |= SectionFlags::Writable;
-
- return Flags;
-}
-
static SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV,
const TargetMachine &TM) {
Reloc::Model ReloModel = TM.getRelocationModel();
@@ -326,29 +309,21 @@
if (const Section *TS = getSpecialCasedSectionGlobals(GV, Kind))
return TS;
- // Honour section already set, if any.
- unsigned Flags = SectionFlagsForGlobal(Kind);
-
- // This is an explicitly named section.
- Flags |= SectionFlags::Named;
-
// If the target has magic semantics for certain section names, make sure to
// pick up the flags. This allows the user to write things with attribute
// section and still get the appropriate section flags printed.
- Flags |= getFlagsForNamedSection(GV->getSection().c_str());
+ GVKind = getKindForNamedSection(GV->getSection().c_str(), GVKind);
- return getNamedSection(GV->getSection().c_str(), Flags);
+ return getNamedSection(GV->getSection().c_str(), GVKind);
}
// If this global is linkonce/weak and the target handles this by emitting it
// into a 'uniqued' section name, create and return the section now.
if (Kind.isWeak()) {
if (const char *Prefix = getSectionPrefixForUniqueGlobal(Kind)) {
- unsigned Flags = SectionFlagsForGlobal(Kind);
-
// FIXME: Use mangler interface (PR4584).
std::string Name = Prefix+GV->getNameStr();
- return getNamedSection(Name.c_str(), Flags);
+ return getNamedSection(Name.c_str(), GVKind);
}
}
@@ -390,12 +365,12 @@
const Section *TargetAsmInfo::getNamedSection(const char *Name,
- unsigned Flags) const {
+ SectionKind::Kind Kind) const {
Section &S = Sections[Name];
// This is newly-created section, set it up properly.
if (S.Name.empty()) {
- S.Flags = Flags | SectionFlags::Named;
+ S.Kind = SectionKind::get(Kind, false /*weak*/, true /*Named*/);
S.Name = Name;
}
@@ -403,12 +378,13 @@
}
const Section*
-TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags) const {
+TargetAsmInfo::getUnnamedSection(const char *Directive,
+ SectionKind::Kind Kind) const {
Section& S = Sections[Directive];
// This is newly-created section, set it up properly.
if (S.Name.empty()) {
- S.Flags = Flags & ~SectionFlags::Named;
+ S.Kind = SectionKind::get(Kind, false /*weak*/, false /*Named*/);
S.Name = Directive;
}
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=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Jul 27 00:32:16 2009
@@ -799,7 +799,7 @@
if (C->isNullValue() && !GVar->hasSection() &&
// Don't put things that should go in the cstring section into "comm".
- !TheSection->hasFlag(SectionFlags::Strings)) {
+ !TheSection->getKind().isMergeableCString()) {
if (GVar->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
O << "\t.globl " << name << '\n';
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -58,7 +58,7 @@
// FIXME: Why don't we always use this section?
if (is64Bit)
SixteenByteConstantSection = getUnnamedSection("\t.literal16\n",
- SectionFlags::Mergeable);
+ SectionKind::MergeableConst16);
LCOMMDirective = "\t.lcomm\t";
// Leopard and above support aligned common symbols.
@@ -128,8 +128,7 @@
// Set up DWARF directives
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
- BSSSection_ = getUnnamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
// Debug Information
AbsoluteDebugSectionOffsets = true;
@@ -278,13 +277,14 @@
}
-void X86COFFTargetAsmInfo::getSectionFlags(unsigned Flags,
- SmallVectorImpl &Str) const {
+
+void X86COFFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const {
// FIXME: Inefficient.
std::string Res = ",\"";
- if (Flags & SectionFlags::Code)
+ if (Kind.isText())
Res += 'x';
- if (Flags & SectionFlags::Writable)
+ if (Kind.isWriteable())
Res += 'w';
Res += "\"";
@@ -314,8 +314,8 @@
AlignmentIsInBytes = true;
- TextSection = getUnnamedSection("_text", SectionFlags::Code);
- DataSection = getUnnamedSection("_data", SectionFlags::Writable);
+ TextSection = getUnnamedSection("_text", SectionKind::Text);
+ DataSection = getUnnamedSection("_data", SectionKind::DataRel);
JumpTableDataSection = NULL;
SwitchToSectionDirective = "";
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Mon Jul 27 00:32:16 2009
@@ -56,8 +56,8 @@
virtual const char *
getSectionPrefixForUniqueGlobal(SectionKind kind) const;
- virtual void getSectionFlags(unsigned Flags,
- SmallVectorImpl &Str) const;
+ virtual void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const;
};
struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo {
Modified: llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp?rev=77184&r1=77183&r2=77184&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp Mon Jul 27 00:32:16 2009
@@ -24,10 +24,9 @@
XCoreTargetAsmInfo::XCoreTargetAsmInfo(const XCoreTargetMachine &TM)
: ELFTargetAsmInfo(TM) {
SupportsDebugInformation = true;
- TextSection = getUnnamedSection("\t.text", SectionFlags::Code);
- DataSection = getNamedSection("\t.dp.data", SectionFlags::Writable);
- BSSSection_ = getNamedSection("\t.dp.bss", SectionFlags::Writable |
- SectionFlags::BSS);
+ TextSection = getUnnamedSection("\t.text", SectionKind::Text);
+ DataSection = getNamedSection("\t.dp.data", SectionKind::DataRel);
+ BSSSection_ = getNamedSection("\t.dp.bss", SectionKind::BSS);
// TLS globals are lowered in the backend to arrays indexed by the current
// thread id. After lowering they require no special handling by the linker
@@ -36,9 +35,10 @@
TLSBSSSection = BSSSection_;
if (TM.getSubtargetImpl()->isXS1A())
- ReadOnlySection = getNamedSection("\t.dp.rodata", SectionFlags::Writable);
+ // FIXME: Why is this writable???
+ ReadOnlySection = getNamedSection("\t.dp.rodata", SectionKind::DataRel);
else
- ReadOnlySection = getNamedSection("\t.cp.rodata", SectionFlags::None);
+ ReadOnlySection = getNamedSection("\t.cp.rodata", SectionKind::ReadOnly);
Data16bitsDirective = "\t.short\t";
Data32bitsDirective = "\t.long\t";
Data64bitsDirective = 0;
From sabre at nondot.org Mon Jul 27 01:17:17 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 06:17:17 -0000
Subject: [llvm-commits] [llvm] r77186 - in /llvm/trunk: include/llvm/Target/
lib/Target/ lib/Target/ARM/ lib/Target/CellSPU/ lib/Target/MSP430/
lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/
lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/
Message-ID: <200907270617.n6R6HIOs012987@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 01:17:14 2009
New Revision: 77186
URL: http://llvm.org/viewvc/llvm-project?rev=77186&view=rev
Log:
Eliminate getNamed/getUnnamedSection, adding a new and unified getOrCreateSection
instead.
Modified:
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp
llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp
llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp
llvm/trunk/lib/Target/TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Jul 27 01:17:14 2009
@@ -639,10 +639,9 @@
explicit TargetAsmInfo(const TargetMachine &TM);
virtual ~TargetAsmInfo();
- const Section* getNamedSection(const char *Name,
- SectionKind::Kind K) const;
- const Section* getUnnamedSection(const char *Directive,
- SectionKind::Kind K) const;
+ const Section *getOrCreateSection(const char *Name,
+ bool isDirective,
+ SectionKind::Kind K) const;
/// Measure the specified inline asm to determine an approximation of its
/// length.
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -59,7 +59,7 @@
ARMTargetAsmInfo(TM) {
Subtarget = &TM.getSubtarget();
- BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
NeedsSet = false;
HasLEB128 = true;
Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -35,7 +35,7 @@
// BSS section needs to be emitted as ".section"
BSSSection = "\t.section\t.bss";
- BSSSection_ = getUnnamedSection("\t.section\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", false, SectionKind::BSS);
SupportsDebugInformation = true;
NeedsSet = true;
Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -28,30 +28,30 @@
DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM)
: TargetAsmInfo(TM) {
- CStringSection_ = getUnnamedSection("\t.cstring",
- SectionKind::MergeableCString);
- FourByteConstantSection = getUnnamedSection("\t.literal4\n",
- SectionKind::MergeableConst4);
- EightByteConstantSection = getUnnamedSection("\t.literal8\n",
- SectionKind::MergeableConst8);
+ CStringSection_ = getOrCreateSection("\t.cstring", true,
+ SectionKind::MergeableCString);
+ FourByteConstantSection = getOrCreateSection("\t.literal4\n", true,
+ SectionKind::MergeableConst4);
+ EightByteConstantSection = getOrCreateSection("\t.literal8\n", true,
+ SectionKind::MergeableConst8);
// Note: 16-byte constant section is subtarget specific and should be provided
// there, if needed.
SixteenByteConstantSection = 0;
- ReadOnlySection = getUnnamedSection("\t.const", SectionKind::ReadOnly);
+ ReadOnlySection = getOrCreateSection("\t.const", true, SectionKind::ReadOnly);
TextCoalSection =
- getNamedSection("\t__TEXT,__textcoal_nt,coalesced,pure_instructions",
- SectionKind::Text);
- ConstTextCoalSection = getNamedSection("\t__TEXT,__const_coal,coalesced",
- SectionKind::Text);
- ConstDataCoalSection = getNamedSection("\t__DATA,__const_coal,coalesced",
- SectionKind::Text);
- ConstDataSection = getUnnamedSection("\t.const_data",
- SectionKind::ReadOnlyWithRel);
- DataCoalSection = getNamedSection("\t__DATA,__datacoal_nt,coalesced",
- SectionKind::DataRel);
+ getOrCreateSection("\t__TEXT,__textcoal_nt,coalesced,pure_instructions",
+ false, SectionKind::Text);
+ ConstTextCoalSection = getOrCreateSection("\t__TEXT,__const_coal,coalesced",
+ false, SectionKind::Text);
+ ConstDataCoalSection = getOrCreateSection("\t__DATA,__const_coal,coalesced",
+ false, SectionKind::Text);
+ ConstDataSection = getOrCreateSection("\t.const_data", true,
+ SectionKind::ReadOnlyWithRel);
+ DataCoalSection = getOrCreateSection("\t__DATA,__datacoal_nt,coalesced",
+ false, SectionKind::DataRel);
// Common settings for all Darwin targets.
Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -26,25 +26,28 @@
ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM)
: TargetAsmInfo(TM) {
-
- ReadOnlySection = getNamedSection("\t.rodata", SectionKind::ReadOnly);
- TLSDataSection = getNamedSection("\t.tdata", SectionKind::ThreadData);
- TLSBSSSection = getNamedSection("\t.tbss", SectionKind::ThreadBSS);
-
- DataRelSection = getNamedSection("\t.data.rel", SectionKind::DataRel);
- DataRelLocalSection = getNamedSection("\t.data.rel.local",
- SectionKind::DataRelLocal);
- DataRelROSection = getNamedSection("\t.data.rel.ro",
- SectionKind::ReadOnlyWithRel);
- DataRelROLocalSection = getNamedSection("\t.data.rel.ro.local",
- SectionKind::ReadOnlyWithRelLocal);
+ ReadOnlySection =
+ getOrCreateSection("\t.rodata", false, SectionKind::ReadOnly);
+ TLSDataSection =
+ getOrCreateSection("\t.tdata", false, SectionKind::ThreadData);
+ TLSBSSSection = getOrCreateSection("\t.tbss", false, SectionKind::ThreadBSS);
+
+ DataRelSection = getOrCreateSection("\t.data.rel", false,
+ SectionKind::DataRel);
+ DataRelLocalSection = getOrCreateSection("\t.data.rel.local", false,
+ SectionKind::DataRelLocal);
+ DataRelROSection = getOrCreateSection("\t.data.rel.ro", false,
+ SectionKind::ReadOnlyWithRel);
+ DataRelROLocalSection =
+ getOrCreateSection("\t.data.rel.ro.local", false,
+ SectionKind::ReadOnlyWithRelLocal);
- MergeableConst4Section = getNamedSection(".rodata.cst4",
- SectionKind::MergeableConst4);
- MergeableConst8Section = getNamedSection(".rodata.cst8",
- SectionKind::MergeableConst8);
- MergeableConst16Section = getNamedSection(".rodata.cst16",
- SectionKind::MergeableConst16);
+ MergeableConst4Section = getOrCreateSection(".rodata.cst4", false,
+ SectionKind::MergeableConst4);
+ MergeableConst8Section = getOrCreateSection(".rodata.cst8", false,
+ SectionKind::MergeableConst8);
+ MergeableConst16Section = getOrCreateSection(".rodata.cst16", false,
+ SectionKind::MergeableConst16);
}
@@ -158,7 +161,8 @@
Align = Size;
std::string Name = getCStringSection() + utostr(Size) + '.' + utostr(Align);
- return getNamedSection(Name.c_str(), SectionKind::MergeableCString);
+ return getOrCreateSection(Name.c_str(), false,
+ SectionKind::MergeableCString);
}
return getReadOnlySection();
Modified: llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -18,5 +18,5 @@
: ELFTargetAsmInfo(TM) {
AlignmentIsInBytes = false;
- BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
}
Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -30,7 +30,7 @@
BSSSection = "\t.section\t.bss";
CStringSection = ".rodata.str";
- BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
if (!TM.getSubtarget().hasABICall())
JumpTableDirective = "\t.word\t";
Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Mon Jul 27 01:17:14 2009
@@ -62,7 +62,7 @@
const char *codeSection = PAN::getCodeSectionName(CurrentFnName).c_str();
const Section *fCodeSection =
- TAI->getNamedSection(codeSection, SectionKind::Text);
+ TAI->getOrCreateSection(codeSection, false, SectionKind::Text);
// Start the Code Section.
O << "\n";
SwitchToSection(fCodeSection);
@@ -292,7 +292,7 @@
const char *SectionName = PAN::getFrameSectionName(CurrentFnName).c_str();
const Section *fPDataSection =
- TAI->getNamedSection(SectionName, SectionKind::DataRel);
+ TAI->getOrCreateSection(SectionName, false, SectionKind::DataRel);
SwitchToSection(fPDataSection);
// Emit function frame label
Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -37,21 +37,24 @@
ZeroDirective = NULL;
AsciiDirective = " dt ";
AscizDirective = NULL;
- BSSSection_ = getNamedSection("udata.# UDATA", SectionKind::BSS);
- ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionKind::ReadOnly);
- DataSection = getNamedSection("idata.# IDATA", SectionKind::DataRel);
+ BSSSection_ = getOrCreateSection("udata.# UDATA", false, SectionKind::BSS);
+ ReadOnlySection = getOrCreateSection("romdata.# ROMDATA", false,
+ SectionKind::ReadOnly);
+ DataSection = getOrCreateSection("idata.# IDATA", false,SectionKind::DataRel);
SwitchToSectionDirective = "";
// Need because otherwise a .text symbol is emitted by DwarfWriter
// in BeginModule, and gpasm cribbs for that .text symbol.
- TextSection = getUnnamedSection("", SectionKind::Text);
+ TextSection = getOrCreateSection("", true, SectionKind::Text);
PIC16Section *ROSection = new PIC16Section(getReadOnlySection());
ROSections.push_back(ROSection);
// FIXME: I don't know what the classification of these sections really is.
- ExternalVarDecls = new PIC16Section(getNamedSection("ExternalVarDecls",
- SectionKind::Metadata));
- ExternalVarDefs = new PIC16Section(getNamedSection("ExternalVarDefs",
- SectionKind::Metadata));
+ ExternalVarDecls = new PIC16Section(getOrCreateSection("ExternalVarDecls",
+ false,
+ SectionKind::Metadata));
+ ExternalVarDefs = new PIC16Section(getOrCreateSection("ExternalVarDefs",
+ false,
+ SectionKind::Metadata));
// Set it to false because we weed to generate c file name and not bc file
// name.
HasSingleParameterDotFile = false;
@@ -98,9 +101,9 @@
// No BSS section spacious enough was found. Crate a new one.
if (!FoundBSS) {
std::string name = PAN::getUdataSectionName(BSSSections.size());
- const Section *NewSection = getNamedSection(name.c_str(),
- // FIXME.
- SectionKind::Metadata);
+ const Section *NewSection = getOrCreateSection(name.c_str(), false,
+ // FIXME.
+ SectionKind::Metadata);
FoundBSS = new PIC16Section(NewSection);
@@ -140,9 +143,10 @@
// No IDATA section spacious enough was found. Crate a new one.
if (!FoundIDATA) {
std::string name = PAN::getIdataSectionName(IDATASections.size());
- const Section *NewSection = getNamedSection(name.c_str(),
- // FIXME.
- SectionKind::Metadata);
+ const Section *NewSection = getOrCreateSection(name.c_str(),
+ false,
+ // FIXME.
+ SectionKind::Metadata);
FoundIDATA = new PIC16Section(NewSection);
@@ -175,9 +179,10 @@
// No Auto section was found. Crate a new one.
if (!FoundAutoSec) {
- const Section *NewSection = getNamedSection(name.c_str(),
- // FIXME.
- SectionKind::Metadata);
+ const Section *NewSection = getOrCreateSection(name.c_str(),
+ // FIXME.
+ false,
+ SectionKind::Metadata);
FoundAutoSec = new PIC16Section(NewSection);
@@ -325,7 +330,8 @@
PIC16Section *NewBSS = FoundBSS;
if (NewBSS == NULL) {
- const Section *NewSection = getNamedSection(Name.c_str(), SectionKind::BSS);
+ const Section *NewSection = getOrCreateSection(Name.c_str(),
+ false, SectionKind::BSS);
NewBSS = new PIC16Section(NewSection);
BSSSections.push_back(NewBSS);
}
@@ -376,9 +382,10 @@
PIC16Section *NewIDATASec = FoundIDATASec;
if (NewIDATASec == NULL) {
- const Section *NewSection = getNamedSection(Name.c_str(),
- // FIXME:
- SectionKind::Metadata);
+ const Section *NewSection = getOrCreateSection(Name.c_str(),
+ false,
+ // FIXME:
+ SectionKind::Metadata);
NewIDATASec = new PIC16Section(NewSection);
IDATASections.push_back(NewIDATASec);
}
@@ -416,8 +423,9 @@
PIC16Section *NewRomSec = FoundROSec;
if (NewRomSec == NULL) {
- const Section *NewSection = getNamedSection(Name.c_str(),
- SectionKind::ReadOnly);
+ const Section *NewSection = getOrCreateSection(Name.c_str(),
+ false,
+ SectionKind::ReadOnly);
NewRomSec = new PIC16Section(NewSection);
ROSections.push_back(NewRomSec);
}
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -71,7 +71,7 @@
BSSSection = "\t.section\t\".sbss\",\"aw\", at nobits";
// PPC/Linux normally uses named section for BSS.
- BSSSection_ = getNamedSection("\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
// Debug Information
AbsoluteDebugSectionOffsets = true;
Modified: llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -27,7 +27,7 @@
CStringSection=".rodata.str";
// Sparc normally uses named section for BSS.
- BSSSection_ = getNamedSection("\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
}
Modified: llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -28,5 +28,5 @@
NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\", at progbits";
- BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
}
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -122,8 +122,8 @@
DwarfEHFrameSection = ".eh_frame";
DwarfExceptionSection = ".gcc_except_table";
AsmTransCBE = 0;
- TextSection = getUnnamedSection("\t.text", SectionKind::Text);
- DataSection = getUnnamedSection("\t.data", SectionKind::DataRel);
+ TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("\t.data", true, SectionKind::DataRel);
}
TargetAsmInfo::~TargetAsmInfo() {
@@ -314,7 +314,7 @@
// section and still get the appropriate section flags printed.
GVKind = getKindForNamedSection(GV->getSection().c_str(), GVKind);
- return getNamedSection(GV->getSection().c_str(), GVKind);
+ return getOrCreateSection(GV->getSection().c_str(), false, GVKind);
}
// If this global is linkonce/weak and the target handles this by emitting it
@@ -323,7 +323,7 @@
if (const char *Prefix = getSectionPrefixForUniqueGlobal(Kind)) {
// FIXME: Use mangler interface (PR4584).
std::string Name = Prefix+GV->getNameStr();
- return getNamedSection(Name.c_str(), GVKind);
+ return getOrCreateSection(Name.c_str(), false, GVKind);
}
}
@@ -364,33 +364,20 @@
}
-const Section *TargetAsmInfo::getNamedSection(const char *Name,
- SectionKind::Kind Kind) const {
+const Section *TargetAsmInfo::getOrCreateSection(const char *Name,
+ bool isDirective,
+ SectionKind::Kind Kind) const {
Section &S = Sections[Name];
// This is newly-created section, set it up properly.
if (S.Name.empty()) {
- S.Kind = SectionKind::get(Kind, false /*weak*/, true /*Named*/);
+ S.Kind = SectionKind::get(Kind, false /*weak*/, !isDirective);
S.Name = Name;
}
return &S;
}
-const Section*
-TargetAsmInfo::getUnnamedSection(const char *Directive,
- SectionKind::Kind Kind) const {
- Section& S = Sections[Directive];
-
- // This is newly-created section, set it up properly.
- if (S.Name.empty()) {
- S.Kind = SectionKind::get(Kind, false /*weak*/, false /*Named*/);
- S.Name = Directive;
- }
-
- return &S;
-}
-
unsigned TargetAsmInfo::getULEB128Size(unsigned Value) {
unsigned Size = 0;
do {
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -57,8 +57,8 @@
ConstantPoolSection = "\t.const\n";
// FIXME: Why don't we always use this section?
if (is64Bit)
- SixteenByteConstantSection = getUnnamedSection("\t.literal16\n",
- SectionKind::MergeableConst16);
+ SixteenByteConstantSection =
+ getOrCreateSection("\t.literal16\n", true, SectionKind::MergeableConst16);
LCOMMDirective = "\t.lcomm\t";
// Leopard and above support aligned common symbols.
@@ -100,23 +100,20 @@
bool Global) const {
if (Reason == DwarfEncoding::Functions && Global)
return (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
- else if (Reason == DwarfEncoding::CodeLabels || !Global)
+ if (Reason == DwarfEncoding::CodeLabels || !Global)
return DW_EH_PE_pcrel;
- else
- return DW_EH_PE_absptr;
+ return DW_EH_PE_absptr;
}
const char *
-X86DarwinTargetAsmInfo::getEHGlobalPrefix() const
-{
+X86DarwinTargetAsmInfo::getEHGlobalPrefix() const {
const X86Subtarget* Subtarget = &TM.getSubtarget();
if (Subtarget->getDarwinVers() > 9)
return PrivateGlobalPrefix;
- else
- return "";
+ return "";
}
-X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM):
+X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) :
X86TargetAsmInfo(TM) {
CStringSection = ".rodata.str";
@@ -128,7 +125,7 @@
// Set up DWARF directives
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
- BSSSection_ = getUnnamedSection("\t.bss", SectionKind::BSS);
+ BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
// Debug Information
AbsoluteDebugSectionOffsets = true;
@@ -314,8 +311,8 @@
AlignmentIsInBytes = true;
- TextSection = getUnnamedSection("_text", SectionKind::Text);
- DataSection = getUnnamedSection("_data", SectionKind::DataRel);
+ TextSection = getOrCreateSection("_text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
JumpTableDataSection = NULL;
SwitchToSectionDirective = "";
Modified: llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp?rev=77186&r1=77185&r2=77186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp Mon Jul 27 01:17:14 2009
@@ -24,9 +24,9 @@
XCoreTargetAsmInfo::XCoreTargetAsmInfo(const XCoreTargetMachine &TM)
: ELFTargetAsmInfo(TM) {
SupportsDebugInformation = true;
- TextSection = getUnnamedSection("\t.text", SectionKind::Text);
- DataSection = getNamedSection("\t.dp.data", SectionKind::DataRel);
- BSSSection_ = getNamedSection("\t.dp.bss", SectionKind::BSS);
+ TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("\t.dp.data", false, SectionKind::DataRel);
+ BSSSection_ = getOrCreateSection("\t.dp.bss", false, SectionKind::BSS);
// TLS globals are lowered in the backend to arrays indexed by the current
// thread id. After lowering they require no special handling by the linker
@@ -36,9 +36,11 @@
if (TM.getSubtargetImpl()->isXS1A())
// FIXME: Why is this writable???
- ReadOnlySection = getNamedSection("\t.dp.rodata", SectionKind::DataRel);
+ ReadOnlySection = getOrCreateSection("\t.dp.rodata", false,
+ SectionKind::DataRel);
else
- ReadOnlySection = getNamedSection("\t.cp.rodata", SectionKind::ReadOnly);
+ ReadOnlySection = getOrCreateSection("\t.cp.rodata", false,
+ SectionKind::ReadOnly);
Data16bitsDirective = "\t.short\t";
Data32bitsDirective = "\t.long\t";
Data64bitsDirective = 0;
From benny.kra at googlemail.com Mon Jul 27 04:07:14 2009
From: benny.kra at googlemail.com (Benjamin Kramer)
Date: Mon, 27 Jul 2009 09:07:14 -0000
Subject: [llvm-commits] [llvm] r77187 -
/llvm/trunk/lib/AsmParser/LLParser.cpp
Message-ID: <200907270907.n6R97JfW029846@zion.cs.uiuc.edu>
Author: d0k
Date: Mon Jul 27 04:06:52 2009
New Revision: 77187
URL: http://llvm.org/viewvc/llvm-project?rev=77187&view=rev
Log:
Test commit: fix typo
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=77187&r1=77186&r2=77187&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jul 27 04:06:52 2009
@@ -436,7 +436,7 @@
SmallVector Elts;
if (ParseMDNodeVector(Elts)
- || ParseToken(lltok::rbrace, "exected end of metadata node"))
+ || ParseToken(lltok::rbrace, "expected end of metadata node"))
return true;
MDNode *Init = Context.getMDNode(Elts.data(), Elts.size());
From benny.kra at googlemail.com Mon Jul 27 04:39:47 2009
From: benny.kra at googlemail.com (Benjamin Kramer)
Date: Mon, 27 Jul 2009 09:39:47 -0000
Subject: [llvm-commits] [llvm] r77188 - in /llvm/trunk: unittests/Makefile
utils/unittest/googletest/Makefile
Message-ID: <200907270939.n6R9dpx8031057@zion.cs.uiuc.edu>
Author: d0k
Date: Mon Jul 27 04:39:18 2009
New Revision: 77188
URL: http://llvm.org/viewvc/llvm-project?rev=77188&view=rev
Log:
Remove trailing slashes from include paths. Some versions of mingw don't like them.
Modified:
llvm/trunk/unittests/Makefile
llvm/trunk/utils/unittest/googletest/Makefile
Modified: llvm/trunk/unittests/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Makefile?rev=77188&r1=77187&r2=77188&view=diff
==============================================================================
--- llvm/trunk/unittests/Makefile (original)
+++ llvm/trunk/unittests/Makefile Mon Jul 27 04:39:18 2009
@@ -13,7 +13,7 @@
LIBRARYNAME = UnitTestMain
BUILD_ARCHIVE = 1
-CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/
+CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include
CPP.Flags += -Wno-variadic-macros
PARALLEL_DIRS = ADT ExecutionEngine Support VMCore MC
Modified: llvm/trunk/utils/unittest/googletest/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/googletest/Makefile?rev=77188&r1=77187&r2=77188&view=diff
==============================================================================
--- llvm/trunk/utils/unittest/googletest/Makefile (original)
+++ llvm/trunk/utils/unittest/googletest/Makefile Mon Jul 27 04:39:18 2009
@@ -15,7 +15,7 @@
LIBRARYNAME = GoogleTest
BUILD_ARCHIVE = 1
-CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/
+CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include
CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS)
ifeq ($(OS),MingW)
From lattner at cs.uiuc.edu Mon Jul 27 10:16:44 2009
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 27 Jul 2009 10:16:44 -0500
Subject: [llvm-commits] CVS: llvm-www/Users.html
Message-ID: <200907271516.n6RFGiBZ009812@zion.cs.uiuc.edu>
Changes in directory llvm-www:
Users.html updated: 1.54 -> 1.55
---
Log message:
move open source projects above educational users.
---
Diffs of the changes: (+59 -58)
Users.html | 117 ++++++++++++++++++++++++++++++-------------------------------
1 files changed, 59 insertions(+), 58 deletions(-)
Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.54 llvm-www/Users.html:1.55
--- llvm-www/Users.html:1.54 Mon Jul 20 09:21:44 2009
+++ llvm-www/Users.html Mon Jul 27 10:13:15 2009
@@ -311,63 +311,6 @@
-Educational Users
-
-
-
-
Open Source Projects
@@ -445,6 +388,64 @@
+
+
+
+Educational Users
+
+
@@ -455,6 +456,6 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Development List
- Last modified: $Date: 2009/07/20 14:21:44 $
+ Last modified: $Date: 2009/07/27 15:13:15 $
From sabre at nondot.org Mon Jul 27 10:16:44 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 10:16:44 -0500
Subject: [llvm-commits] CVS: llvm-www/Users.html
Message-ID: <200907271516.n6RFGiWl009811@zion.cs.uiuc.edu>
Changes in directory llvm-www:
Users.html updated: 1.55 -> 1.56
---
Log message:
move open source projects above research groups
---
Diffs of the changes: (+81 -80)
Users.html | 161 ++++++++++++++++++++++++++++++-------------------------------
1 files changed, 81 insertions(+), 80 deletions(-)
Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.55 llvm-www/Users.html:1.56
--- llvm-www/Users.html:1.55 Mon Jul 27 10:13:15 2009
+++ llvm-www/Users.html Mon Jul 27 10:14:52 2009
@@ -152,6 +152,86 @@
+
+Open Source Projects
+
+
+
+
+
Academic Research Users
@@ -311,85 +391,6 @@
-
Open Source Projects
-
-
-
-
-
Educational Users
@@ -456,6 +457,6 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Development List
- Last modified: $Date: 2009/07/27 15:13:15 $
+ Last modified: $Date: 2009/07/27 15:14:52 $
From sabre at nondot.org Mon Jul 27 10:17:24 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 10:17:24 -0500
Subject: [llvm-commits] CVS: llvm-www/Users.html
Message-ID: <200907271517.n6RFHNpt009846@zion.cs.uiuc.edu>
Changes in directory llvm-www:
Users.html updated: 1.56 -> 1.57
---
Log message:
fix validation problem
---
Diffs of the changes: (+3 -3)
Users.html | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.56 llvm-www/Users.html:1.57
--- llvm-www/Users.html:1.56 Mon Jul 27 10:14:52 2009
+++ llvm-www/Users.html Mon Jul 27 10:17:07 2009
@@ -113,7 +113,7 @@
| NVIDIA |
OpenCL runtime compiler (Clang + LLVM) |
-
+
@@ -248,7 +248,7 @@
Åbo Akademi University |
Johan Lilius's Research Group, ES Lab |
NECST project
- |
+
@@ -457,6 +457,6 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Development List
- Last modified: $Date: 2009/07/27 15:14:52 $
+ Last modified: $Date: 2009/07/27 15:17:07 $
From sabre at nondot.org Mon Jul 27 10:18:57 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 10:18:57 -0500
Subject: [llvm-commits] CVS: llvm-www/Users.html
Message-ID: <200907271518.n6RFIvZq009933@zion.cs.uiuc.edu>
Changes in directory llvm-www:
Users.html updated: 1.57 -> 1.58
---
Log message:
mroe validation problems
---
Diffs of the changes: (+3 -3)
Users.html | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.57 llvm-www/Users.html:1.58
--- llvm-www/Users.html:1.57 Mon Jul 27 10:17:07 2009
+++ llvm-www/Users.html Mon Jul 27 10:18:40 2009
@@ -169,7 +169,7 @@
within IcedTea -->
|
- IcedTea Version of Sun's OpenJDK |
+ IcedTea Version of Sun's OpenJDK
Uses LLVM as JIT on architectures other than x86 and Sparc. |
@@ -196,7 +196,7 @@
| IOQuake3 |
- IOQuake3 Raytracing Patch, uses LLVM for runtime shader compilation. |
+ IOQuake3 Raytracing Patch, uses LLVM for runtime shader compilation. |
@@ -457,6 +457,6 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Development List
- Last modified: $Date: 2009/07/27 15:17:07 $
+ Last modified: $Date: 2009/07/27 15:18:40 $
From edwintorok at gmail.com Mon Jul 27 10:19:45 2009
From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=)
Date: Mon, 27 Jul 2009 18:19:45 +0300
Subject: [llvm-commits] [llvm] r77162 - /llvm/tags/Apple/llvmCore-XXXX/
In-Reply-To: <3B4176C9-7E28-45EB-BB13-455DE5E6F7CC@gmail.com>
References: <200907261840.n6QIeHnw025849@zion.cs.uiuc.edu> <5D9E9D3C-DEB3-45CE-A1F7-32CB43D937A5@gmail.com>
<3B4176C9-7E28-45EB-BB13-455DE5E6F7CC@gmail.com>
Message-ID: <4A6DC591.80108@gmail.com>
On 2009-07-26 23:53, Bill Wendling wrote:
> On Jul 26, 2009, at 1:25 PM, Jon Ziegler wrote:
>
>> As an aside, during execution of your script, it asked for this:
>> Authentication realm: LLVM Subversion
>> repository
>> Password for 'root':
>> a couple of times, which seems unlikely to be what is desired.
>>
>>
> That's coming from SVN. I've had it happen to me too. It seems to go
> away (for the next time) after entering the password. It comes back at
> random, though...
>
Why root? Surely you are not committing as root ...
Best regards,
--Edwin
From sabre at nondot.org Mon Jul 27 10:25:31 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 10:25:31 -0500
Subject: [llvm-commits] CVS: llvm-www/Users.html
Message-ID: <200907271525.n6RFPV0p010174@zion.cs.uiuc.edu>
Changes in directory llvm-www:
Users.html updated: 1.58 -> 1.59
---
Log message:
add Objective Modula-2, from Benjamin Kowarsch
---
Diffs of the changes: (+6 -1)
Users.html | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: llvm-www/Users.html
diff -u llvm-www/Users.html:1.58 llvm-www/Users.html:1.59
--- llvm-www/Users.html:1.58 Mon Jul 27 10:18:40 2009
+++ llvm-www/Users.html Mon Jul 27 10:24:16 2009
@@ -163,6 +163,11 @@
Project |
Description |
+
+
+ | Objective Modula-2 Project |
+ Modula-2 compiler w/ObjC runtime support. Targets Objective-C and LLVM. |
+
From sabre at nondot.org Mon Jul 27 10:44:18 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 15:44:18 -0000
Subject: [llvm-commits] [llvm] r77191 - in /llvm/trunk/lib/Target:
DarwinTargetAsmInfo.cpp X86/X86TargetAsmInfo.cpp
Message-ID: <200907271544.n6RFiJHp010799@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 10:44:04 2009
New Revision: 77191
URL: http://llvm.org/viewvc/llvm-project?rev=77191&view=rev
Log:
32-bit darwin targets support .literal16 too.
Modified:
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=77191&r1=77190&r2=77191&view=diff
==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Mon Jul 27 10:44:04 2009
@@ -34,10 +34,8 @@
SectionKind::MergeableConst4);
EightByteConstantSection = getOrCreateSection("\t.literal8\n", true,
SectionKind::MergeableConst8);
-
- // Note: 16-byte constant section is subtarget specific and should be provided
- // there, if needed.
- SixteenByteConstantSection = 0;
+ SixteenByteConstantSection =
+ getOrCreateSection("\t.literal16\n", true, SectionKind::MergeableConst16);
ReadOnlySection = getOrCreateSection("\t.const", true, SectionKind::ReadOnly);
@@ -150,7 +148,7 @@
return FourByteConstantSection;
if (Kind.isMergeableConst8())
return EightByteConstantSection;
- if (Kind.isMergeableConst16() && SixteenByteConstantSection)
+ if (Kind.isMergeableConst16())
return SixteenByteConstantSection;
return ReadOnlySection; // .const
}
@@ -196,7 +194,7 @@
return FourByteConstantSection;
if (Kind.isMergeableConst8())
return EightByteConstantSection;
- if (Kind.isMergeableConst16() && SixteenByteConstantSection)
+ if (Kind.isMergeableConst16())
return SixteenByteConstantSection;
return ReadOnlySection; // .const
}
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77191&r1=77190&r2=77191&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Jul 27 10:44:04 2009
@@ -55,10 +55,6 @@
ConstantPoolSection = "\t.const_data";
else
ConstantPoolSection = "\t.const\n";
- // FIXME: Why don't we always use this section?
- if (is64Bit)
- SixteenByteConstantSection =
- getOrCreateSection("\t.literal16\n", true, SectionKind::MergeableConst16);
LCOMMDirective = "\t.lcomm\t";
// Leopard and above support aligned common symbols.
From sabre at nondot.org Mon Jul 27 10:52:59 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 15:52:59 -0000
Subject: [llvm-commits] [llvm] r77192 -
/llvm/trunk/test/CodeGen/X86/global-sections.ll
Message-ID: <200907271552.n6RFqxPc011077@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 10:52:58 2009
New Revision: 77192
URL: http://llvm.org/viewvc/llvm-project?rev=77192&view=rev
Log:
update testcase.
Modified:
llvm/trunk/test/CodeGen/X86/global-sections.ll
Modified: llvm/trunk/test/CodeGen/X86/global-sections.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/global-sections.ll?rev=77192&r1=77191&r2=77192&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/global-sections.ll (original)
+++ llvm/trunk/test/CodeGen/X86/global-sections.ll Mon Jul 27 10:52:58 2009
@@ -37,7 +37,7 @@
; _Complex long long const G4 = 34;
@G4 = constant {i64,i64} { i64 34, i64 0 }
-; DARWIN: .const
+; DARWIN: .literal16
; DARWIN: _G4:
; DARWIN: .long 34
From gohman at apple.com Mon Jul 27 11:09:53 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 16:09:53 -0000
Subject: [llvm-commits] [llvm] r77193 - in /llvm/trunk:
include/llvm/Analysis/ScalarEvolution.h lib/Analysis/ScalarEvolution.cpp
Message-ID: <200907271609.n6RG9tID011559@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 11:09:48 2009
New Revision: 77193
URL: http://llvm.org/viewvc/llvm-project?rev=77193&view=rev
Log:
Fix wording in comments.
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=77193&r1=77192&r2=77193&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Jul 27 11:09:48 2009
@@ -299,7 +299,7 @@
const Loop *L,
ICmpInst::Predicate p);
- /// ComputeBackedgeTakenCountExhaustively - If the trip is known to execute
+ /// ComputeBackedgeTakenCountExhaustively - If the loop is known to execute
/// a constant number of times (the condition evolves only from constants),
/// try to evaluate a few iterations of the loop until we get the exit
/// condition gets a value of ExitWhen (true or false). If we cannot
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=77193&r1=77192&r2=77193&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jul 27 11:09:48 2009
@@ -3709,7 +3709,7 @@
}
}
-/// ComputeBackedgeTakenCountExhaustively - If the trip is known to execute a
+/// ComputeBackedgeTakenCountExhaustively - If the loop is known to execute a
/// constant number of times (the condition evolves only from constants),
/// try to evaluate a few iterations of the loop until we get the exit
/// condition gets a value of ExitWhen (true or false). If we cannot
From gohman at apple.com Mon Jul 27 11:11:46 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 16:11:46 -0000
Subject: [llvm-commits] [llvm] r77194 - in /llvm/trunk:
lib/AsmParser/LLParser.cpp lib/VMCore/AsmWriter.cpp
test/Analysis/ScalarEvolution/nsw.ll test/Assembler/flags-reversed.ll
test/Assembler/flags-signed.ll test/Assembler/flags-unsigned.ll
test/Assembler/flags.ll
Message-ID: <200907271611.n6RGBlZ4011643@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 11:11:46 2009
New Revision: 77194
URL: http://llvm.org/viewvc/llvm-project?rev=77194&view=rev
Log:
Change the assembly syntax for nsw, nuw, and exact, putting them
after their associated opcodes rather than before. This makes them
a little easier to read.
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll
llvm/trunk/test/Assembler/flags-reversed.ll
llvm/trunk/test/Assembler/flags-signed.ll
llvm/trunk/test/Assembler/flags-unsigned.ll
llvm/trunk/test/Assembler/flags.ll
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=77194&r1=77193&r2=77194&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jul 27 11:11:46 2009
@@ -1954,9 +1954,27 @@
case lltok::kw_urem:
case lltok::kw_srem:
case lltok::kw_frem: {
+ bool NUW = false;
+ bool NSW = false;
+ bool Exact = false;
unsigned Opc = Lex.getUIntVal();
Constant *Val0, *Val1;
Lex.Lex();
+ LocTy ModifierLoc = Lex.getLoc();
+ if (Opc == Instruction::Add ||
+ Opc == Instruction::Sub ||
+ Opc == Instruction::Mul) {
+ if (EatIfPresent(lltok::kw_nuw))
+ NUW = true;
+ if (EatIfPresent(lltok::kw_nsw)) {
+ NSW = true;
+ if (EatIfPresent(lltok::kw_nuw))
+ NUW = true;
+ }
+ } else if (Opc == Instruction::SDiv) {
+ if (EatIfPresent(lltok::kw_exact))
+ Exact = true;
+ }
if (ParseToken(lltok::lparen, "expected '(' in binary constantexpr") ||
ParseGlobalTypeAndValue(Val0) ||
ParseToken(lltok::comma, "expected comma in binary constantexpr") ||
@@ -1965,10 +1983,25 @@
return true;
if (Val0->getType() != Val1->getType())
return Error(ID.Loc, "operands of constexpr must have same type");
+ if (!Val0->getType()->isIntOrIntVector()) {
+ if (NUW)
+ return Error(ModifierLoc, "nuw only applies to integer operations");
+ if (NSW)
+ return Error(ModifierLoc, "nsw only applies to integer operations");
+ }
+ // API compatibility: Accept either integer or floating-point types with
+ // add, sub, and mul.
if (!Val0->getType()->isIntOrIntVector() &&
!Val0->getType()->isFPOrFPVector())
return Error(ID.Loc,"constexpr requires integer, fp, or vector operands");
- ID.ConstantVal = Context.getConstantExpr(Opc, Val0, Val1);
+ Constant *C = Context.getConstantExpr(Opc, Val0, Val1);
+ if (NUW)
+ cast(C)->setHasNoUnsignedOverflow(true);
+ if (NSW)
+ cast(C)->setHasNoSignedOverflow(true);
+ if (Exact)
+ cast(C)->setIsExact(true);
+ ID.ConstantVal = C;
ID.Kind = ValID::t_Constant;
return false;
}
@@ -2055,49 +2088,6 @@
ID.Kind = ValID::t_Constant;
return false;
}
- case lltok::kw_nuw: {
- Lex.Lex();
- bool AlsoSigned = EatIfPresent(lltok::kw_nsw);
- if (Lex.getKind() != lltok::kw_add &&
- Lex.getKind() != lltok::kw_sub &&
- Lex.getKind() != lltok::kw_mul)
- return TokError("expected 'add', 'sub', or 'mul'");
- bool Result = LLParser::ParseValID(ID);
- if (!Result) {
- cast(ID.ConstantVal)
- ->setHasNoUnsignedOverflow(true);
- if (AlsoSigned)
- cast(ID.ConstantVal)
- ->setHasNoSignedOverflow(true);
- }
- return Result;
- }
- case lltok::kw_nsw: {
- Lex.Lex();
- bool AlsoUnsigned = EatIfPresent(lltok::kw_nuw);
- if (Lex.getKind() != lltok::kw_add &&
- Lex.getKind() != lltok::kw_sub &&
- Lex.getKind() != lltok::kw_mul)
- return TokError("expected 'add', 'sub', or 'mul'");
- bool Result = LLParser::ParseValID(ID);
- if (!Result) {
- cast(ID.ConstantVal)
- ->setHasNoSignedOverflow(true);
- if (AlsoUnsigned)
- cast(ID.ConstantVal)
- ->setHasNoUnsignedOverflow(true);
- }
- return Result;
- }
- case lltok::kw_exact: {
- Lex.Lex();
- if (Lex.getKind() != lltok::kw_sdiv)
- return TokError("expected 'sdiv'");
- bool Result = LLParser::ParseValID(ID);
- if (!Result)
- cast(ID.ConstantVal)->setIsExact(true);
- return Result;
- }
}
Lex.Lex();
@@ -2563,15 +2553,49 @@
// Binary Operators.
case lltok::kw_add:
case lltok::kw_sub:
- case lltok::kw_mul:
+ case lltok::kw_mul: {
+ bool NUW = false;
+ bool NSW = false;
+ LocTy ModifierLoc = Lex.getLoc();
+ if (EatIfPresent(lltok::kw_nuw))
+ NUW = true;
+ if (EatIfPresent(lltok::kw_nsw)) {
+ NSW = true;
+ if (EatIfPresent(lltok::kw_nuw))
+ NUW = true;
+ }
// API compatibility: Accept either integer or floating-point types.
- return ParseArithmetic(Inst, PFS, KeywordVal, 0);
+ bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 0);
+ if (!Result) {
+ if (!Inst->getType()->isIntOrIntVector()) {
+ if (NUW)
+ return Error(ModifierLoc, "nuw only applies to integer operations");
+ if (NSW)
+ return Error(ModifierLoc, "nsw only applies to integer operations");
+ }
+ if (NUW)
+ cast(Inst)->setHasNoUnsignedOverflow(true);
+ if (NSW)
+ cast(Inst)->setHasNoSignedOverflow(true);
+ }
+ return Result;
+ }
case lltok::kw_fadd:
case lltok::kw_fsub:
case lltok::kw_fmul: return ParseArithmetic(Inst, PFS, KeywordVal, 2);
+ case lltok::kw_sdiv: {
+ bool Exact = false;
+ if (EatIfPresent(lltok::kw_exact))
+ Exact = true;
+ bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 1);
+ if (!Result)
+ if (Exact)
+ cast(Inst)->setIsExact(true);
+ return Result;
+ }
+
case lltok::kw_udiv:
- case lltok::kw_sdiv:
case lltok::kw_urem:
case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1);
case lltok::kw_fdiv:
@@ -2619,50 +2643,6 @@
return ParseStore(Inst, PFS, true);
else
return TokError("expected 'load' or 'store'");
- case lltok::kw_nuw: {
- bool AlsoSigned = EatIfPresent(lltok::kw_nsw);
- if (Lex.getKind() == lltok::kw_add ||
- Lex.getKind() == lltok::kw_sub ||
- Lex.getKind() == lltok::kw_mul) {
- Lex.Lex();
- KeywordVal = Lex.getUIntVal();
- bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 0);
- if (!Result) {
- cast(Inst)->setHasNoUnsignedOverflow(true);
- if (AlsoSigned)
- cast(Inst)->setHasNoSignedOverflow(true);
- }
- return Result;
- }
- return TokError("expected 'add', 'sub', or 'mul'");
- }
- case lltok::kw_nsw: {
- bool AlsoUnsigned = EatIfPresent(lltok::kw_nuw);
- if (Lex.getKind() == lltok::kw_add ||
- Lex.getKind() == lltok::kw_sub ||
- Lex.getKind() == lltok::kw_mul) {
- Lex.Lex();
- KeywordVal = Lex.getUIntVal();
- bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 1);
- if (!Result) {
- cast(Inst)->setHasNoSignedOverflow(true);
- if (AlsoUnsigned)
- cast(Inst)->setHasNoUnsignedOverflow(true);
- }
- return Result;
- }
- return TokError("expected 'add', 'sub', or 'mul'");
- }
- case lltok::kw_exact:
- if (Lex.getKind() == lltok::kw_sdiv) {
- Lex.Lex();
- KeywordVal = Lex.getUIntVal();
- bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 1);
- if (!Result)
- cast(Inst)->setIsExact(true);
- return Result;
- }
- return TokError("expected 'udiv'");
case lltok::kw_getresult: return ParseGetResult(Inst, PFS);
case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
case lltok::kw_extractvalue: return ParseExtractValue(Inst, PFS);
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=77194&r1=77193&r2=77194&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Jul 27 11:11:46 2009
@@ -848,12 +848,12 @@
if (const OverflowingBinaryOperator *OBO =
dyn_cast(U)) {
if (OBO->hasNoUnsignedOverflow())
- Out << "nuw ";
+ Out << " nuw";
if (OBO->hasNoSignedOverflow())
- Out << "nsw ";
+ Out << " nsw";
} else if (const SDivOperator *Div = dyn_cast(U)) {
if (Div->isExact())
- Out << "exact ";
+ Out << " exact";
}
}
@@ -1061,8 +1061,8 @@
}
if (const ConstantExpr *CE = dyn_cast(CV)) {
- WriteOptimizationInfo(Out, CE);
Out << CE->getOpcodeName();
+ WriteOptimizationInfo(Out, CE);
if (CE->isCompare())
Out << ' ' << getPredicateText(CE->getPredicate());
Out << " (";
@@ -1694,12 +1694,12 @@
Out << "tail ";
}
- // Print out optimization information.
- WriteOptimizationInfo(Out, &I);
-
// Print out the opcode...
Out << I.getOpcodeName();
+ // Print out optimization information.
+ WriteOptimizationInfo(Out, &I);
+
// Print out the compare instruction predicates
if (const CmpInst *CI = dyn_cast(&I))
Out << ' ' << getPredicateText(CI->getPredicate());
Modified: llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll?rev=77194&r1=77193&r2=77194&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll Mon Jul 27 11:11:46 2009
@@ -22,7 +22,7 @@
%tmp6 = sext i32 %i.01 to i64 ; [#uses=1]
%tmp7 = getelementptr double* %p, i64 %tmp6 ; [#uses=1]
store double %tmp5, double* %tmp7, align 8
- %tmp8 = nsw add i32 %i.01, 1 ; [#uses=2]
+ %tmp8 = add nsw i32 %i.01, 1 ; [#uses=2]
br label %bb1
bb1: ; preds = %bb
Modified: llvm/trunk/test/Assembler/flags-reversed.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-reversed.ll?rev=77194&r1=77193&r2=77194&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/flags-reversed.ll (original)
+++ llvm/trunk/test/Assembler/flags-reversed.ll Mon Jul 27 11:11:46 2009
@@ -3,16 +3,16 @@
@addr = external global i64
define i64 @add_both_reversed_ce() {
-; CHECK: ret i64 nuw nsw add (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw nuw add (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @sub_both_reversed_ce() {
-; CHECK: ret i64 nuw nsw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw nuw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 sub nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @mul_both_reversed_ce() {
-; CHECK: ret i64 nuw nsw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw nuw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 mul nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
Modified: llvm/trunk/test/Assembler/flags-signed.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-signed.ll?rev=77194&r1=77193&r2=77194&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/flags-signed.ll (original)
+++ llvm/trunk/test/Assembler/flags-signed.ll Mon Jul 27 11:11:46 2009
@@ -3,16 +3,16 @@
@addr = external global i64
define i64 @add_signed_ce() {
-; CHECK: ret i64 nsw add (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw add (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @sub_signed_ce() {
-; CHECK: ret i64 nsw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @mul_signed_ce() {
-; CHECK: ret i64 nsw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
Modified: llvm/trunk/test/Assembler/flags-unsigned.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-unsigned.ll?rev=77194&r1=77193&r2=77194&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/flags-unsigned.ll (original)
+++ llvm/trunk/test/Assembler/flags-unsigned.ll Mon Jul 27 11:11:46 2009
@@ -3,16 +3,16 @@
@addr = external global i64
define i64 @add_unsigned_ce() {
-; CHECK: ret i64 nuw add (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nuw add (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @sub_unsigned_ce() {
-; CHECK: ret i64 nuw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nuw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @mul_unsigned_ce() {
-; CHECK: ret i64 nuw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nuw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
Modified: llvm/trunk/test/Assembler/flags.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags.ll?rev=77194&r1=77193&r2=77194&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/flags.ll (original)
+++ llvm/trunk/test/Assembler/flags.ll Mon Jul 27 11:11:46 2009
@@ -3,38 +3,38 @@
@addr = external global i64
define i64 @add_unsigned(i64 %x, i64 %y) {
-; CHECK: %z = nuw add i64 %x, %y
- %z = nuw add i64 %x, %y
+; CHECK: %z = add nuw i64 %x, %y
+ %z = add nuw i64 %x, %y
ret i64 %z
}
define i64 @sub_unsigned(i64 %x, i64 %y) {
-; CHECK: %z = nuw sub i64 %x, %y
- %z = nuw sub i64 %x, %y
+; CHECK: %z = sub nuw i64 %x, %y
+ %z = sub nuw i64 %x, %y
ret i64 %z
}
define i64 @mul_unsigned(i64 %x, i64 %y) {
-; CHECK: %z = nuw mul i64 %x, %y
- %z = nuw mul i64 %x, %y
+; CHECK: %z = mul nuw i64 %x, %y
+ %z = mul nuw i64 %x, %y
ret i64 %z
}
define i64 @add_signed(i64 %x, i64 %y) {
-; CHECK: %z = nsw add i64 %x, %y
- %z = nsw add i64 %x, %y
+; CHECK: %z = add nsw i64 %x, %y
+ %z = add nsw i64 %x, %y
ret i64 %z
}
define i64 @sub_signed(i64 %x, i64 %y) {
-; CHECK: %z = nsw sub i64 %x, %y
- %z = nsw sub i64 %x, %y
+; CHECK: %z = sub nsw i64 %x, %y
+ %z = sub nsw i64 %x, %y
ret i64 %z
}
define i64 @mul_signed(i64 %x, i64 %y) {
-; CHECK: %z = nsw mul i64 %x, %y
- %z = nsw mul i64 %x, %y
+; CHECK: %z = mul nsw i64 %x, %y
+ %z = mul nsw i64 %x, %y
ret i64 %z
}
@@ -57,44 +57,44 @@
}
define i64 @add_both(i64 %x, i64 %y) {
-; CHECK: %z = nuw nsw add i64 %x, %y
- %z = nuw nsw add i64 %x, %y
+; CHECK: %z = add nuw nsw i64 %x, %y
+ %z = add nuw nsw i64 %x, %y
ret i64 %z
}
define i64 @sub_both(i64 %x, i64 %y) {
-; CHECK: %z = nuw nsw sub i64 %x, %y
- %z = nuw nsw sub i64 %x, %y
+; CHECK: %z = sub nuw nsw i64 %x, %y
+ %z = sub nuw nsw i64 %x, %y
ret i64 %z
}
define i64 @mul_both(i64 %x, i64 %y) {
-; CHECK: %z = nuw nsw mul i64 %x, %y
- %z = nuw nsw mul i64 %x, %y
+; CHECK: %z = mul nuw nsw i64 %x, %y
+ %z = mul nuw nsw i64 %x, %y
ret i64 %z
}
define i64 @add_both_reversed(i64 %x, i64 %y) {
-; CHECK: %z = nuw nsw add i64 %x, %y
- %z = nsw nuw add i64 %x, %y
+; CHECK: %z = add nuw nsw i64 %x, %y
+ %z = add nsw nuw i64 %x, %y
ret i64 %z
}
define i64 @sub_both_reversed(i64 %x, i64 %y) {
-; CHECK: %z = nuw nsw sub i64 %x, %y
- %z = nsw nuw sub i64 %x, %y
+; CHECK: %z = sub nuw nsw i64 %x, %y
+ %z = sub nsw nuw i64 %x, %y
ret i64 %z
}
define i64 @mul_both_reversed(i64 %x, i64 %y) {
-; CHECK: %z = nuw nsw mul i64 %x, %y
- %z = nsw nuw mul i64 %x, %y
+; CHECK: %z = mul nuw nsw i64 %x, %y
+ %z = mul nsw nuw i64 %x, %y
ret i64 %z
}
define i64 @sdiv_exact(i64 %x, i64 %y) {
-; CHECK: %z = exact sdiv i64 %x, %y
- %z = exact sdiv i64 %x, %y
+; CHECK: %z = sdiv exact i64 %x, %y
+ %z = sdiv exact i64 %x, %y
ret i64 %z
}
@@ -105,21 +105,21 @@
}
define i64 @add_both_ce() {
-; CHECK: ret i64 nuw nsw add (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw nuw add (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @sub_both_ce() {
-; CHECK: ret i64 nuw nsw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nsw nuw sub (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 sub nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @mul_both_ce() {
-; CHECK: ret i64 nuw nsw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 nuw nsw mul (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
}
define i64 @sdiv_exact_ce() {
-; CHECK: ret i64 exact sdiv (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 exact sdiv (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)
+ ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)
}
From clattner at apple.com Mon Jul 27 11:14:38 2009
From: clattner at apple.com (Chris Lattner)
Date: Mon, 27 Jul 2009 09:14:38 -0700
Subject: [llvm-commits] [llvm] r77194 - in /llvm/trunk:
lib/AsmParser/LLParser.cpp lib/VMCore/AsmWriter.cpp
test/Analysis/ScalarEvolution/nsw.ll
test/Assembler/flags-reversed.ll test/Assembler/flags-signed.ll
test/Assembler/flags-unsigned.ll test/Assembler/flags.ll
In-Reply-To: <200907271611.n6RGBlZ4011643@zion.cs.uiuc.edu>
References: <200907271611.n6RGBlZ4011643@zion.cs.uiuc.edu>
Message-ID:
On Jul 27, 2009, at 9:11 AM, Dan Gohman wrote:
> Author: djg
> Date: Mon Jul 27 11:11:46 2009
> New Revision: 77194
>
> URL: http://llvm.org/viewvc/llvm-project?rev=77194&view=rev
> Log:
> Change the assembly syntax for nsw, nuw, and exact, putting them
> after their associated opcodes rather than before. This makes them
> a little easier to read.
Thanks Dan!
-Chris
From sanjiv.gupta at microchip.com Mon Jul 27 11:20:54 2009
From: sanjiv.gupta at microchip.com (Sanjiv Gupta)
Date: Mon, 27 Jul 2009 16:20:54 -0000
Subject: [llvm-commits] [llvm] r77195 -
/llvm/trunk/test/CodeGen/PIC16/global-in-user-section.ll
Message-ID: <200907271620.n6RGKti2011875@zion.cs.uiuc.edu>
Author: sgupta
Date: Mon Jul 27 11:20:41 2009
New Revision: 77195
URL: http://llvm.org/viewvc/llvm-project?rev=77195&view=rev
Log:
Test case to check that separate section is created for a global variable specified with section attribute.
Added:
llvm/trunk/test/CodeGen/PIC16/global-in-user-section.ll
Added: llvm/trunk/test/CodeGen/PIC16/global-in-user-section.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PIC16/global-in-user-section.ll?rev=77195&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PIC16/global-in-user-section.ll (added)
+++ llvm/trunk/test/CodeGen/PIC16/global-in-user-section.ll Mon Jul 27 11:20:41 2009
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llc -march=pic16 | FileCheck %s
+
+ at G1 = common global i16 0, section "usersection", align 1
+; CHECK: usersection UDATA
+; CHECK: @G1 RES 2
From sabre at nondot.org Mon Jul 27 11:20:59 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 16:20:59 -0000
Subject: [llvm-commits] [llvm] r77196 - in /llvm/trunk/lib/Target:
DarwinTargetAsmInfo.cpp ELFTargetAsmInfo.cpp
Message-ID: <200907271620.n6RGKxcv011891@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 11:20:58 2009
New Revision: 77196
URL: http://llvm.org/viewvc/llvm-project?rev=77196&view=rev
Log:
sink text/data section creation down into the target-specific places that
should know about them. PECoff doesn't share these, and I want all sections
to be created by object-file-specific code.
Modified:
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=77196&r1=77195&r2=77196&view=diff
==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Mon Jul 27 11:20:58 2009
@@ -27,6 +27,8 @@
DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM)
: TargetAsmInfo(TM) {
+ TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("\t.data", true, SectionKind::DataRel);
CStringSection_ = getOrCreateSection("\t.cstring", true,
SectionKind::MergeableCString);
@@ -50,7 +52,6 @@
SectionKind::ReadOnlyWithRel);
DataCoalSection = getOrCreateSection("\t__DATA,__datacoal_nt,coalesced",
false, SectionKind::DataRel);
-
// Common settings for all Darwin targets.
// Syntax:
Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=77196&r1=77195&r2=77196&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Mon Jul 27 11:20:58 2009
@@ -26,6 +26,9 @@
ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM)
: TargetAsmInfo(TM) {
+
+ TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("\t.data", true, SectionKind::DataRel);
ReadOnlySection =
getOrCreateSection("\t.rodata", false, SectionKind::ReadOnly);
TLSDataSection =
From sanjiv.gupta at microchip.com Mon Jul 27 11:22:12 2009
From: sanjiv.gupta at microchip.com (Sanjiv Gupta)
Date: Mon, 27 Jul 2009 21:52:12 +0530
Subject: [llvm-commits] [llvm] r77153 -
/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
In-Reply-To: <7E5C84F2-926B-413A-8044-C03EDD7079EA@apple.com>
References: <200907261025.n6QAPSPr012172@zion.cs.uiuc.edu>
<7E5C84F2-926B-413A-8044-C03EDD7079EA@apple.com>
Message-ID: <4A6DD434.5020005@microchip.com>
Chris Lattner wrote:
>
> On Jul 26, 2009, at 3:25 AM, Sanjiv Gupta wrote:
>
>> Author: sgupta
>> Date: Sun Jul 26 05:25:01 2009
>> New Revision: 77153
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=77153&view=rev
>> Log:
>> Fix the breakage caused by 76950.
>> PIC16 has special naming conventions for variables having section
>> names specified via section attribute.
>
> Testcase??
r77195.
- Sanjiv
From sabre at nondot.org Mon Jul 27 11:22:40 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 16:22:40 -0000
Subject: [llvm-commits] [llvm] r77197 -
/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Message-ID: <200907271622.n6RGMfhc011944@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 11:22:39 2009
New Revision: 77197
URL: http://llvm.org/viewvc/llvm-project?rev=77197&view=rev
Log:
apparently we have "windows" and "coff", which are different(?)
Modified:
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77197&r1=77196&r2=77197&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Jul 27 11:22:39 2009
@@ -191,6 +191,9 @@
X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM):
X86GenericTargetAsmInfo(TM) {
+ TextSection = getOrCreateSection("_text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
+
GlobalPrefix = "_";
LCOMMDirective = "\t.lcomm\t";
COMMDirectiveTakesAlignment = false;
From sabre at nondot.org Mon Jul 27 11:27:49 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 16:27:49 -0000
Subject: [llvm-commits] [llvm] r77198 - in /llvm/trunk:
include/llvm/Target/ELFTargetAsmInfo.h lib/Target/ELFTargetAsmInfo.cpp
Message-ID: <200907271627.n6RGRqWL012088@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 11:27:32 2009
New Revision: 77198
URL: http://llvm.org/viewvc/llvm-project?rev=77198&view=rev
Log:
inline a method.
Modified:
llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=77198&r1=77197&r2=77198&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Mon Jul 27 11:27:32 2009
@@ -19,10 +19,8 @@
namespace llvm {
class GlobalValue;
- class GlobalVariable;
- class Type;
- struct ELFTargetAsmInfo: public TargetAsmInfo {
+ struct ELFTargetAsmInfo : public TargetAsmInfo {
ELFTargetAsmInfo(const TargetMachine &TM);
/// getSectionForMergeableConstant - Given a mergeable constant with the
@@ -49,9 +47,6 @@
const Section *MergeableConst4Section;
const Section *MergeableConst8Section;
const Section *MergeableConst16Section;
-
- private:
- const Section *MergeableStringSection(const GlobalVariable *GV) const;
};
}
Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=77198&r1=77197&r2=77198&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Mon Jul 27 11:27:32 2009
@@ -58,8 +58,30 @@
ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
SectionKind Kind) const {
if (Kind.isText()) return TextSection;
- if (Kind.isMergeableCString())
- return MergeableStringSection(cast(GV));
+ if (Kind.isMergeableCString()) {
+ const TargetData *TD = TM.getTargetData();
+ Constant *C = cast(GV)->getInitializer();
+ const Type *Ty = cast(C->getType())->getElementType();
+
+ unsigned Size = TD->getTypeAllocSize(Ty);
+ if (Size <= 16) {
+ assert(getCStringSection() && "Should have string section prefix");
+
+ // We also need alignment here.
+ // FIXME: this is getting the alignment of the character, not the
+ // alignment of the string!!
+ unsigned Align = TD->getPrefTypeAlignment(Ty);
+ if (Align < Size)
+ Align = Size;
+
+ std::string Name = getCStringSection() + utostr(Size) + '.' +
+ utostr(Align);
+ return getOrCreateSection(Name.c_str(), false,
+ SectionKind::MergeableCString);
+ }
+
+ return getReadOnlySection();
+ }
if (Kind.isMergeableConst()) {
if (Kind.isMergeableConst4())
@@ -145,32 +167,6 @@
}
-
-const Section*
-ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
- const TargetData *TD = TM.getTargetData();
- Constant *C = cast(GV)->getInitializer();
- const Type *Ty = cast(C->getType())->getElementType();
-
- unsigned Size = TD->getTypeAllocSize(Ty);
- if (Size <= 16) {
- assert(getCStringSection() && "Should have string section prefix");
-
- // We also need alignment here.
- // FIXME: this is getting the alignment of the character, not the alignment
- // of the string!!
- unsigned Align = TD->getPrefTypeAlignment(Ty);
- if (Align < Size)
- Align = Size;
-
- std::string Name = getCStringSection() + utostr(Size) + '.' + utostr(Align);
- return getOrCreateSection(Name.c_str(), false,
- SectionKind::MergeableCString);
- }
-
- return getReadOnlySection();
-}
-
void ELFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
SmallVectorImpl &Str) const {
Str.push_back(',');
From david_goodwin at apple.com Mon Jul 27 11:32:07 2009
From: david_goodwin at apple.com (David Goodwin)
Date: Mon, 27 Jul 2009 16:32:07 -0000
Subject: [llvm-commits] [llvm] r77199 - in /llvm/trunk: lib/Target/ARM/
test/CodeGen/Thumb2/
Message-ID: <200907271632.n6RGWHet012263@zion.cs.uiuc.edu>
Author: david_goodwin
Date: Mon Jul 27 11:31:55 2009
New Revision: 77199
URL: http://llvm.org/viewvc/llvm-project?rev=77199&view=rev
Log:
Add ".w" suffix for wide thumb-2 instructions.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
llvm/trunk/test/CodeGen/Thumb2/carry.ll
llvm/trunk/test/CodeGen/Thumb2/load-global.ll
llvm/trunk/test/CodeGen/Thumb2/mul_const.ll
llvm/trunk/test/CodeGen/Thumb2/pic-load.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-adc2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-and.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-asr.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-asr2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-eor.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-jtbl.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-ldr.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrb.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrh.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-mov3.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-mvn2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-neg.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-orr.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-rev.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-ror.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-ror2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-sbc2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-str.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-strb.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-strh.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-sub.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-sub4.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-sub5.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-teq.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-teq2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-tst.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-tst2.ll
llvm/trunk/test/CodeGen/Thumb2/tls2.ll
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Mon Jul 27 11:31:55 2009
@@ -153,11 +153,11 @@
}
// register
def r : T2I<(outs GPR:$dst), (ins GPR:$src),
- opc, " $dst, $src",
+ opc, ".w $dst, $src",
[(set GPR:$dst, (opnode GPR:$src))]>;
// shifted register
def s : T2I<(outs GPR:$dst), (ins t2_so_reg:$src),
- opc, " $dst, $src",
+ opc, ".w $dst, $src",
[(set GPR:$dst, (opnode t2_so_reg:$src))]>;
}
@@ -171,13 +171,13 @@
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>;
// register
def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
let isCommutable = Commutable;
}
// shifted register
def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
}
@@ -187,7 +187,7 @@
multiclass T2I_rbin_is {
// shifted imm
def ri : T2I<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs),
- opc, " $dst, $rhs, $lhs",
+ opc, ".w $dst, $rhs, $lhs",
[(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>;
// shifted register
def rs : T2I<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs),
@@ -201,17 +201,17 @@
multiclass T2I_bin_s_irs {
// shifted imm
def ri : T2I<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
- !strconcat(opc, "s"), " $dst, $lhs, $rhs",
+ !strconcat(opc, "s"), ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>;
// register
def rr : T2I<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- !strconcat(opc, "s"), " $dst, $lhs, $rhs",
+ !strconcat(opc, "s"), ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
let isCommutable = Commutable;
}
// shifted register
def rs : T2I<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
- !strconcat(opc, "s"), " $dst, $lhs, $rhs",
+ !strconcat(opc, "s"), ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
}
}
@@ -221,7 +221,7 @@
multiclass T2I_bin_ii12rs {
// shifted imm
def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>;
// 12-bit imm
def ri12 : T2sI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
@@ -229,13 +229,13 @@
[(set GPR:$dst, (opnode GPR:$lhs, imm0_4095:$rhs))]>;
// register
def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
let isCommutable = Commutable;
}
// shifted register
def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
}
@@ -251,14 +251,14 @@
Requires<[IsThumb2, CarryDefIsUnused]>;
// register
def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>,
Requires<[IsThumb2, CarryDefIsUnused]> {
let isCommutable = Commutable;
}
// shifted register
def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>,
Requires<[IsThumb2, CarryDefIsUnused]>;
// Carry setting variants
@@ -271,7 +271,7 @@
}
// register
def Srr : T2XI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- !strconcat(opc, "s $dst, $lhs, $rhs"),
+ !strconcat(opc, "s.w $dst, $lhs, $rhs"),
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>,
Requires<[IsThumb2, CarryDefIsUsed]> {
let Defs = [CPSR];
@@ -279,7 +279,7 @@
}
// shifted register
def Srs : T2XI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
- !strconcat(opc, "s $dst, $lhs, $rhs"),
+ !strconcat(opc, "s.w $dst, $lhs, $rhs"),
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>,
Requires<[IsThumb2, CarryDefIsUsed]> {
let Defs = [CPSR];
@@ -319,14 +319,12 @@
}
}
-/// T2I_rbin_s_is - Same as T2I_bin_s_irs except the order of operands are
-/// reversed. It doesn't define the 'rr' form since it's handled by its
-/// T2I_bin_s_irs counterpart.
+/// T2I_rbin_s_is - Same as T2I_rbin_is except sets 's' bit.
let Defs = [CPSR] in {
multiclass T2I_rbin_s_is {
// shifted imm
def ri : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs, cc_out:$s),
- !strconcat(opc, "${s} $dst, $rhs, $lhs"),
+ !strconcat(opc, "${s}.w $dst, $rhs, $lhs"),
[(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>;
// shifted register
def rs : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs, cc_out:$s),
@@ -340,11 +338,11 @@
multiclass T2I_sh_ir {
// 5-bit imm
def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, imm1_31:$rhs))]>;
// register
def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- opc, " $dst, $lhs, $rhs",
+ opc, ".w $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>;
}
@@ -355,15 +353,15 @@
multiclass T2I_cmp_is {
// shifted imm
def ri : T2I<(outs), (ins GPR:$lhs, t2_so_imm:$rhs),
- opc, " $lhs, $rhs",
+ opc, ".w $lhs, $rhs",
[(opnode GPR:$lhs, t2_so_imm:$rhs)]>;
// register
def rr : T2I<(outs), (ins GPR:$lhs, GPR:$rhs),
- opc, " $lhs, $rhs",
+ opc, ".w $lhs, $rhs",
[(opnode GPR:$lhs, GPR:$rhs)]>;
// shifted register
def rs : T2I<(outs), (ins GPR:$lhs, t2_so_reg:$rhs),
- opc, " $lhs, $rhs",
+ opc, ".w $lhs, $rhs",
[(opnode GPR:$lhs, t2_so_reg:$rhs)]>;
}
}
@@ -371,29 +369,29 @@
/// T2I_ld - Defines a set of (op r, {imm12|imm8|so_reg}) load patterns.
multiclass T2I_ld {
def i12 : T2Ii12<(outs GPR:$dst), (ins t2addrmode_imm12:$addr),
- opc, " $dst, $addr",
+ opc, ".w $dst, $addr",
[(set GPR:$dst, (opnode t2addrmode_imm12:$addr))]>;
def i8 : T2Ii8 <(outs GPR:$dst), (ins t2addrmode_imm8:$addr),
opc, " $dst, $addr",
[(set GPR:$dst, (opnode t2addrmode_imm8:$addr))]>;
def s : T2Iso <(outs GPR:$dst), (ins t2addrmode_so_reg:$addr),
- opc, " $dst, $addr",
+ opc, ".w $dst, $addr",
[(set GPR:$dst, (opnode t2addrmode_so_reg:$addr))]>;
def pci : T2Ipc <(outs GPR:$dst), (ins i32imm:$addr),
- opc, " $dst, $addr",
+ opc, ".w $dst, $addr",
[(set GPR:$dst, (opnode (ARMWrapper tconstpool:$addr)))]>;
}
/// T2I_st - Defines a set of (op r, {imm12|imm8|so_reg}) store patterns.
multiclass T2I_st {
def i12 : T2Ii12<(outs), (ins GPR:$src, t2addrmode_imm12:$addr),
- opc, " $src, $addr",
+ opc, ".w $src, $addr",
[(opnode GPR:$src, t2addrmode_imm12:$addr)]>;
def i8 : T2Ii8 <(outs), (ins GPR:$src, t2addrmode_imm8:$addr),
opc, " $src, $addr",
[(opnode GPR:$src, t2addrmode_imm8:$addr)]>;
def s : T2Iso <(outs), (ins GPR:$src, t2addrmode_so_reg:$addr),
- opc, " $src, $addr",
+ opc, ".w $src, $addr",
[(opnode GPR:$src, t2addrmode_so_reg:$addr)]>;
}
@@ -414,10 +412,10 @@
/// register and one whose operand is a register rotated by 8/16/24.
multiclass T2I_unary_rrot {
def r : T2I<(outs GPR:$dst), (ins GPR:$Src),
- opc, " $dst, $Src",
+ opc, ".w $dst, $Src",
[(set GPR:$dst, (opnode GPR:$Src))]>;
def r_rot : T2I<(outs GPR:$dst), (ins GPR:$Src, i32imm:$rot),
- opc, " $dst, $Src, ror $rot",
+ opc, ".w $dst, $Src, ror $rot",
[(set GPR:$dst, (opnode (rotr GPR:$Src, rot_imm:$rot)))]>;
}
@@ -443,22 +441,22 @@
let isNotDuplicable = 1 in
def t2PICADD : T2XI<(outs GPR:$dst), (ins GPR:$lhs, pclabel:$cp),
- "$cp:\n\tadd $dst, $lhs, pc",
+ "$cp:\n\tadd.w $dst, $lhs, pc",
[(set GPR:$dst, (ARMpic_add GPR:$lhs, imm:$cp))]>;
// LEApcrel - Load a pc-relative address into a register without offending the
// assembler.
def t2LEApcrel : T2XI<(outs GPR:$dst), (ins i32imm:$label, pred:$p),
- "adr$p $dst, #$label", []>;
+ "adr$p.w $dst, #$label", []>;
def t2LEApcrelJT : T2XI<(outs GPR:$dst),
(ins i32imm:$label, i32imm:$id, pred:$p),
- "adr$p $dst, #${label}_${id:no_hash}", []>;
+ "adr$p.w $dst, #${label}_${id:no_hash}", []>;
// ADD rd, sp, #so_imm
def t2ADDrSPi : T2XI<(outs GPR:$dst), (ins GPR:$sp, t2_so_imm:$imm),
- "add $dst, $sp, $imm",
+ "add.w $dst, $sp, $imm",
[]>;
// ADD rd, sp, #imm12
@@ -657,12 +655,12 @@
let mayLoad = 1 in
def t2LDM : T2XI<(outs),
(ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops),
- "ldm${addr:submode}${p} $addr, $dst1", []>;
+ "ldm${addr:submode}${p}.w $addr, $dst1", []>;
let mayStore = 1 in
def t2STM : T2XI<(outs),
(ins addrmode4:$addr, pred:$p, reglist:$src1, variable_ops),
- "stm${addr:submode}${p} $addr, $src1", []>;
+ "stm${addr:submode}${p}.w $addr, $src1", []>;
//===----------------------------------------------------------------------===//
// Move Instructions.
@@ -670,11 +668,11 @@
let neverHasSideEffects = 1 in
def t2MOVr : T2sI<(outs GPR:$dst), (ins GPR:$src),
- "mov", " $dst, $src", []>;
+ "mov", ".w $dst, $src", []>;
let isReMaterializable = 1, isAsCheapAsAMove = 1 in
def t2MOVi : T2sI<(outs GPR:$dst), (ins t2_so_imm:$src),
- "mov", " $dst, $src",
+ "mov", ".w $dst, $src",
[(set GPR:$dst, t2_so_imm:$src)]>;
let isReMaterializable = 1, isAsCheapAsAMove = 1 in
@@ -928,11 +926,11 @@
[(set GPR:$dst, (ctlz GPR:$src))]>;
def t2REV : T2I<(outs GPR:$dst), (ins GPR:$src),
- "rev", " $dst, $src",
+ "rev", ".w $dst, $src",
[(set GPR:$dst, (bswap GPR:$src))]>;
def t2REV16 : T2I<(outs GPR:$dst), (ins GPR:$src),
- "rev16", " $dst, $src",
+ "rev16", ".w $dst, $src",
[(set GPR:$dst,
(or (and (srl GPR:$src, (i32 8)), 0xFF),
(or (and (shl GPR:$src, (i32 8)), 0xFF00),
@@ -940,7 +938,7 @@
(and (shl GPR:$src, (i32 8)), 0xFF000000)))))]>;
def t2REVSH : T2I<(outs GPR:$dst), (ins GPR:$src),
- "revsh", " $dst, $src",
+ "revsh", ".w $dst, $src",
[(set GPR:$dst,
(sext_inreg
(or (srl (and GPR:$src, 0xFFFF), (i32 8)),
@@ -1077,14 +1075,14 @@
let isBranch = 1, isTerminator = 1, isBarrier = 1 in {
let isPredicable = 1 in
def t2B : T2XI<(outs), (ins brtarget:$target),
- "b $target",
+ "b.w $target",
[(br bb:$target)]>;
let isNotDuplicable = 1, isIndirectBranch = 1 in
def t2BR_JT :
T2JTI<(outs),
(ins GPR:$base, GPR:$idx, jt2block_operand:$jt, i32imm:$id),
- "add pc, $base, $idx, lsl #2\n$jt",
+ "add.w pc, $base, $idx, lsl #2\n$jt",
[(ARMbr2jt GPR:$base, GPR:$idx, tjumptable:$jt, imm:$id)]>;
} // isBranch, isTerminator, isBarrier
@@ -1092,7 +1090,7 @@
// a two-value operand where a dag node expects two operands. :(
let isBranch = 1, isTerminator = 1 in
def t2Bcc : T2I<(outs), (ins brtarget:$target),
- "b", " $target",
+ "b", ".w $target",
[/*(ARMbrcond bb:$target, imm:$cc)*/]>;
Modified: llvm/trunk/test/CodeGen/Thumb2/carry.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/carry.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/carry.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/carry.ll Mon Jul 27 11:31:55 2009
@@ -1,6 +1,6 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "subs r" | count 2
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "adc r"
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "sbc r" | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "subs\\.w r" | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "adc\\.w r"
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "sbc\\.w r" | count 2
define i64 @f1(i64 %a, i64 %b) {
entry:
Modified: llvm/trunk/test/CodeGen/Thumb2/load-global.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/load-global.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/load-global.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/load-global.ll Mon Jul 27 11:31:55 2009
@@ -17,7 +17,7 @@
; DYNAMIC: .long L_G$non_lazy_ptr
; PIC: _test1
-; PIC: add r0, r0, pc
+; PIC: add.w r0, r0, pc
; PIC: .long L_G$non_lazy_ptr-(LPC0+4)
; LINUX: test1
Modified: llvm/trunk/test/CodeGen/Thumb2/mul_const.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/mul_const.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/mul_const.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/mul_const.ll Mon Jul 27 11:31:55 2009
@@ -4,7 +4,7 @@
define i32 @t1(i32 %v) nounwind readnone {
entry:
; CHECK: t1:
-; CHECK: add r0, r0, r0, lsl #3
+; CHECK: add.w r0, r0, r0, lsl #3
%0 = mul i32 %v, 9
ret i32 %0
}
Modified: llvm/trunk/test/CodeGen/Thumb2/pic-load.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/pic-load.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/pic-load.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/pic-load.ll Mon Jul 27 11:31:55 2009
@@ -8,7 +8,7 @@
define hidden arm_apcscc i32 @atexit(void ()* %func) nounwind {
entry:
; CHECK: atexit:
-; CHECK: add r1, r1, pc
+; CHECK: add.w r1, r1, pc
%r = alloca %struct.one_atexit_routine, align 4 ; <%struct.one_atexit_routine*> [#uses=3]
%0 = getelementptr %struct.one_atexit_routine* %r, i32 0, i32 0, i32 0 ; [#uses=1]
store void ()* %func, void ()** %0, align 4
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-adc2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-adc2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-adc2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-adc2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adc\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]*} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adc\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]*} | count 1
define i64 @f1(i64 %a, i64 %b) {
%tmp = add i64 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#510} | count 5
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#510} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adds\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adds\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 171 = 0x000000ab
define i64 @f1(i64 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = add i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adds\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adds\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i64 @f1(i64 %a, i64 %b) {
%tmp = add i64 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-and.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-and.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-and.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-and.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = and i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-asr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-asr.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-asr.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-asr.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {asr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {asr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = ashr i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-asr2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-asr2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-asr2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-asr2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {asr\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#17} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {asr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#17} | count 1
define i32 @f1(i32 %a) {
%tmp = ashr i32 %a, 17
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %b, 4294967295
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\W*r\[0-9\],\\W*r\[0-9\]$} | count 4
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\.w\\W*r\[0-9\],\\W*r\[0-9\]$} | count 4
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i1 @f1(i32 %a, i32 %b) {
%nb = sub i32 0, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-cmn2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "cmn " | grep {#187\\|#11141290\\|#3422604288\\|#1114112} | count 4
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "cmn\\.w " | grep {#187\\|#11141290\\|#3422604288\\|#1114112} | count 4
; -0x000000bb = 4294967109
define i1 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\W*r\[0-9\],\\W*#\[0-9\]*$} | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | count 5
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\.w\\W*r\[0-9\],\\W*#\[0-9\]*$} | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | count 5
; 0x000000bb = 187
define i1 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\W*r\[0-9\],\\W*r\[0-9\]$} | count 2
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\.w\\W*r\[0-9\],\\W*r\[0-9\]$} | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i1 @f1(i32 %a, i32 %b) {
%tmp = icmp ne i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-eor.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-eor.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-eor.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-eor.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 2
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-jtbl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-jtbl.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-jtbl.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-jtbl.ll Mon Jul 27 11:31:55 2009
@@ -4,7 +4,7 @@
define void @bar(i32 %n.u) {
entry:
; CHECK: bar:
-; CHECK: add pc
+; CHECK: add.w pc
; CHECK: b.w LBB1_2
switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-ldr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ldr.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-ldr.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ldr.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,9 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldr r0} | count 7
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep mvn
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep ldr | grep lsl
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep lsr | not grep ldr
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldr\\.w r0} | count 6
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldr r0} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov\\.w | grep 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep mvn\\.w
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep ldr\\.w | grep lsl
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep lsr\\.w | not grep ldr
define i32 @f1(i32* %v) {
entry:
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrb.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrb.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrb.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrb.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,9 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldrb r0} | count 7
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep mvn
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep ldrb | grep lsl
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep lsr | not grep ldrb
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldrb\\.w r0} | count 5
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldrb r0} | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov\\.w | grep 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep mvn\\.w
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep ldrb\\.w | grep lsl
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep lsr\\.w | not grep ldrb
define i8 @f1(i8* %v) {
entry:
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrh.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrh.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrh.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ldrh.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,9 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldrh r0} | count 7
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep mvn
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep ldrh | grep lsl
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep lsr | not grep ldrh
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldrh\\.w r0} | count 6
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldrh r0} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov\\.w | grep 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep mvn\\.w
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep ldrh\\.w | grep lsl
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep lsr\\.w | not grep ldrh
define i16 @f1(i16* %v) {
entry:
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsl\\W*r\[0-9\],\\W*r\[0-9\],\\W*\[0-9\]} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsl\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*\[0-9\]} | count 1
define i32 @f1(i32 %a) {
%tmp = shl i32 %a, 5
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-lsl2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsl\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsl\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = shl i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsr\\W*r\[0-9\],\\W*r\[0-9\],\\W*\[0-9\]} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*\[0-9\]} | count 1
define i32 @f1(i32 %a) {
%tmp = lshr i32 %a, 13
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-lsr2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = lshr i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-mov3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-mov3.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-mov3.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-mov3.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mov\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mov\\.w\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-mvn2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-mvn2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-mvn2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-mvn2.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 2
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a) {
%tmp = xor i32 4294967295, %a
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-neg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-neg.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-neg.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-neg.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rsb\\W*r\[0-9\],\\W*r\[0-9\],\\W*#0} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rsb\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*#0} | count 1
define i32 @f1(i32 %a) {
%tmp = sub i32 0, %a
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %b, 4294967295
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-orr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-orr.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-orr.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-orr.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp2 = or i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-rev.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-rev.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-rev.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-rev.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2,+v7a | grep {rev\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2,+v7a | grep {rev\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
define i32 @f1(i32 %a) {
%tmp = tail call i32 @llvm.bswap.i32(i32 %a)
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-ror.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ror.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-ror.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ror.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ror\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*#\[0-9\]*} | grep 22 | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ror\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*#\[0-9\]*} | grep 22 | count 1
define i32 @f1(i32 %a) {
%l8 = shl i32 %a, 10
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-ror2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ror2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-ror2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ror2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ror\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ror\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
define i32 @f1(i32 %a, i32 %b) {
%db = sub i32 32, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rsb\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rsb\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-sbc2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-sbc2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-sbc2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-sbc2.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sbc\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]*} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sbc\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]*} | count 1
define i64 @f1(i64 %a, i64 %b) {
%tmp = sub i64 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-str.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-str.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-str.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-str.ll Mon Jul 27 11:31:55 2009
@@ -1,9 +1,9 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\W*r\[0-9\],\\W*\\\[r\[0-9\]*\\\]$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4092\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4092\\\]$} | count 1
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#-128\\\]$} | count 2
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep {str\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4096\\\]$}
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*\\\]$} | count 3
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*,\\Wlsl #2\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep {str\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4096\\\]$}
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*\\\]$} | count 3
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {str\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*,\\Wlsl #2\\\]$} | count 1
define i32 @f1(i32 %a, i32* %v) {
store i32 %a, i32* %v
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-strb.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-strb.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-strb.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-strb.ll Mon Jul 27 11:31:55 2009
@@ -1,9 +1,9 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\W*r\[0-9\],\\W*\\\[r\[0-9\]*\\\]$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4092\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4092\\\]$} | count 1
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#-128\\\]$} | count 2
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep {strb\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4096\\\]$}
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*\\\]$} | count 3
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*,\\Wlsl #2\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep {strb\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4096\\\]$}
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*\\\]$} | count 3
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strb\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*,\\Wlsl #2\\\]$} | count 1
define i8 @f1(i8 %a, i8* %v) {
store i8 %a, i8* %v
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-strh.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-strh.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-strh.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-strh.ll Mon Jul 27 11:31:55 2009
@@ -1,9 +1,9 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\W*r\[0-9\],\\W*\\\[r\[0-9\]*\\\]$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4092\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4092\\\]$} | count 1
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#-128\\\]$} | count 2
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep {strh\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4096\\\]$}
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*\\\]$} | count 3
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*,\\Wlsl #2\\\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep {strh\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*#+4096\\\]$}
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*\\\]$} | count 3
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {strh\\.w\\W*r\[0-9\],\\W*\\\[r\[0-9\]*,\\W*+r\[0-9\]*,\\Wlsl #2\\\]$} | count 1
define i16 @f1(i16 %a, i16* %v) {
store i16 %a, i16* %v
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-sub.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-sub.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-sub.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-sub.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\[w\]\\?\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#510} | count 5
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#510} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-sub4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-sub4.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-sub4.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-sub4.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {sub\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = sub i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-sub5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-sub5.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-sub5.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-sub5.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {subs\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {subs\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i64 @f1(i64 %a, i64 %b) {
%tmp = sub i64 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-teq.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-teq.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-teq.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-teq.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | count 10
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\.w\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | count 10
; 0x000000bb = 187
define i1 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-teq2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-teq2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-teq2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-teq2.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\W*r\[0-9\],\\W*r\[0-9\]$} | count 4
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\.w\\W*r\[0-9\],\\W*r\[0-9\]$} | count 4
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {teq\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i1 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-tst.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-tst.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-tst.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-tst.ll Mon Jul 27 11:31:55 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | count 10
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\.w\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | count 10
; 0x000000bb = 187
define i1 @f1(i32 %a) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-tst2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-tst2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-tst2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-tst2.ll Mon Jul 27 11:31:55 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\W*r\[0-9\],\\W*r\[0-9\]$} | count 4
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\.w\\W*r\[0-9\],\\W*r\[0-9\]$} | count 4
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {tst\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i1 @f1(i32 %a, i32 %b) {
%tmp = and i32 %a, %b
Modified: llvm/trunk/test/CodeGen/Thumb2/tls2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/tls2.ll?rev=77199&r1=77198&r2=77199&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/tls2.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/tls2.ll Mon Jul 27 11:31:55 2009
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi | \
; RUN: grep {i(gottpoff)}
; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi | \
-; RUN: grep {ldr r., \[pc, r.\]}
+; RUN: grep {ldr.w r., \[pc, r.\]}
; RUN: llvm-as < %s | llc -mtriple=thumbv7-linux-gnueabi \
; RUN: -relocation-model=pic | grep {__tls_get_addr}
From bob.wilson at apple.com Mon Jul 27 11:35:49 2009
From: bob.wilson at apple.com (Bob Wilson)
Date: Mon, 27 Jul 2009 16:35:49 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77200 -
/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
Message-ID: <200907271635.n6RGZoL0012377@zion.cs.uiuc.edu>
Author: bwilson
Date: Mon Jul 27 11:35:42 2009
New Revision: 77200
URL: http://llvm.org/viewvc/llvm-project?rev=77200&view=rev
Log:
Use macros from now that is no longer included.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=77200&r1=77199&r2=77200&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Mon Jul 27 11:35:42 2009
@@ -23821,8 +23821,8 @@
{
const char *clobber_name;
clobber_name = TREE_STRING_POINTER (TREE_VALUE (tail));
- if (tolower (clobber_name[0]) == 'q' && isdigit (clobber_name[1])
- && (isdigit (clobber_name[2]) || clobber_name[2] == '\0'))
+ if (TOLOWER (clobber_name[0]) == 'q' && ISDIGIT (clobber_name[1])
+ && (ISDIGIT (clobber_name[2]) || clobber_name[2] == '\0'))
{
char regname[4] = "dXX";
/* found a Q register in the clobber list, so add the D reference
From clattner at apple.com Mon Jul 27 11:36:32 2009
From: clattner at apple.com (Chris Lattner)
Date: Mon, 27 Jul 2009 09:36:32 -0700
Subject: [llvm-commits] [llvm] r77153 -
/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
In-Reply-To: <4A6DD434.5020005@microchip.com>
References: <200907261025.n6QAPSPr012172@zion.cs.uiuc.edu>
<7E5C84F2-926B-413A-8044-C03EDD7079EA@apple.com>
<4A6DD434.5020005@microchip.com>
Message-ID: <0ED2FC70-3DF8-4B12-82ED-3D1920C0C63C@apple.com>
On Jul 27, 2009, at 9:22 AM, Sanjiv Gupta wrote:
> Chris Lattner wrote:
>>
>> On Jul 26, 2009, at 3:25 AM, Sanjiv Gupta wrote:
>>
>>> Author: sgupta
>>> Date: Sun Jul 26 05:25:01 2009
>>> New Revision: 77153
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=77153&view=rev
>>> Log:
>>> Fix the breakage caused by 76950.
>>> PIC16 has special naming conventions for variables having section
>>> names specified via section attribute.
>>
>> Testcase??
> r77195.
Thanks!
-Chris
From david_goodwin at apple.com Mon Jul 27 11:39:15 2009
From: david_goodwin at apple.com (David Goodwin)
Date: Mon, 27 Jul 2009 16:39:15 -0000
Subject: [llvm-commits] [llvm] r77201 -
/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
Message-ID: <200907271639.n6RGdHgL012485@zion.cs.uiuc.edu>
Author: david_goodwin
Date: Mon Jul 27 11:39:05 2009
New Revision: 77201
URL: http://llvm.org/viewvc/llvm-project?rev=77201&view=rev
Log:
Thumb-2 does not have RSC.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=77201&r1=77200&r2=77201&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Mon Jul 27 11:39:05 2009
@@ -287,38 +287,6 @@
}
}
-/// T2I_rsc_is - Same as T2I_adde_sube_irs except the order of operands are
-/// reversed. It doesn't define the 'rr' form since it's handled by its
-/// T2I_adde_sube_irs counterpart.
-let Defs = [CPSR], Uses = [CPSR] in {
-multiclass T2I_rsc_is {
- // shifted imm
- def ri : T2sI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs),
- opc, " $dst, $rhs, $lhs",
- [(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>,
- Requires<[IsThumb2, CarryDefIsUnused]>;
- // shifted register
- def rs : T2sI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs),
- opc, " $dst, $rhs, $lhs",
- [(set GPR:$dst, (opnode t2_so_reg:$lhs, GPR:$rhs))]>,
- Requires<[IsThumb2, CarryDefIsUnused]>;
- // shifted imm
- def Sri : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_imm:$lhs),
- !strconcat(opc, "s $dst, $rhs, $lhs"),
- [(set GPR:$dst, (opnode t2_so_imm:$lhs, GPR:$rhs))]>,
- Requires<[IsThumb2, CarryDefIsUsed]> {
- let Defs = [CPSR];
- }
- // shifted register
- def Srs : T2XI<(outs GPR:$dst), (ins GPR:$rhs, t2_so_reg:$lhs),
- !strconcat(opc, "s $dst, $rhs, $lhs"),
- [(set GPR:$dst, (opnode t2_so_reg:$lhs, GPR:$rhs))]>,
- Requires<[IsThumb2, CarryDefIsUsed]> {
- let Defs = [CPSR];
- }
-}
-}
-
/// T2I_rbin_s_is - Same as T2I_rbin_is except sets 's' bit.
let Defs = [CPSR] in {
multiclass T2I_rbin_s_is {
@@ -735,10 +703,9 @@
defm t2ADC : T2I_adde_sube_irs<"adc",BinOpFrag<(adde node:$LHS, node:$RHS)>,1>;
defm t2SBC : T2I_adde_sube_irs<"sbc",BinOpFrag<(sube node:$LHS, node:$RHS)>>;
-// RSB, RSC
+// RSB
defm t2RSB : T2I_rbin_is <"rsb", BinOpFrag<(sub node:$LHS, node:$RHS)>>;
defm t2RSBS : T2I_rbin_s_is <"rsb", BinOpFrag<(subc node:$LHS, node:$RHS)>>;
-defm t2RSC : T2I_rsc_is <"rsc", BinOpFrag<(sube node:$LHS, node:$RHS)>>;
// (sub X, imm) gets canonicalized to (add X, -imm). Match this form.
def : T2Pat<(add GPR:$src, t2_so_imm_neg:$imm),
From sabre at nondot.org Mon Jul 27 11:42:24 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 16:42:24 -0000
Subject: [llvm-commits] [llvm] r77202 -
/llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
Message-ID: <200907271642.n6RGgOi2012602@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 11:42:14 2009
New Revision: 77202
URL: http://llvm.org/viewvc/llvm-project?rev=77202&view=rev
Log:
Apparently alpha doesn't use ElfTargetAsmInfo (?)
Modified:
llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp?rev=77202&r1=77201&r2=77202&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp Mon Jul 27 11:42:14 2009
@@ -23,4 +23,7 @@
JumpTableDirective = ".gprel32";
JumpTableDataSection = "\t.section .rodata\n";
WeakRefDirective = "\t.weak\t";
+
+ TextSection = getOrCreateSection("_text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
}
From sabre at nondot.org Mon Jul 27 11:44:16 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 16:44:16 -0000
Subject: [llvm-commits] [llvm] r77203 -
/llvm/trunk/lib/Target/TargetAsmInfo.cpp
Message-ID: <200907271644.n6RGiHXo012656@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 11:44:04 2009
New Revision: 77203
URL: http://llvm.org/viewvc/llvm-project?rev=77203&view=rev
Log:
don't create default text/data sections for all targets.
Modified:
llvm/trunk/lib/Target/TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77203&r1=77202&r2=77203&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Jul 27 11:44:04 2009
@@ -122,8 +122,6 @@
DwarfEHFrameSection = ".eh_frame";
DwarfExceptionSection = ".gcc_except_table";
AsmTransCBE = 0;
- TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
- DataSection = getOrCreateSection("\t.data", true, SectionKind::DataRel);
}
TargetAsmInfo::~TargetAsmInfo() {
From sabre at nondot.org Mon Jul 27 11:46:00 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 16:46:00 -0000
Subject: [llvm-commits] [llvm] r77204 - in /llvm/trunk:
include/llvm/Target/COFFTargetAsmInfo.h
include/llvm/Target/ELFTargetAsmInfo.h lib/Target/COFFTargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.h
Message-ID: <200907271646.n6RGk16h012710@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 11:45:59 2009
New Revision: 77204
URL: http://llvm.org/viewvc/llvm-project?rev=77204&view=rev
Log:
make COFF work like ELF and macho, by splitting out into its own
header even though there is only one COFF target.
Added:
llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
Modified:
llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
Added: llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h?rev=77204&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h (added)
+++ llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h Mon Jul 27 11:45:59 2009
@@ -0,0 +1,30 @@
+//===-- COFFTargetAsmInfo.h - COFF asm properties ---------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_COFF_TARGET_ASM_INFO_H
+#define LLVM_COFF_TARGET_ASM_INFO_H
+
+#include "llvm/Target/TargetAsmInfo.h"
+
+namespace llvm {
+ class COFFTargetAsmInfo : public TargetAsmInfo {
+ protected:
+ explicit COFFTargetAsmInfo(const TargetMachine &TM);
+ public:
+
+ virtual const char *
+ getSectionPrefixForUniqueGlobal(SectionKind kind) const;
+
+ virtual void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const;
+ };
+}
+
+
+#endif // LLVM_ELF_TARGET_ASM_INFO_H
Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=77204&r1=77203&r2=77204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Mon Jul 27 11:45:59 2009
@@ -18,7 +18,6 @@
#include "llvm/Target/TargetAsmInfo.h"
namespace llvm {
- class GlobalValue;
struct ELFTargetAsmInfo : public TargetAsmInfo {
ELFTargetAsmInfo(const TargetMachine &TM);
Added: llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp?rev=77204&view=auto
==============================================================================
--- llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp (added)
+++ llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp Mon Jul 27 11:45:59 2009
@@ -0,0 +1,76 @@
+//===-- COFFTargetAsmInfo.cpp - COFF asm properties -------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines target asm properties related what form asm statements
+// should take in general on COFF-based targets
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Target/COFFTargetAsmInfo.h"
+#include "llvm/ADT/SmallVector.h"
+using namespace llvm;
+
+COFFTargetAsmInfo::COFFTargetAsmInfo(const TargetMachine &TM)
+ : TargetAsmInfo(TM) {
+
+ TextSection = getOrCreateSection("_text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
+
+ GlobalPrefix = "_";
+ LCOMMDirective = "\t.lcomm\t";
+ COMMDirectiveTakesAlignment = false;
+ HasDotTypeDotSizeDirective = false;
+ HasSingleParameterDotFile = false;
+ StaticCtorsSection = "\t.section .ctors,\"aw\"";
+ StaticDtorsSection = "\t.section .dtors,\"aw\"";
+ HiddenDirective = NULL;
+ PrivateGlobalPrefix = "L"; // Prefix for private global symbols
+ WeakRefDirective = "\t.weak\t";
+ SetDirective = "\t.set\t";
+
+ // Set up DWARF directives
+ HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
+ AbsoluteDebugSectionOffsets = true;
+ AbsoluteEHSectionOffsets = false;
+ SupportsDebugInformation = true;
+ DwarfSectionOffsetDirective = "\t.secrel32\t";
+ DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\"";
+ DwarfInfoSection = "\t.section\t.debug_info,\"dr\"";
+ DwarfLineSection = "\t.section\t.debug_line,\"dr\"";
+ DwarfFrameSection = "\t.section\t.debug_frame,\"dr\"";
+ DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\"";
+ DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\"";
+ DwarfStrSection = "\t.section\t.debug_str,\"dr\"";
+ DwarfLocSection = "\t.section\t.debug_loc,\"dr\"";
+ DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\"";
+ DwarfRangesSection = "\t.section\t.debug_ranges,\"dr\"";
+ DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
+}
+
+const char *COFFTargetAsmInfo::
+getSectionPrefixForUniqueGlobal(SectionKind Kind) const {
+ if (Kind.isText())
+ return ".text$linkonce";
+ if (Kind.isWriteable())
+ return ".data$linkonce";
+ return ".rdata$linkonce";
+}
+
+void COFFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const {
+ // FIXME: Inefficient.
+ std::string Res = ",\"";
+ if (Kind.isText())
+ Res += 'x';
+ if (Kind.isWriteable())
+ Res += 'w';
+ Res += "\"";
+
+ Str.append(Res.begin(), Res.end());
+}
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77204&r1=77203&r2=77204&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Jul 27 11:45:59 2009
@@ -188,42 +188,6 @@
}
}
-X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM):
- X86GenericTargetAsmInfo(TM) {
-
- TextSection = getOrCreateSection("_text", true, SectionKind::Text);
- DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
-
- GlobalPrefix = "_";
- LCOMMDirective = "\t.lcomm\t";
- COMMDirectiveTakesAlignment = false;
- HasDotTypeDotSizeDirective = false;
- HasSingleParameterDotFile = false;
- StaticCtorsSection = "\t.section .ctors,\"aw\"";
- StaticDtorsSection = "\t.section .dtors,\"aw\"";
- HiddenDirective = NULL;
- PrivateGlobalPrefix = "L"; // Prefix for private global symbols
- WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
-
- // Set up DWARF directives
- HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
- AbsoluteDebugSectionOffsets = true;
- AbsoluteEHSectionOffsets = false;
- SupportsDebugInformation = true;
- DwarfSectionOffsetDirective = "\t.secrel32\t";
- DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\"";
- DwarfInfoSection = "\t.section\t.debug_info,\"dr\"";
- DwarfLineSection = "\t.section\t.debug_line,\"dr\"";
- DwarfFrameSection = "\t.section\t.debug_frame,\"dr\"";
- DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\"";
- DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\"";
- DwarfStrSection = "\t.section\t.debug_str,\"dr\"";
- DwarfLocSection = "\t.section\t.debug_loc,\"dr\"";
- DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\"";
- DwarfRangesSection = "\t.section\t.debug_ranges,\"dr\"";
- DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
-}
unsigned
X86COFFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
@@ -263,32 +227,10 @@
return DW_EH_PE_absptr;
}
-const char *X86COFFTargetAsmInfo::
-getSectionPrefixForUniqueGlobal(SectionKind Kind) const {
- if (Kind.isText())
- return ".text$linkonce";
- if (Kind.isWriteable())
- return ".data$linkonce";
- return ".rdata$linkonce";
-}
-
-void X86COFFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
- SmallVectorImpl &Str) const {
- // FIXME: Inefficient.
- std::string Res = ",\"";
- if (Kind.isText())
- Res += 'x';
- if (Kind.isWriteable())
- Res += 'w';
- Res += "\"";
-
- Str.append(Res.begin(), Res.end());
-}
-
X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM):
- X86GenericTargetAsmInfo(TM) {
+ X86TargetAsmInfo(TM) {
GlobalPrefix = "_";
CommentString = ";";
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h?rev=77204&r1=77203&r2=77204&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Mon Jul 27 11:45:59 2009
@@ -16,8 +16,9 @@
#include "X86TargetMachine.h"
#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/ELFTargetAsmInfo.h"
+#include "llvm/Target/COFFTargetAsmInfo.h"
#include "llvm/Target/DarwinTargetAsmInfo.h"
+#include "llvm/Target/ELFTargetAsmInfo.h"
#include "llvm/Support/Compiler.h"
namespace llvm {
@@ -49,16 +50,13 @@
bool Global) const;
};
- struct X86COFFTargetAsmInfo : public X86GenericTargetAsmInfo {
- explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM);
+ struct X86COFFTargetAsmInfo : public X86TargetAsmInfo {
+ explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM) :
+ X86TargetAsmInfo(TM) {}
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const;
- virtual const char *
- getSectionPrefixForUniqueGlobal(SectionKind kind) const;
-
- virtual void getSectionFlagsAsString(SectionKind Kind,
- SmallVectorImpl &Str) const;
};
+
struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo {
explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
From devang.patel at gmail.com Mon Jul 27 11:59:29 2009
From: devang.patel at gmail.com (Devang Patel)
Date: Mon, 27 Jul 2009 09:59:29 -0700
Subject: [llvm-commits] [llvm] r76841 - in /llvm/trunk:
include/llvm/LLVMContext.h include/llvm/MDNode.h
lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp lib/VMCore/AsmWriter.cpp
lib/VMCore/LLVMContext.c
In-Reply-To: <6a8523d60907231116v4799b0e1x7768fe118e11add9@mail.gmail.com>
References: <6a8523d60907231116v4799b0e1x7768fe118e11add9@mail.gmail.com>
Message-ID: <352a1fb20907270959k3bc9c8e0u35ba939e59fc0c79@mail.gmail.com>
On Thu, Jul 23, 2009 at 11:16 AM, Daniel Dunbar wrote:
> On Wed, Jul 22, 2009 at 7:01 PM, Devang Patel wrote:
>> Author: dpatel
>> Date: Wed Jul 22 21:00:51 2009
>> New Revision: 76841
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=76841&view=rev
>> Log:
>> MDString
>> - Rename member function size(). New name is length().
>
> Was this in response to feedback?
Yes
> size() is slightly more consistent, I think?
>
>> - Store string beginning and length. Earlier it used to store string end.
>
> Can you change this to use a StringRef instead? It should simplify the API.
sure.
>
> MDNode is also inconsistent in its use of accessors, StrBegin is
> accessed directly but length is a method. I think this problem gets
> cleaned up with the move to StringRef, however.
>
> ?- Daniel
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
--
-
Devang
From dpatel at apple.com Mon Jul 27 12:17:05 2009
From: dpatel at apple.com (Devang Patel)
Date: Mon, 27 Jul 2009 17:17:05 -0000
Subject: [llvm-commits] [llvm] r77208 -
/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
Message-ID: <200907271717.n6RHH5bu013539@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Jul 27 12:17:04 2009
New Revision: 77208
URL: http://llvm.org/viewvc/llvm-project?rev=77208&view=rev
Log:
Do not seed mstadata into the value map.
Modified:
llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=77208&r1=77207&r2=77208&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Mon Jul 27 12:17:04 2009
@@ -14,6 +14,7 @@
#include "llvm/Transforms/Utils/ValueMapper.h"
#include "llvm/BasicBlock.h"
+#include "llvm/DerivedTypes.h" // For getNullValue(Type::Int32Ty)
#include "llvm/Constants.h"
#include "llvm/GlobalValue.h"
#include "llvm/Instruction.h"
@@ -30,9 +31,9 @@
// NOTE: VMSlot can be invalidated by any reference to VM, which can grow the
// DenseMap. This includes any recursive calls to MapValue.
- // Global values do not need to be seeded into the ValueMap if they are using
- // the identity mapping.
- if (isa(V) || isa(V))
+ // Global values and metadata do not need to be seeded into the ValueMap if
+ // they are using the identity mapping.
+ if (isa(V) || isa(V) || isa(V))
return VMSlot = const_cast(V);
if (Constant *C = const_cast(dyn_cast(V))) {
@@ -105,32 +106,10 @@
}
return VM[V] = C;
- } else if (MDNode *N = dyn_cast(C)) {
- for (MDNode::const_elem_iterator b = N->elem_begin(), i = b,
- e = N->elem_end(); i != e; ++i) {
- if (!*i) continue;
-
- Value *MV = MapValue(*i, VM, Context);
- if (MV != *i) {
- // This MDNode must contain a reference to a global, make a new MDNode
- // and return it.
- SmallVector Values;
- Values.reserve(N->getNumElements());
- for (MDNode::const_elem_iterator j = b; j != i; ++j)
- Values.push_back(*j);
- Values.push_back(MV);
- for (++i; i != e; ++i)
- Values.push_back(MapValue(*i, VM, Context));
- return VM[V] = Context.getMDNode(Values.data(), Values.size());
- }
- }
- return VM[V] = C;
-
} else {
llvm_unreachable("Unknown type of constant!");
}
}
-
return 0;
}
From sabre at nondot.org Mon Jul 27 12:39:49 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 17:39:49 -0000
Subject: [llvm-commits] [llvm] r77210 -
/llvm/trunk/lib/Target/TargetAsmInfo.cpp
Message-ID: <200907271739.n6RHdn06014205@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 12:39:40 2009
New Revision: 77210
URL: http://llvm.org/viewvc/llvm-project?rev=77210&view=rev
Log:
add an explanatory comment about why we drop these in readonly and
not in mergable
Modified:
llvm/trunk/lib/Target/TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77210&r1=77209&r2=77210&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Jul 27 12:39:40 2009
@@ -247,7 +247,9 @@
case Constant::LocalRelocation:
// In static relocation model, the linker will resolve all addresses, so
// the relocation entries will actually be constants by the time the app
- // starts up.
+ // starts up. However, we can't put this into a mergable section, because
+ // the linker doesn't take relocations into consideration when it tries to
+ // merge entries in the section.
if (ReloModel == Reloc::Static)
return SectionKind::ReadOnly;
@@ -258,7 +260,9 @@
case Constant::GlobalRelocations:
// In static relocation model, the linker will resolve all addresses, so
// the relocation entries will actually be constants by the time the app
- // starts up.
+ // starts up. However, we can't put this into a mergable section, because
+ // the linker doesn't take relocations into consideration when it tries to
+ // merge entries in the section.
if (ReloModel == Reloc::Static)
return SectionKind::ReadOnly;
From isanbard at gmail.com Mon Jul 27 12:46:21 2009
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 27 Jul 2009 10:46:21 -0700
Subject: [llvm-commits] [llvm] r77162 - /llvm/tags/Apple/llvmCore-XXXX/
In-Reply-To: <4A6DC591.80108@gmail.com>
References: <200907261840.n6QIeHnw025849@zion.cs.uiuc.edu>
<5D9E9D3C-DEB3-45CE-A1F7-32CB43D937A5@gmail.com>
<3B4176C9-7E28-45EB-BB13-455DE5E6F7CC@gmail.com>
<4A6DC591.80108@gmail.com>
Message-ID: <16e5fdf90907271046k4af6fcb4tbc30a6f8e697ee51@mail.gmail.com>
2009/7/27 T?r?k Edwin :
> On 2009-07-26 23:53, Bill Wendling wrote:
>> On Jul 26, 2009, at 1:25 PM, Jon Ziegler wrote:
>>
>>> As an aside, during execution of your script, it asked for this:
>>> Authentication realm: LLVM Subversion
>>> repository
>>> Password for 'root':
>>> a couple of times, which seems unlikely to be what is desired.
>>>
>>>
>> That's coming from SVN. I've had it happen to me too. It seems to go
>> away (for the next time) after entering the password. It comes back at
>> random, though...
>>
>
> Why root? Surely you are not committing as root ...
>
No. It's just some SVN weirdness on our side. I'm not an SVN expert,
so I don't *really* know what's going on...
-bw
From dgregor at apple.com Mon Jul 27 12:55:55 2009
From: dgregor at apple.com (Douglas Gregor)
Date: Mon, 27 Jul 2009 17:55:55 -0000
Subject: [llvm-commits] [llvm] r77213 - /llvm/trunk/lib/System/CMakeLists.txt
Message-ID: <200907271755.n6RHtuKH014724@zion.cs.uiuc.edu>
Author: dgregor
Date: Mon Jul 27 12:55:55 2009
New Revision: 77213
URL: http://llvm.org/viewvc/llvm-project?rev=77213&view=rev
Log:
CMake: make sure that the *.inc files for libSystem show up in the resulting
project.
Modified:
llvm/trunk/lib/System/CMakeLists.txt
Modified: llvm/trunk/lib/System/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/CMakeLists.txt?rev=77213&r1=77212&r2=77213&view=diff
==============================================================================
--- llvm/trunk/lib/System/CMakeLists.txt (original)
+++ llvm/trunk/lib/System/CMakeLists.txt Mon Jul 27 12:55:55 2009
@@ -16,6 +16,29 @@
ThreadLocal.cpp
Threading.cpp
TimeValue.cpp
+ Unix/Alarm.inc
+ Unix/Host.inc
+ Unix/Memory.inc
+ Unix/Mutex.inc
+ Unix/Path.inc
+ Unix/Process.inc
+ Unix/Program.inc
+ Unix/RWMutex.inc
+ Unix/Signals.inc
+ Unix/ThreadLocal.inc
+ Unix/TimeValue.inc
+ Win32/Alarm.inc
+ Win32/DynamicLibrary.inc
+ Win32/Host.inc
+ Win32/Memory.inc
+ Win32/Mutex.inc
+ Win32/Path.inc
+ Win32/Process.inc
+ Win32/Program.inc
+ Win32/RWMutex.inc
+ Win32/Signals.inc
+ Win32/ThreadLocal.inc
+ Win32/TimeValue.inc
)
if( BUILD_SHARED_LIBS AND NOT WIN32 )
From sanjiv.gupta at microchip.com Mon Jul 27 13:04:36 2009
From: sanjiv.gupta at microchip.com (Sanjiv Gupta)
Date: Mon, 27 Jul 2009 18:04:36 -0000
Subject: [llvm-commits] [llvm] r77215 -
/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
Message-ID: <200907271804.n6RI4aJj015142@zion.cs.uiuc.edu>
Author: sgupta
Date: Mon Jul 27 13:04:34 2009
New Revision: 77215
URL: http://llvm.org/viewvc/llvm-project?rev=77215&view=rev
Log:
Remove duplicate entries while printing decls for external symbols.
Some libcall names are same, so they were getting printed twice.
Modified:
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=77215&r1=77214&r2=77215&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Mon Jul 27 13:04:34 2009
@@ -156,6 +156,26 @@
O << PIC16CondCodeToString((PIC16CC::CondCodes)CC);
}
+// This function is used to sort the decls list.
+// should return true if s1 should come before s2.
+static bool is_before(const char *s1, const char *s2) {
+ std::string str1 = s1;
+ std::string str2 = s2;
+ int i = str1.compare(str2);
+ // Return true if s1 is smaller or equal.
+ if (i <= 0) return true;
+ // false if s1 should come after s2.
+ return false;
+}
+
+// This is used by list::unique below.
+// unique will filter out duplicates if it knows them.
+static bool is_duplicate(const char *s1, const char *s2) {
+ std::string str1 = s1;
+ std::string str2 = s2;
+ return str1 == str2;
+}
+
/// printLibcallDecls - print the extern declarations for compiler
/// intrinsics.
///
@@ -165,8 +185,9 @@
O << TAI->getCommentString() << "External decls for libcalls - BEGIN." <<"\n";
// Remove duplicate entries.
- LibcallDecls.sort();
- LibcallDecls.unique();
+ LibcallDecls.sort(is_before);
+ LibcallDecls.unique(is_duplicate);
+
for (std::list::const_iterator I = LibcallDecls.begin();
I != LibcallDecls.end(); I++) {
O << TAI->getExternDirective() << *I << "\n";
From gohman at apple.com Mon Jul 27 13:07:56 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 18:07:56 -0000
Subject: [llvm-commits] [llvm] r77216 - /llvm/trunk/docs/LangRef.html
Message-ID: <200907271807.n6RI7urV015433@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 13:07:55 2009
New Revision: 77216
URL: http://llvm.org/viewvc/llvm-project?rev=77216&view=rev
Log:
Following discussion on llvm-dev ("proposed new rule for getelementptr"),
add a new "Pointer Aliasing Rules" section.
Modified:
llvm/trunk/docs/LangRef.html
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=77216&r1=77215&r2=77216&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Mon Jul 27 13:07:55 2009
@@ -48,6 +48,7 @@
Garbage Collector Names
Module-Level Inline Assembly
Data Layout
+ Pointer Aliasing Rules
Type System
@@ -1243,6 +1244,54 @@
+
+
+
+
+
+
Any memory access must be done though a pointer value associated
+with with address range of the memory access, otherwise the behavior
+is undefined. Pointer values are associated with address ranges
+according to the following rules:
+
+
+ - A pointer value formed from a getelementptr instruction is
+ associated with the addresses associated with the first operand of
+ the getelementptr.
+ - An addresses of a global variable is associated with the address
+ range of the variable's storage.
+ - The result value of an allocation instruction is associated with
+ the address range of the allocated storage.
+ - A null pointer in the default address-space is associated with
+ no addresses.
+ - A pointer value formed by an inttoptr is associated with
+ all address ranges of all pointer values that contribute (directly
+ or indirectly) to the computation of the pointer's value.
+ - The result value of a bitcast is associated with all
+ addresses associated with the operand of the bitcast.
+ - An integer constant other than zero or a pointer value returned
+ from a function not defined within LLVM may be associated with address
+ ranges allocated through mechanisms other than those provided by
+ LLVM. Such ranges shall not overlap with any ranges of address
+ allocated by mechanisms provided by LLVM.
+
+
+
LLVM IR does not associate types with memory. The result type of a
+load merely indicates the size and alignment of the memory from
+which to load, as well as the interpretation of the value. The first
+operand of a store similarly only indicates the size and
+alignment of the store.
+
+
Consequently, type-based alias analysis, aka TBAA, aka
+-fstrict-aliasing, is not applicable to general unadorned
+LLVM IR. Metadata may be used to encode
+additional information which specialized optimization passes may use
+to implement type-based alias analysis.
+
+
+
From scallanan at apple.com Mon Jul 27 13:07:50 2009
From: scallanan at apple.com (Sean Callanan)
Date: Mon, 27 Jul 2009 11:07:50 -0700
Subject: [llvm-commits] [llvm] r77023 -
/llvm/trunk/include/llvm/Support/MemoryObject.h
In-Reply-To: <6a8523d60907242159m2b1f345cqf19cb795236f695f@mail.gmail.com>
References: <200907250030.n6P0UqhX005432@zion.cs.uiuc.edu>
<6a8523d60907242159m2b1f345cqf19cb795236f695f@mail.gmail.com>
Message-ID:
Wow, that logic error escaped me completely (that was essentially
untested code because the subclasses always extended it).
Anyway, I'll fix that and the other problems you saw. Thanks, Daniel!
Sean
On 2009/07/24, at 21:59, Daniel Dunbar wrote:
> Hi Sean,
>
> Cool! A few minor comments:
>
> On Fri, Jul 24, 2009 at 5:30 PM, Sean Callanan
> wrote:
>> +/// MemoryObject - Abstract base class for contiguous addressable
>> memory.
>> +/// Necessary for cases in which the memory is in another
>> process, in a
>> +/// file, or on a remote machine.
>> +class MemoryObject {
>> +public:
>> + /// Constructor - Override as necessary.
>> + MemoryObject() {
>> + }
>
> Since the class is abstract, we generally either make the constructor
> protected or just leave it off if it is unnecessary. A virtual
> destructor is needed, however.
>
>> +
>> + /// getBase - Returns the lowest valid address in the
>> region.
>> + ///
>> + /// @result - The lowest valid address.
>> + virtual uint64_t getBase() const = 0;
>
> Should this be uintptr_t instead of uint64_t?
>
>> + /// getExtent - Returns the size of the region in bytes.
>> (The region is
>> + /// contiguous, so the highest valid address
>> of the region
>> + /// is getBase() + getExtent() - 1).
>> + ///
>> + /// @result - The size of the region.
>> + virtual uint64_t getExtent() const = 0;
>> +
>> + /// readByte - Tries to read a single byte from the region.
>> + ///
>> + /// @param address - The address of the byte, in the same space
>> as getBase().
>> + /// @param ptr - A pointer to a byte to be filled in. Must
>> be non-NULL.
>> + /// @result - 0 if successful; -1 if not. Failure may
>> be due to a
>> + /// bounds violation or an implementation-
>> specific error.
>> + virtual int readByte(uint64_t address, uint8_t* ptr) const = 0;
>
> Is there a particular reason to provide this? It seems like clients
> could just pass size=1 if they only want a byte. And it seems like
> most implementations will want to override readBytes anyway?
>
>> + /// readByte - Tries to read a contiguous range of bytes
>> from the
>> + /// region, up to the end of the region.
>> + /// You should override this function if there
>> is a quicker
>> + /// way than going back and forth with
>> individual bytes.
>> + ///
>> + /// @param address - The address of the first byte, in the same
>> space as
>> + /// getBase().
>> + /// @param size - The maximum number of bytes to copy.
>
> Is it true that address + size should never overflow?
>
>> + /// @param buf - A pointer to a buffer to be filled in.
>> Must be non-NULL
>> + /// and large enough to hold size bytes.
>> + /// @result - The number of bytes copied if successful;
>> (uint64_t)-1
>> + /// if not.
>> + /// Failure may be due to a bounds violation
>> or an
>> + /// implementation-specific error.
>
> Is there a reason to return the number of bytes copied, it is always
> the size. Then it could just return true/false on success.
>
>> + virtual uint64_t readBytes(uint64_t address,
>> + uint64_t size,
>> + uint8_t* buf) const {
>> + uint64_t current = address;
>> + uint64_t limit = getBase() + getExtent();
>> + uint64_t ret = 0;
>> +
>> + while(current - address < size && current < limit) {
>> + if(readByte(current, &buf[(current - address)]))
>> + return (uint64_t)-1;
>> +
>> + ret++;
>> + }
>> +
>> + return ret;
>> + }
>
> This isn't quite right (current never changes). If most
> implementations will override this it might be nicer to have this just
> be a pure abstract base class. But if not,
> --
> for (uint64_t i = 0; i != size; ++i)
> if (readByte(address + i, buf + i))
> return (uint64_t)-1;
> return size;
> --
> is simpler.
>
> - Daniel
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From mrs at apple.com Mon Jul 27 13:18:51 2009
From: mrs at apple.com (Mike Stump)
Date: Mon, 27 Jul 2009 18:18:51 -0000
Subject: [llvm-commits] [llvm] r77217 - /llvm/trunk/lib/Target/CMakeLists.txt
Message-ID: <200907271818.n6RIIrNQ015845@zion.cs.uiuc.edu>
Author: mrs
Date: Mon Jul 27 13:18:30 2009
New Revision: 77217
URL: http://llvm.org/viewvc/llvm-project?rev=77217&view=rev
Log:
Fix build.
Modified:
llvm/trunk/lib/Target/CMakeLists.txt
Modified: llvm/trunk/lib/Target/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CMakeLists.txt?rev=77217&r1=77216&r2=77217&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/CMakeLists.txt Mon Jul 27 13:18:30 2009
@@ -1,4 +1,5 @@
add_llvm_library(LLVMTarget
+ COFFTargetAsmInfo.cpp
DarwinTargetAsmInfo.cpp
ELFTargetAsmInfo.cpp
SubtargetFeature.cpp
From evan.cheng at apple.com Mon Jul 27 13:20:07 2009
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 27 Jul 2009 18:20:07 -0000
Subject: [llvm-commits] [llvm] r77218 - in /llvm/trunk/lib/Target/ARM:
ARMBaseInstrInfo.cpp ARMBaseInstrInfo.h ARMBaseRegisterInfo.cpp
ARMInstrInfo.cpp Thumb1InstrInfo.cpp Thumb2InstrInfo.cpp
Message-ID: <200907271820.n6RIK85O015906@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Jul 27 13:20:05 2009
New Revision: 77218
URL: http://llvm.org/viewvc/llvm-project?rev=77218&view=rev
Log:
Get rid of some more getOpcode calls.
This also fixes potential problems in ARMBaseInstrInfo routines not recognizing thumb1 instructions when 32-bit and 16-bit instructions mix.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp
llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=77218&r1=77217&r2=77218&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon Jul 27 13:20:05 2009
@@ -30,8 +30,9 @@
EnableARM3Addr("enable-arm-3-addr-conv", cl::Hidden,
cl::desc("Enable ARM 2-addr to 3-addr conv"));
-ARMBaseInstrInfo::ARMBaseInstrInfo(const ARMSubtarget &STI)
- : TargetInstrInfoImpl(ARMInsts, array_lengthof(ARMInsts)) {
+ARMBaseInstrInfo::ARMBaseInstrInfo(const ARMSubtarget &sti)
+ : TargetInstrInfoImpl(ARMInsts, array_lengthof(ARMInsts)),
+ STI(sti) {
}
MachineInstr *
@@ -206,11 +207,11 @@
// If there is only one terminator instruction, process it.
unsigned LastOpc = LastInst->getOpcode();
if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
- if (LastOpc == getOpcode(ARMII::B)) {
+ if (isUncondBranchOpcode(LastOpc)) {
TBB = LastInst->getOperand(0).getMBB();
return false;
}
- if (LastOpc == getOpcode(ARMII::Bcc)) {
+ if (isCondBranchOpcode(LastOpc)) {
// Block ends with fall-through condbranch.
TBB = LastInst->getOperand(0).getMBB();
Cond.push_back(LastInst->getOperand(1));
@@ -227,10 +228,9 @@
if (SecondLastInst && I != MBB.begin() && isUnpredicatedTerminator(--I))
return true;
- // If the block ends with ARMII::B and a ARMII::Bcc, handle it.
+ // If the block ends with a B and a Bcc, handle it.
unsigned SecondLastOpc = SecondLastInst->getOpcode();
- if ((SecondLastOpc == getOpcode(ARMII::Bcc)) &&
- (LastOpc == getOpcode(ARMII::B))) {
+ if (isCondBranchOpcode(SecondLastOpc) && isUncondBranchOpcode(LastOpc)) {
TBB = SecondLastInst->getOperand(0).getMBB();
Cond.push_back(SecondLastInst->getOperand(1));
Cond.push_back(SecondLastInst->getOperand(2));
@@ -240,8 +240,7 @@
// If the block ends with two unconditional branches, handle it. The second
// one is not executed, so remove it.
- if ((SecondLastOpc == getOpcode(ARMII::B)) &&
- (LastOpc == getOpcode(ARMII::B))) {
+ if (isUncondBranchOpcode(SecondLastOpc) && isUncondBranchOpcode(LastOpc)) {
TBB = SecondLastInst->getOperand(0).getMBB();
I = LastInst;
if (AllowModify)
@@ -257,7 +256,7 @@
SecondLastOpc == ARM::BR_JTadd ||
SecondLastOpc == ARM::tBR_JTr ||
SecondLastOpc == ARM::t2BR_JT) &&
- (LastOpc == getOpcode(ARMII::B))) {
+ isUncondBranchOpcode(LastOpc)) {
I = LastInst;
if (AllowModify)
I->eraseFromParent();
@@ -270,13 +269,11 @@
unsigned ARMBaseInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
- int BOpc = getOpcode(ARMII::B);
- int BccOpc = getOpcode(ARMII::Bcc);
-
MachineBasicBlock::iterator I = MBB.end();
if (I == MBB.begin()) return 0;
--I;
- if (I->getOpcode() != BOpc && I->getOpcode() != BccOpc)
+ if (!isUncondBranchOpcode(I->getOpcode()) &&
+ !isCondBranchOpcode(I->getOpcode()))
return 0;
// Remove the branch.
@@ -286,7 +283,7 @@
if (I == MBB.begin()) return 1;
--I;
- if (I->getOpcode() != BccOpc)
+ if (!isCondBranchOpcode(I->getOpcode()))
return 1;
// Remove the branch.
@@ -300,8 +297,10 @@
const SmallVectorImpl &Cond) const {
// FIXME this should probably have a DebugLoc argument
DebugLoc dl = DebugLoc::getUnknownLoc();
- int BOpc = getOpcode(ARMII::B);
- int BccOpc = getOpcode(ARMII::Bcc);
+ int BOpc = !STI.isThumb()
+ ? ARM::B : (STI.isThumb2() ? ARM::t2B : ARM::tB);
+ int BccOpc = !STI.isThumb()
+ ? ARM::Bcc : (STI.isThumb2() ? ARM::t2Bcc : ARM::tBcc);
// Shouldn't be a fall through.
assert(TBB && "InsertBranch must not be told to insert a fallthrough");
@@ -335,8 +334,8 @@
PredicateInstruction(MachineInstr *MI,
const SmallVectorImpl &Pred) const {
unsigned Opc = MI->getOpcode();
- if (Opc == getOpcode(ARMII::B)) {
- MI->setDesc(get(getOpcode(ARMII::Bcc)));
+ if (isUncondBranchOpcode(Opc)) {
+ MI->setDesc(get(getMatchingCondBranchOpcode(Opc)));
MI->addOperand(MachineOperand::CreateImm(Pred[0].getImm()));
MI->addOperand(MachineOperand::CreateReg(Pred[1].getReg(), false));
return true;
@@ -792,3 +791,16 @@
return false;
}
+
+int ARMBaseInstrInfo::getMatchingCondBranchOpcode(int Opc) const {
+ if (Opc == ARM::B)
+ return ARM::Bcc;
+ else if (Opc == ARM::tB)
+ return ARM::tBcc;
+ else if (Opc == ARM::t2B)
+ return ARM::t2Bcc;
+
+ llvm_unreachable("Unknown unconditional branch opcode!");
+ return 0;
+}
+
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=77218&r1=77217&r2=77218&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Mon Jul 27 13:20:05 2009
@@ -165,9 +165,6 @@
ADDri,
ADDrs,
ADDrr,
- B,
- Bcc,
- BX_RET,
LDRri,
MOVr,
STRri,
@@ -193,9 +190,11 @@
}
class ARMBaseInstrInfo : public TargetInstrInfoImpl {
+ const ARMSubtarget &STI;
+
protected:
// Can be only subclassed.
- explicit ARMBaseInstrInfo(const ARMSubtarget &STI);
+ explicit ARMBaseInstrInfo(const ARMSubtarget &sti);
public:
// Return the non-pre/post incrementing version of 'Opc'. Return 0
// if there is not such an opcode.
@@ -292,6 +291,17 @@
MachineInstr* MI,
const SmallVectorImpl &Ops,
MachineInstr* LoadMI) const;
+
+private:
+ bool isUncondBranchOpcode(int Opc) const {
+ return Opc == ARM::B || Opc == ARM::tB || Opc == ARM::t2B;
+ }
+
+ bool isCondBranchOpcode(int Opc) const {
+ return Opc == ARM::Bcc || Opc == ARM::tBcc || Opc == ARM::t2Bcc;
+ }
+
+ int getMatchingCondBranchOpcode(int Opc) const;
};
}
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=77218&r1=77217&r2=77218&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon Jul 27 13:20:05 2009
@@ -1370,7 +1370,7 @@
emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const {
MachineBasicBlock::iterator MBBI = prior(MBB.end());
- assert(MBBI->getOpcode() == (int)getOpcode(ARMII::BX_RET) &&
+ assert(MBBI->getDesc().isReturn() &&
"Can only insert epilog into returning blocks");
DebugLoc dl = MBBI->getDebugLoc();
MachineFrameInfo *MFI = MF.getFrameInfo();
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=77218&r1=77217&r2=77218&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Mon Jul 27 13:20:05 2009
@@ -68,9 +68,6 @@
case ARMII::ADDri: return ARM::ADDri;
case ARMII::ADDrs: return ARM::ADDrs;
case ARMII::ADDrr: return ARM::ADDrr;
- case ARMII::B: return ARM::B;
- case ARMII::Bcc: return ARM::Bcc;
- case ARMII::BX_RET: return ARM::BX_RET;
case ARMII::LDRri: return 0;
case ARMII::MOVr: return ARM::MOVr;
case ARMII::STRri: return 0;
Modified: llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp?rev=77218&r1=77217&r2=77218&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp Mon Jul 27 13:20:05 2009
@@ -35,9 +35,6 @@
case ARMII::ADDri: return ARM::tADDi8;
case ARMII::ADDrs: return 0;
case ARMII::ADDrr: return ARM::tADDrr;
- case ARMII::B: return ARM::tB;
- case ARMII::Bcc: return ARM::tBcc;
- case ARMII::BX_RET: return ARM::tBX_RET;
case ARMII::LDRri: return 0;
case ARMII::MOVr: return ARM::tMOVr;
case ARMII::STRri: return 0;
Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=77218&r1=77217&r2=77218&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Mon Jul 27 13:20:05 2009
@@ -36,9 +36,6 @@
case ARMII::ADDri: return ARM::t2ADDri;
case ARMII::ADDrs: return ARM::t2ADDrs;
case ARMII::ADDrr: return ARM::t2ADDrr;
- case ARMII::B: return ARM::t2B;
- case ARMII::Bcc: return ARM::t2Bcc;
- case ARMII::BX_RET: return ARM::tBX_RET;
case ARMII::LDRri: return ARM::t2LDRi12;
case ARMII::MOVr: return ARM::t2MOVr;
case ARMII::STRri: return ARM::t2STRi12;
From dgregor at apple.com Mon Jul 27 13:23:47 2009
From: dgregor at apple.com (Douglas Gregor)
Date: Mon, 27 Jul 2009 18:23:47 -0000
Subject: [llvm-commits] [llvm] r77219 - in /llvm/trunk:
cmake/config-ix.cmake include/llvm/Config/config.h.cmake
Message-ID: <200907271823.n6RINmXt016034@zion.cs.uiuc.edu>
Author: dgregor
Date: Mon Jul 27 13:23:41 2009
New Revision: 77219
URL: http://llvm.org/viewvc/llvm-project?rev=77219&view=rev
Log:
CMake configuration: find mkdtemp, mkstemp, mktemp.
Modified:
llvm/trunk/cmake/config-ix.cmake
llvm/trunk/include/llvm/Config/config.h.cmake
Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=77219&r1=77218&r2=77219&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Mon Jul 27 13:23:41 2009
@@ -65,6 +65,9 @@
check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
check_symbol_exists(malloc_zone_statistics malloc/malloc.h
HAVE_MALLOC_ZONE_STATISTICS)
+check_symbol_exists(mkdtemp unistd.h HAVE_MKDTEMP)
+check_symbol_exists(mkstemp unistd.h HAVE_MKSTEMP)
+check_symbol_exists(mktemp unistd.h HAVE_MKTEMP)
check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
check_symbol_exists(strerror string.h HAVE_STRERROR)
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=77219&r1=77218&r2=77219&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Mon Jul 27 13:23:41 2009
@@ -237,13 +237,13 @@
#cmakedefine HAVE_MEMORY_H ${HAVE_MEMORY_H}
/* Define to 1 if you have the `mkdtemp' function. */
-#undef HAVE_MKDTEMP
+#cmakedefine HAVE_MKDTEMP ${HAVE_MKDTEMP}
/* Define to 1 if you have the `mkstemp' function. */
-#undef HAVE_MKSTEMP
+#cmakedefine HAVE_MKSTEMP ${HAVE_MKSTEMP}
/* Define to 1 if you have the `mktemp' function. */
-#undef HAVE_MKTEMP
+#cmakedefine HAVE_MKTEMP ${HAVE_MKTEMP}
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
From isanbard at gmail.com Mon Jul 27 13:24:10 2009
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 27 Jul 2009 18:24:10 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77220 -
/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Message-ID: <200907271824.n6RIOA9w016058@zion.cs.uiuc.edu>
Author: void
Date: Mon Jul 27 13:24:10 2009
New Revision: 77220
URL: http://llvm.org/viewvc/llvm-project?rev=77220&view=rev
Log:
Fix comments and some whitespaces.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=77220&r1=77219&r2=77220&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Jul 27 13:24:10 2009
@@ -136,7 +136,7 @@
/// function-local decls to be recycled after the function is done.
static std::vector LocalLLVMValueIDs;
-// Remember the LLVM value for GCC tree node.
+/// llvm_set_decl - Remember the LLVM value for GCC tree node.
void llvm_set_decl(tree Tr, Value *V) {
// If there is not any value then do not add new LLVMValues entry.
@@ -164,7 +164,8 @@
LocalLLVMValueIDs.push_back(Index);
}
-// Return TRUE if there is a LLVM Value associate with GCC tree node.
+/// llvm_set_decl_p - Return TRUE if there is a LLVM Value associate with GCC
+/// tree node.
bool llvm_set_decl_p(tree Tr) {
unsigned Index = GET_DECL_LLVM_INDEX(Tr);
if (Index == 0)
@@ -173,10 +174,10 @@
return LLVMValues[Index - 1] != 0;
}
-// Get LLVM Value for the GCC tree node based on LLVMValues vector index.
-// If there is not any value associated then use make_decl_llvm() to
-// make LLVM value. When GCC tree node is initialized, it has 0 as the
-// index value. This is why all recorded indices are offset by 1.
+/// llvm_get_decl - Get LLVM Value for the GCC tree node based on LLVMValues
+/// vector index. If there is not any value associated then use
+/// make_decl_llvm() to make LLVM value. When GCC tree node is initialized, it
+/// has 0 as the index value. This is why all recorded indices are offset by 1.
Value *llvm_get_decl(tree Tr) {
unsigned Index = GET_DECL_LLVM_INDEX(Tr);
@@ -235,7 +236,7 @@
LLVMValuesMap[New] = Idx+1;
}
-// Read LLVM Types string table
+/// readLLVMValues - Read LLVM Types string table
void readLLVMValues() {
GlobalValue *V = TheModule->getNamedGlobal("llvm.pch.values");
if (!V)
@@ -264,9 +265,9 @@
GV->eraseFromParent();
}
-// GCC tree's uses LLVMValues vector's index to reach LLVM Values.
-// Create a string table to hold these LLVM Values' names. This string
-// table will be used to recreate LTypes vector after loading PCH.
+/// writeLLVMValues - GCC tree's uses LLVMValues vector's index to reach LLVM
+/// Values. Create a string table to hold these LLVM Values' names. This string
+/// table will be used to recreate LTypes vector after loading PCH.
void writeLLVMValues() {
if (LLVMValues.empty())
return;
@@ -313,8 +314,7 @@
}
}
-
-// Forward decl visibility style to global.
+/// handleVisibility - Forward decl visibility style to global.
void handleVisibility(tree decl, GlobalValue *GV) {
// If decl has visibility specified explicitely (via attribute) - honour
// it. Otherwise (e.g. visibility specified via -fvisibility=hidden) honour
@@ -489,7 +489,8 @@
TheDebugInfo = new DebugInfo(TheModule);
}
-/// Set backend options that may only be known at codegen time.
+/// performLateBackendInitialization - Set backend options that may only be
+/// known at codegen time.
void performLateBackendInitialization(void) {
// The Ada front-end sets flag_exceptions only after processing the file.
ExceptionHandling = flag_exceptions;
@@ -514,7 +515,7 @@
static formatted_raw_ostream *AsmOutRawStream = 0;
oFILEstream *AsmIntermediateOutStream = 0;
-/// Read bytecode from PCH file. Initialize TheModule and setup
+/// llvm_pch_read - Read bytecode from PCH file. Initialize TheModule and setup
/// LTypes vector.
void llvm_pch_read(const unsigned char *Buffer, unsigned Size) {
std::string ModuleName = TheModule->getModuleIdentifier();
@@ -558,7 +559,7 @@
flag_llvm_pch_read = 1;
}
-// Initialize PCH writing.
+/// llvm_pch_write_init - Initialize PCH writing.
void llvm_pch_write_init(void) {
timevar_push(TV_LLVM_INIT);
AsmOutStream = new oFILEstream(asm_out_file);
@@ -765,7 +766,7 @@
}
}
-// llvm_asm_file_start - Start the .s file.
+/// llvm_asm_file_start - Start the .s file.
void llvm_asm_file_start(void) {
timevar_push(TV_LLVM_INIT);
AsmOutStream = new oFILEstream(asm_out_file);
@@ -819,7 +820,7 @@
Array, Name);
}
-// llvm_asm_file_end - Finish the .s file.
+/// llvm_asm_file_end - Finish the .s file.
void llvm_asm_file_end(void) {
timevar_push(TV_LLVM_PERFILE);
LLVMContext &Context = getGlobalContext();
@@ -851,8 +852,8 @@
ArrayType *AT = Context.getArrayType(SBP, AUGs.size());
Constant *Init = Context.getConstantArray(AT, AUGs);
GlobalValue *gv = new GlobalVariable(*TheModule, AT, false,
- GlobalValue::AppendingLinkage, Init,
- "llvm.used");
+ GlobalValue::AppendingLinkage, Init,
+ "llvm.used");
gv->setSection("llvm.metadata");
AttributeUsedGlobals.clear();
}
@@ -936,8 +937,8 @@
llvm_shutdown();
}
-// llvm_emit_code_for_current_function - Top level interface for emitting a
-// function to the .s file.
+/// llvm_emit_code_for_current_function - Top level interface for emitting a
+/// function to the .s file.
void llvm_emit_code_for_current_function(tree fndecl) {
if (cfun->nonlocal_goto_save_area)
sorry("%Jnon-local gotos not supported by LLVM", fndecl);
@@ -988,7 +989,7 @@
timevar_pop(TV_LLVM_FUNCS);
}
-// emit_alias_to_llvm - Given decl and target emit alias to target.
+/// emit_alias_to_llvm - Given decl and target emit alias to target.
void emit_alias_to_llvm(tree decl, tree target, tree target_decl) {
if (errorcount || sorrycount) {
TREE_ASM_WRITTEN(decl) = 1;
@@ -1088,7 +1089,8 @@
return;
}
-// Convert string to global value. Use existing global if possible.
+/// ConvertMetadataStringToGV - Convert string to global value. Use existing
+/// global if possible.
Constant* ConvertMetadataStringToGV(const char *str) {
Constant *Init = getGlobalContext().getConstantArray(std::string(str));
@@ -1108,8 +1110,8 @@
}
-/// AddAnnotateAttrsToGlobal - Adds decls that have a
-/// annotate attribute to a vector to be emitted later.
+/// AddAnnotateAttrsToGlobal - Adds decls that have a annotate attribute to a
+/// vector to be emitted later.
void AddAnnotateAttrsToGlobal(GlobalValue *GV, tree decl) {
LLVMContext &Context = getGlobalContext();
@@ -1310,7 +1312,8 @@
GV->setThreadLocal(true);
// Set the linkage.
- GlobalValue::LinkageTypes Linkage = GV->getLinkage();
+ GlobalValue::LinkageTypes Linkage;
+
if (CODE_CONTAINS_STRUCT (TREE_CODE (decl), TS_DECL_WITH_VIS)
&& DECL_LLVM_PRIVATE(decl)) {
Linkage = GlobalValue::PrivateLinkage;
@@ -1327,6 +1330,8 @@
Linkage = GlobalValue::CommonLinkage;
} else if (DECL_COMDAT(decl)) {
Linkage = GlobalValue::getLinkOnceLinkage(flag_odr);
+ } else {
+ Linkage = GV->getLinkage();
}
// Allow loads from constants to be folded even if the constant has weak
@@ -1451,16 +1456,15 @@
}
-// make_decl_llvm - Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL. DECL
-// should have static storage duration. In other words, it should not be an
-// automatic variable, including PARM_DECLs.
-//
-// There is, however, one exception: this function handles variables explicitly
-// placed in a particular register by the user.
-//
-// This function corresponds to make_decl_rtl in varasm.c, and is implicitly
-// called by DECL_LLVM if a decl doesn't have an LLVM set.
-//
+/// make_decl_llvm - Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL. DECL
+/// should have static storage duration. In other words, it should not be an
+/// automatic variable, including PARM_DECLs.
+///
+/// There is, however, one exception: this function handles variables explicitly
+/// placed in a particular register by the user.
+///
+/// This function corresponds to make_decl_rtl in varasm.c, and is implicitly
+/// called by DECL_LLVM if a decl doesn't have an LLVM set.
void make_decl_llvm(tree decl) {
#ifdef ENABLE_CHECKING
// Check that we are not being given an automatic variable.
@@ -1681,9 +1685,9 @@
return "";
}
-// llvm_mark_decl_weak - Used by varasm.c, called when a decl is found to be
-// weak, but it already had an llvm object created for it. This marks the LLVM
-// object weak as well.
+/// llvm_mark_decl_weak - Used by varasm.c, called when a decl is found to be
+/// weak, but it already had an llvm object created for it. This marks the LLVM
+/// object weak as well.
void llvm_mark_decl_weak(tree decl) {
assert(DECL_LLVM_SET_P(decl) && DECL_WEAK(decl) &&
isa(DECL_LLVM(decl)) && "Decl isn't marked weak!");
@@ -1710,10 +1714,9 @@
}
}
-// llvm_emit_ctor_dtor - Called to emit static ctors/dtors to LLVM code. fndecl
-// is a 'void()' FUNCTION_DECL for the code, initprio is the init priority, and
-// isCtor indicates whether this is a ctor or dtor.
-//
+/// llvm_emit_ctor_dtor - Called to emit static ctors/dtors to LLVM code.
+/// fndecl is a 'void()' FUNCTION_DECL for the code, initprio is the init
+/// priority, and isCtor indicates whether this is a ctor or dtor.
void llvm_emit_ctor_dtor(tree FnDecl, int InitPrio, int isCtor) {
mark_decl_referenced(FnDecl); // Inform cgraph that we used the global.
@@ -1728,9 +1731,8 @@
return;
}
-// llvm_emit_file_scope_asm - Emit the specified string as a file-scope inline
-// asm block.
-//
+/// llvm_emit_file_scope_asm - Emit the specified string as a file-scope inline
+/// asm block.
void llvm_emit_file_scope_asm(const char *string) {
if (TheModule->getModuleInlineAsm().empty())
TheModule->setModuleInlineAsm(string);
@@ -1739,19 +1741,16 @@
string);
}
-
-// print_llvm - Print the specified LLVM chunk like an operand, called by
-// print-tree.c for tree dumps.
-//
+/// print_llvm - Print the specified LLVM chunk like an operand, called by
+/// print-tree.c for tree dumps.
void print_llvm(FILE *file, void *LLVM) {
oFILEstream FS(file);
FS << "LLVM: ";
WriteAsOperand(FS, (Value*)LLVM, true, TheModule);
}
-// print_llvm_type - Print the specified LLVM type symbolically, called by
-// print-tree.c for tree dumps.
-//
+/// print_llvm_type - Print the specified LLVM type symbolically, called by
+/// print-tree.c for tree dumps.
void print_llvm_type(FILE *file, void *LLVM) {
oFILEstream FS(file);
FS << "LLVM: ";
@@ -1763,12 +1762,11 @@
WriteTypeSymbolic(RO, (const Type*)LLVM, TheModule);
}
-// Get a register name given its decl. In 4.2 unlike 4.0 these names
-// have been run through set_user_assembler_name which means they may
-// have a leading \1 at this point; compensate.
-
+/// extractRegisterName - Get a register name given its decl. In 4.2 unlike 4.0
+/// these names have been run through set_user_assembler_name which means they
+/// may have a leading \1 at this point; compensate.
const char* extractRegisterName(tree decl) {
const char* Name = IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(decl));
- return (*Name==1) ? Name+1 : Name;
+ return (*Name == 1) ? Name + 1 : Name;
}
/* LLVM LOCAL end (ENTIRE FILE!) */
From evan.cheng at apple.com Mon Jul 27 13:25:24 2009
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 27 Jul 2009 18:25:24 -0000
Subject: [llvm-commits] [llvm] r77221 - in /llvm/trunk/lib/Target/ARM:
ARMBaseInstrInfo.cpp ARMBaseInstrInfo.h
Message-ID: <200907271825.n6RIPOID016105@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Jul 27 13:25:24 2009
New Revision: 77221
URL: http://llvm.org/viewvc/llvm-project?rev=77221&view=rev
Log:
Clean up.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=77221&r1=77220&r2=77221&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon Jul 27 13:25:24 2009
@@ -251,11 +251,7 @@
// ...likewise if it ends with a branch table followed by an unconditional
// branch. The branch folder can create these, and we must get rid of them for
// correctness of Thumb constant islands.
- if ((SecondLastOpc == ARM::BR_JTr ||
- SecondLastOpc == ARM::BR_JTm ||
- SecondLastOpc == ARM::BR_JTadd ||
- SecondLastOpc == ARM::tBR_JTr ||
- SecondLastOpc == ARM::t2BR_JT) &&
+ if (isJumpTableBranchOpcode(SecondLastOpc) &&
isUncondBranchOpcode(LastOpc)) {
I = LastInst;
if (AllowModify)
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=77221&r1=77220&r2=77221&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Mon Jul 27 13:25:24 2009
@@ -301,6 +301,11 @@
return Opc == ARM::Bcc || Opc == ARM::tBcc || Opc == ARM::t2Bcc;
}
+ bool isJumpTableBranchOpcode(int Opc) const {
+ return Opc == ARM::BR_JTr || Opc == ARM::BR_JTm || Opc == ARM::BR_JTadd ||
+ Opc == ARM::tBR_JTr || Opc == ARM::t2BR_JT;
+ }
+
int getMatchingCondBranchOpcode(int Opc) const;
};
}
From evan.cheng at apple.com Mon Jul 27 13:31:45 2009
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 27 Jul 2009 18:31:45 -0000
Subject: [llvm-commits] [llvm] r77222 -
/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Message-ID: <200907271831.n6RIVjgK016305@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Jul 27 13:31:40 2009
New Revision: 77222
URL: http://llvm.org/viewvc/llvm-project?rev=77222&view=rev
Log:
Cosmetic change.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=77222&r1=77221&r2=77222&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon Jul 27 13:31:40 2009
@@ -1367,8 +1367,10 @@
}
void ARMBaseRegisterInfo::
-emitEpilogue(MachineFunction &MF,
- MachineBasicBlock &MBB) const {
+emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const {
+ assert(!STI.isThumb1Only &&
+ "This emitEpilogue should not be executed for Thumb1!");
+
MachineBasicBlock::iterator MBBI = prior(MBB.end());
assert(MBBI->getDesc().isReturn() &&
"Can only insert epilog into returning blocks");
From scallanan at apple.com Mon Jul 27 13:33:25 2009
From: scallanan at apple.com (Sean Callanan)
Date: Mon, 27 Jul 2009 18:33:25 -0000
Subject: [llvm-commits] [llvm] r77225 -
/llvm/trunk/include/llvm/Support/MemoryObject.h
Message-ID: <200907271833.n6RIXPL3016383@zion.cs.uiuc.edu>
Author: spyffe
Date: Mon Jul 27 13:33:24 2009
New Revision: 77225
URL: http://llvm.org/viewvc/llvm-project?rev=77225&view=rev
Log:
Many of Daniel's fixes.
I'm returning the number of bytes actually copied so that the client has some
warning when it reads past the end of the buffer.
I'm keeping the distinction between getByte() and getBytes() for now for
subclasses that use functions like ptrace() on Linux and only have a restricted
interface. This makes their implementation easier, and subclasses can always
write a one-line implementation of readByte() that uses their custom
readBytes().
Modified:
llvm/trunk/include/llvm/Support/MemoryObject.h
Modified: llvm/trunk/include/llvm/Support/MemoryObject.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryObject.h?rev=77225&r1=77224&r2=77225&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MemoryObject.h (original)
+++ llvm/trunk/include/llvm/Support/MemoryObject.h Mon Jul 27 13:33:24 2009
@@ -19,21 +19,21 @@
/// file, or on a remote machine.
class MemoryObject {
public:
- /// Constructor - Override as necessary.
- MemoryObject() {
+ /// Destructor - Override as necessary.
+ ~MemoryObject() {
}
/// getBase - Returns the lowest valid address in the region.
///
/// @result - The lowest valid address.
- virtual uint64_t getBase() const = 0;
+ virtual uintptr_t getBase() const = 0;
/// getExtent - Returns the size of the region in bytes. (The region is
/// contiguous, so the highest valid address of the region
/// is getBase() + getExtent() - 1).
///
/// @result - The size of the region.
- virtual uint64_t getExtent() const = 0;
+ virtual uintptr_t getExtent() const = 0;
/// readByte - Tries to read a single byte from the region.
///
@@ -41,7 +41,7 @@
/// @param ptr - A pointer to a byte to be filled in. Must be non-NULL.
/// @result - 0 if successful; -1 if not. Failure may be due to a
/// bounds violation or an implementation-specific error.
- virtual int readByte(uint64_t address, uint8_t* ptr) const = 0;
+ virtual int readByte(uintptr_t address, uint8_t* ptr) const = 0;
/// readByte - Tries to read a contiguous range of bytes from the
/// region, up to the end of the region.
@@ -53,25 +53,24 @@
/// @param size - The maximum number of bytes to copy.
/// @param buf - A pointer to a buffer to be filled in. Must be non-NULL
/// and large enough to hold size bytes.
- /// @result - The number of bytes copied if successful; (uint64_t)-1
+ /// @result - The number of bytes copied if successful; (uintptr_t)-1
/// if not.
/// Failure may be due to a bounds violation or an
/// implementation-specific error.
- virtual uint64_t readBytes(uint64_t address,
- uint64_t size,
- uint8_t* buf) const {
- uint64_t current = address;
- uint64_t limit = getBase() + getExtent();
- uint64_t ret = 0;
+ virtual uintptr_t readBytes(uintptr_t address,
+ uintptr_t size,
+ uint8_t* buf) const {
+ uintptr_t current = address;
+ uintptr_t limit = getBase() + getExtent();
while(current - address < size && current < limit) {
if(readByte(current, &buf[(current - address)]))
- return (uint64_t)-1;
+ return (uintptr_t)-1;
- ret++;
+ current++;
}
- return ret;
+ return current - address;
}
};
From isanbard at gmail.com Mon Jul 27 13:37:14 2009
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 27 Jul 2009 11:37:14 -0700
Subject: [llvm-commits] [llvm] r77225 -
/llvm/trunk/include/llvm/Support/MemoryObject.h
In-Reply-To: <200907271833.n6RIXPL3016383@zion.cs.uiuc.edu>
References: <200907271833.n6RIXPL3016383@zion.cs.uiuc.edu>
Message-ID: <16e5fdf90907271137o736de19cod6a73e961d55ddc0@mail.gmail.com>
On Mon, Jul 27, 2009 at 11:33 AM, Sean Callanan wrote:
> Author: spyffe
> Date: Mon Jul 27 13:33:24 2009
> New Revision: 77225
>
> URL: http://llvm.org/viewvc/llvm-project?rev=77225&view=rev
> Log:
> Many of Daniel's fixes.
>
> I'm returning the number of bytes actually copied so that the client has some
> warning when it reads past the end of the buffer.
>
> I'm keeping the distinction between getByte() and getBytes() for now for
> subclasses that use functions like ptrace() on Linux and only have a restricted
> interface. ?This makes their implementation easier, and subclasses can always
> write a one-line implementation of readByte() that uses their custom
> readBytes().
>
> Modified:
> ? ?llvm/trunk/include/llvm/Support/MemoryObject.h
>
> Modified: llvm/trunk/include/llvm/Support/MemoryObject.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryObject.h?rev=77225&r1=77224&r2=77225&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/MemoryObject.h (original)
> +++ llvm/trunk/include/llvm/Support/MemoryObject.h Mon Jul 27 13:33:24 2009
> @@ -19,21 +19,21 @@
> ?/// ? file, or on a remote machine.
> ?class MemoryObject {
> ?public:
> - ?/// Constructor ? ? - Override as necessary.
> - ?MemoryObject() {
> + ?/// Destructor ? ? ?- Override as necessary.
> + ?~MemoryObject() {
> ? }
>
If it's meant to be overridden, it should be marked "virtual".
-bw
From bob.wilson at apple.com Mon Jul 27 13:38:20 2009
From: bob.wilson at apple.com (Bob Wilson)
Date: Mon, 27 Jul 2009 18:38:20 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77226 - in /llvm-gcc-4.2/trunk/gcc:
c-common.c c-common.h c-opts.c config/arm/arm.h optabs.c tree.c
Message-ID: <200907271838.n6RIcLcK016552@zion.cs.uiuc.edu>
Author: bwilson
Date: Mon Jul 27 13:38:17 2009
New Revision: 77226
URL: http://llvm.org/viewvc/llvm-project?rev=77226&view=rev
Log:
Adjust some ENABLE_LLVM ifdefs to allow building for gcc instead of llvm-gcc.
Modified:
llvm-gcc-4.2/trunk/gcc/c-common.c
llvm-gcc-4.2/trunk/gcc/c-common.h
llvm-gcc-4.2/trunk/gcc/c-opts.c
llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
llvm-gcc-4.2/trunk/gcc/optabs.c
llvm-gcc-4.2/trunk/gcc/tree.c
Modified: llvm-gcc-4.2/trunk/gcc/c-common.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=77226&r1=77225&r2=77226&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-common.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-common.c Mon Jul 27 13:38:17 2009
@@ -303,7 +303,6 @@
/* APPLE LOCAL begin default to Wformat-security 5764921 */
/* LLVM LOCAL begin initialize via config/darwin.h */
-#ifdef ENABLE_LLVM
#ifndef WARN_FORMAT_INIT
#define WARN_FORMAT_INIT 0
#endif
@@ -312,9 +311,6 @@
#endif
int warn_format = WARN_FORMAT_INIT;
int warn_format_security = WARN_FORMAT_SECURITY_INIT;
-#else
-int warn_format = 1;
-#endif
/* LLVM LOCAL end initialize via config/darwin.h */
/* APPLE LOCAL end default to Wformat-security 5764921 */
Modified: llvm-gcc-4.2/trunk/gcc/c-common.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.h?rev=77226&r1=77225&r2=77226&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-common.h (original)
+++ llvm-gcc-4.2/trunk/gcc/c-common.h Mon Jul 27 13:38:17 2009
@@ -467,11 +467,9 @@
extern int warn_format;
/* LLVM LOCAL begin */
-#ifdef ENABLE_LLVM
/* Warn about possible security problems with format functions */
extern int warn_format_security;
-#endif
/* LLVM LOCAL end */
/* APPLE LOCAL begin disable_typechecking_for_spec_flag */
Modified: llvm-gcc-4.2/trunk/gcc/c-opts.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-opts.c?rev=77226&r1=77225&r2=77226&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-opts.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-opts.c Mon Jul 27 13:38:17 2009
@@ -1193,9 +1193,7 @@
warning (OPT_Wformat_nonliteral,
"-Wformat-nonliteral ignored without -Wformat");
/* LLVM LOCAL begin */
-#ifdef ENABLE_LLVM
if (warn_format_security)
-#endif
warning (OPT_Wformat_security,
"-Wformat-security ignored without -Wformat");
/* LLVM LOCAL end */
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=77226&r1=77225&r2=77226&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Mon Jul 27 13:38:17 2009
@@ -3231,8 +3231,6 @@
};
/* LLVM LOCAL begin */
-#ifdef ENABLE_LLVM
-
/* Define a static enumeration of the NEON builtins to be used when
converting to LLVM intrinsics. These names are derived from the
neon_builtin_data table in arm.c and should be kept in sync with that. */
@@ -3391,6 +3389,7 @@
NEON_BUILTIN_MAX
};
+#ifdef ENABLE_LLVM
#define LLVM_TARGET_INTRINSIC_PREFIX "arm"
/* LLVM_TARGET_NAME - This specifies the name of the target, which correlates to
Modified: llvm-gcc-4.2/trunk/gcc/optabs.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/optabs.c?rev=77226&r1=77225&r2=77226&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/optabs.c (original)
+++ llvm-gcc-4.2/trunk/gcc/optabs.c Mon Jul 27 13:38:17 2009
@@ -59,11 +59,9 @@
rtx libfunc_table[LTI_MAX];
/* LLVM LOCAL begin */
-#ifdef ENABLE_LLVM
/* This needs to be defined even when not building for LLVM because
the garbage collector logic ignores preprocessor directives. */
tree llvm_libfunc_table[LTI_MAX];
-#endif
/* LLVM LOCAL end */
/* Tables of patterns for converting one mode to another. */
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=77226&r1=77225&r2=77226&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.c (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Jul 27 13:38:17 2009
@@ -7948,7 +7948,7 @@
/* APPLE LOCAL end CW asm blocks */
/* LLVM LOCAL begin */
-#ifdef ENABLE_LLVM
+/* Do not conditionalize this on ENABLE_LLVM. The GTY gets used regardless. */
/* This data structure keeps gcc's garbage collector from
deleting types created by the llvm virtual base class handling
stuff in llvm-types.cpp. */
@@ -7959,7 +7959,6 @@
{
VEC_safe_push(tree, gc, llvm_types_used, type);
}
-#endif
/* LLVM LOCAL end */
/* APPLE LOCAL begin weak_import on property 6676828 */
From evan.cheng at apple.com Mon Jul 27 13:38:55 2009
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 27 Jul 2009 18:38:55 -0000
Subject: [llvm-commits] [llvm] r77227 - in /llvm/trunk/lib/Target/ARM:
ARMBaseInstrInfo.h ARMBaseRegisterInfo.cpp ARMInstrInfo.cpp
Thumb1InstrInfo.cpp Thumb2InstrInfo.cpp
Message-ID: <200907271838.n6RIctBB016579@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Jul 27 13:38:54 2009
New Revision: 77227
URL: http://llvm.org/viewvc/llvm-project?rev=77227&view=rev
Log:
Get rid of more dead code.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp
llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=77227&r1=77226&r2=77227&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Mon Jul 27 13:38:54 2009
@@ -165,9 +165,7 @@
ADDri,
ADDrs,
ADDrr,
- LDRri,
MOVr,
- STRri,
SUBri,
SUBrs,
SUBrr
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=77227&r1=77226&r2=77227&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon Jul 27 13:38:54 2009
@@ -1368,7 +1368,7 @@
void ARMBaseRegisterInfo::
emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const {
- assert(!STI.isThumb1Only &&
+ assert(!STI.isThumb1Only() &&
"This emitEpilogue should not be executed for Thumb1!");
MachineBasicBlock::iterator MBBI = prior(MBB.end());
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=77227&r1=77226&r2=77227&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Mon Jul 27 13:38:54 2009
@@ -68,9 +68,7 @@
case ARMII::ADDri: return ARM::ADDri;
case ARMII::ADDrs: return ARM::ADDrs;
case ARMII::ADDrr: return ARM::ADDrr;
- case ARMII::LDRri: return 0;
case ARMII::MOVr: return ARM::MOVr;
- case ARMII::STRri: return 0;
case ARMII::SUBri: return ARM::SUBri;
case ARMII::SUBrs: return ARM::SUBrs;
case ARMII::SUBrr: return ARM::SUBrr;
Modified: llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp?rev=77227&r1=77226&r2=77227&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp Mon Jul 27 13:38:54 2009
@@ -35,9 +35,7 @@
case ARMII::ADDri: return ARM::tADDi8;
case ARMII::ADDrs: return 0;
case ARMII::ADDrr: return ARM::tADDrr;
- case ARMII::LDRri: return 0;
case ARMII::MOVr: return ARM::tMOVr;
- case ARMII::STRri: return 0;
case ARMII::SUBri: return ARM::tSUBi8;
case ARMII::SUBrs: return 0;
case ARMII::SUBrr: return ARM::tSUBrr;
Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=77227&r1=77226&r2=77227&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Mon Jul 27 13:38:54 2009
@@ -36,9 +36,7 @@
case ARMII::ADDri: return ARM::t2ADDri;
case ARMII::ADDrs: return ARM::t2ADDrs;
case ARMII::ADDrr: return ARM::t2ADDrr;
- case ARMII::LDRri: return ARM::t2LDRi12;
case ARMII::MOVr: return ARM::t2MOVr;
- case ARMII::STRri: return ARM::t2STRi12;
case ARMII::SUBri: return ARM::t2SUBri;
case ARMII::SUBrs: return ARM::t2SUBrs;
case ARMII::SUBrr: return ARM::t2SUBrr;
From clattner at apple.com Mon Jul 27 13:40:15 2009
From: clattner at apple.com (Chris Lattner)
Date: Mon, 27 Jul 2009 11:40:15 -0700
Subject: [llvm-commits] [llvm] r77215 -
/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
In-Reply-To: <200907271804.n6RI4aJj015142@zion.cs.uiuc.edu>
References: <200907271804.n6RI4aJj015142@zion.cs.uiuc.edu>
Message-ID: <3DCBE4E8-E4D3-41D2-A38B-3E0E2B635AA4@apple.com>
On Jul 27, 2009, at 11:04 AM, Sanjiv Gupta wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=77215&view=rev
> Log:
> Remove duplicate entries while printing decls for external symbols.
> Some libcall names are same, so they were getting printed twice.
Sanjiv, these are both really expensive. They create temporary string
objects. Why not just use strcmp?
-Chris
>
> Modified:
> llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
>
> Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=77215&r1=77214&r2=77215&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Mon Jul 27
> 13:04:34 2009
> @@ -156,6 +156,26 @@
> O << PIC16CondCodeToString((PIC16CC::CondCodes)CC);
> }
>
> +// This function is used to sort the decls list.
> +// should return true if s1 should come before s2.
> +static bool is_before(const char *s1, const char *s2) {
> + std::string str1 = s1;
> + std::string str2 = s2;
> + int i = str1.compare(str2);
> + // Return true if s1 is smaller or equal.
> + if (i <= 0) return true;
> + // false if s1 should come after s2.
> + return false;
> +}
> +
> +// This is used by list::unique below.
> +// unique will filter out duplicates if it knows them.
> +static bool is_duplicate(const char *s1, const char *s2) {
> + std::string str1 = s1;
> + std::string str2 = s2;
> + return str1 == str2;
> +}
> +
> /// printLibcallDecls - print the extern declarations for compiler
> /// intrinsics.
> ///
> @@ -165,8 +185,9 @@
>
> O << TAI->getCommentString() << "External decls for libcalls -
> BEGIN." <<"\n";
> // Remove duplicate entries.
> - LibcallDecls.sort();
> - LibcallDecls.unique();
> + LibcallDecls.sort(is_before);
> + LibcallDecls.unique(is_duplicate);
> +
> for (std::list::const_iterator I =
> LibcallDecls.begin();
> I != LibcallDecls.end(); I++) {
> O << TAI->getExternDirective() << *I << "\n";
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From dpatel at apple.com Mon Jul 27 13:42:56 2009
From: dpatel at apple.com (Devang Patel)
Date: Mon, 27 Jul 2009 18:42:56 -0000
Subject: [llvm-commits] [llvm] r77229 - /llvm/trunk/lib/VMCore/AsmWriter.cpp
Message-ID: <200907271842.n6RIguEe016734@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Jul 27 13:42:56 2009
New Revision: 77229
URL: http://llvm.org/viewvc/llvm-project?rev=77229&view=rev
Log:
Initialize mdnNext.
Modified:
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=77229&r1=77228&r2=77229&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Jul 27 13:42:56 2009
@@ -585,7 +585,7 @@
// function provided to be added to the slot table.
SlotTracker::SlotTracker(const Function *F)
: TheModule(F ? F->getParent() : 0), TheFunction(F), FunctionProcessed(false),
- TheMDNode(0), mNext(0), fNext(0) {
+ TheMDNode(0), mNext(0), fNext(0), mdnNext(0) {
}
// Constructor to handle single MDNode.
From evan.cheng at apple.com Mon Jul 27 13:44:00 2009
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 27 Jul 2009 18:44:00 -0000
Subject: [llvm-commits] [llvm] r77230 -
/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
Message-ID: <200907271844.n6RIi0FA016783@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Jul 27 13:44:00 2009
New Revision: 77230
URL: http://llvm.org/viewvc/llvm-project?rev=77230&view=rev
Log:
convertToThreeAddress can't handle Thumb2 instructions (which don't have same address mode as ARM instructions).
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=77230&r1=77229&r2=77230&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon Jul 27 13:44:00 2009
@@ -39,6 +39,8 @@
ARMBaseInstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
MachineBasicBlock::iterator &MBBI,
LiveVariables *LV) const {
+ // FIXME: Thumb2 support.
+
if (!EnableARM3Addr)
return NULL;
@@ -88,22 +90,19 @@
// add more than 1 instruction. Abandon!
return NULL;
UpdateMI = BuildMI(MF, MI->getDebugLoc(),
- get(isSub ? getOpcode(ARMII::SUBri) :
- getOpcode(ARMII::ADDri)), WBReg)
+ get(isSub ? ARM::SUBri : ARM::ADDri), WBReg)
.addReg(BaseReg).addImm(Amt)
.addImm(Pred).addReg(0).addReg(0);
} else if (Amt != 0) {
ARM_AM::ShiftOpc ShOpc = ARM_AM::getAM2ShiftOpc(OffImm);
unsigned SOOpc = ARM_AM::getSORegOpc(ShOpc, Amt);
UpdateMI = BuildMI(MF, MI->getDebugLoc(),
- get(isSub ? getOpcode(ARMII::SUBrs) :
- getOpcode(ARMII::ADDrs)), WBReg)
+ get(isSub ? ARM::SUBrs : ARM::ADDrs), WBReg)
.addReg(BaseReg).addReg(OffReg).addReg(0).addImm(SOOpc)
.addImm(Pred).addReg(0).addReg(0);
} else
UpdateMI = BuildMI(MF, MI->getDebugLoc(),
- get(isSub ? getOpcode(ARMII::SUBrr) :
- getOpcode(ARMII::ADDrr)), WBReg)
+ get(isSub ? ARM::SUBrr : ARM::ADDrr), WBReg)
.addReg(BaseReg).addReg(OffReg)
.addImm(Pred).addReg(0).addReg(0);
break;
@@ -114,14 +113,12 @@
if (OffReg == 0)
// Immediate is 8-bits. It's guaranteed to fit in a so_imm operand.
UpdateMI = BuildMI(MF, MI->getDebugLoc(),
- get(isSub ? getOpcode(ARMII::SUBri) :
- getOpcode(ARMII::ADDri)), WBReg)
+ get(isSub ? ARM::SUBri : ARM::ADDri), WBReg)
.addReg(BaseReg).addImm(Amt)
.addImm(Pred).addReg(0).addReg(0);
else
UpdateMI = BuildMI(MF, MI->getDebugLoc(),
- get(isSub ? getOpcode(ARMII::SUBrr) :
- getOpcode(ARMII::ADDrr)), WBReg)
+ get(isSub ? ARM::SUBrr : ARM::ADDrr), WBReg)
.addReg(BaseReg).addReg(OffReg)
.addImm(Pred).addReg(0).addReg(0);
break;
From evan.cheng at apple.com Mon Jul 27 13:48:47 2009
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 27 Jul 2009 18:48:47 -0000
Subject: [llvm-commits] [llvm] r77231 - in /llvm/trunk/lib/Target/ARM:
ARMBaseInstrInfo.h ARMInstrInfo.cpp Thumb1InstrInfo.cpp Thumb2InstrInfo.cpp
Message-ID: <200907271848.n6RImnkV016950@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Jul 27 13:48:45 2009
New Revision: 77231
URL: http://llvm.org/viewvc/llvm-project?rev=77231&view=rev
Log:
More DCE.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp
llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=77231&r1=77230&r2=77231&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Mon Jul 27 13:48:45 2009
@@ -163,12 +163,8 @@
///
enum Op {
ADDri,
- ADDrs,
- ADDrr,
MOVr,
- SUBri,
- SUBrs,
- SUBrr
+ SUBri
};
}
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=77231&r1=77230&r2=77231&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Mon Jul 27 13:48:45 2009
@@ -66,12 +66,8 @@
getOpcode(ARMII::Op Op) const {
switch (Op) {
case ARMII::ADDri: return ARM::ADDri;
- case ARMII::ADDrs: return ARM::ADDrs;
- case ARMII::ADDrr: return ARM::ADDrr;
case ARMII::MOVr: return ARM::MOVr;
case ARMII::SUBri: return ARM::SUBri;
- case ARMII::SUBrs: return ARM::SUBrs;
- case ARMII::SUBrr: return ARM::SUBrr;
default:
break;
}
Modified: llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp?rev=77231&r1=77230&r2=77231&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp Mon Jul 27 13:48:45 2009
@@ -33,12 +33,8 @@
unsigned Thumb1InstrInfo::getOpcode(ARMII::Op Op) const {
switch (Op) {
case ARMII::ADDri: return ARM::tADDi8;
- case ARMII::ADDrs: return 0;
- case ARMII::ADDrr: return ARM::tADDrr;
case ARMII::MOVr: return ARM::tMOVr;
case ARMII::SUBri: return ARM::tSUBi8;
- case ARMII::SUBrs: return 0;
- case ARMII::SUBrr: return ARM::tSUBrr;
default:
break;
}
Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=77231&r1=77230&r2=77231&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Mon Jul 27 13:48:45 2009
@@ -34,12 +34,8 @@
unsigned Thumb2InstrInfo::getOpcode(ARMII::Op Op) const {
switch (Op) {
case ARMII::ADDri: return ARM::t2ADDri;
- case ARMII::ADDrs: return ARM::t2ADDrs;
- case ARMII::ADDrr: return ARM::t2ADDrr;
case ARMII::MOVr: return ARM::t2MOVr;
case ARMII::SUBri: return ARM::t2SUBri;
- case ARMII::SUBrs: return ARM::t2SUBrs;
- case ARMII::SUBrr: return ARM::t2SUBrr;
default:
break;
}
From bruno.cardoso at gmail.com Mon Jul 27 13:54:47 2009
From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes)
Date: Mon, 27 Jul 2009 18:54:47 -0000
Subject: [llvm-commits] [llvm] r77232 - in /llvm/trunk/lib/CodeGen: ELF.h
ELFCodeEmitter.cpp ELFWriter.cpp ELFWriter.h
Message-ID: <200907271854.n6RIsmLw017108@zion.cs.uiuc.edu>
Author: bruno
Date: Mon Jul 27 13:54:47 2009
New Revision: 77232
URL: http://llvm.org/viewvc/llvm-project?rev=77232&view=rev
Log:
Handle external symbols for ELF and add some static methods to ELFSym
Modified:
llvm/trunk/lib/CodeGen/ELF.h
llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp
llvm/trunk/lib/CodeGen/ELFWriter.cpp
llvm/trunk/lib/CodeGen/ELFWriter.h
Modified: llvm/trunk/lib/CodeGen/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELF.h?rev=77232&r1=77231&r2=77232&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELF.h (original)
+++ llvm/trunk/lib/CodeGen/ELF.h Mon Jul 27 13:54:47 2009
@@ -56,9 +56,74 @@
/// added to logical symbol table for the module. This is eventually
/// turned into a real symbol table in the file.
struct ELFSym {
- // The global value this symbol matches. This should be null if the symbol
- // is not a global value.
- const GlobalValue *GV;
+
+ // ELF symbols are related to llvm ones by being one of the two llvm
+ // types, for the other ones (section, file, func) a null pointer is
+ // assumed.
+ union {
+ const GlobalValue *GV; // If this is a pointer to a GV
+ const char *Ext; // If this is a pointer to a named symbol
+ } Source;
+
+ // Describes from which source type this ELF symbol comes from,
+ // they can be GlobalValue, ExternalSymbol or neither.
+ enum {
+ isGV, // The Source.GV field is valid.
+ isExtSym, // The Source.ExtSym field is valid.
+ isOther // Not a GlobalValue or External Symbol
+ };
+ unsigned SourceType;
+
+ bool isGlobalValue() { return SourceType == isGV; }
+ bool isExternalSym() { return SourceType == isExtSym; }
+
+ // getGlobalValue - If this is a global value which originated the
+ // elf symbol, return a reference to it.
+ const GlobalValue *getGlobalValue() {
+ assert(SourceType == isGV && "This is not a global value");
+ return Source.GV;
+ };
+
+ // getExternalSym - If this is an external symbol which originated the
+ // elf symbol, return a reference to it.
+ const char *getExternalSymbol() {
+ assert(SourceType == isExtSym && "This is not an external symbol");
+ return Source.Ext;
+ };
+
+ // getGV - From a global value return a elf symbol to represent it
+ static ELFSym *getGV(const GlobalValue *GV, unsigned Bind,
+ unsigned Type, unsigned Visibility) {
+ ELFSym *Sym = new ELFSym();
+ Sym->Source.GV = GV;
+ Sym->setBind(Bind);
+ Sym->setType(Type);
+ Sym->setVisibility(Visibility);
+ Sym->SourceType = isGV;
+ return Sym;
+ }
+
+ // getExtSym - Create and return an elf symbol to represent an
+ // external symbol
+ static ELFSym *getExtSym(const char *Ext) {
+ ELFSym *Sym = new ELFSym();
+ Sym->Source.Ext = Ext;
+ Sym->setBind(STB_GLOBAL);
+ Sym->setType(STT_NOTYPE);
+ Sym->setVisibility(STV_DEFAULT);
+ Sym->SourceType = isExtSym;
+ return Sym;
+ }
+
+ // getSectionSym - Returns a elf symbol to represent an elf section
+ static ELFSym *getSectionSym() {
+ ELFSym *Sym = new ELFSym();
+ Sym->setBind(ELFSym::STB_LOCAL);
+ Sym->setType(ELFSym::STT_SECTION);
+ Sym->setVisibility(ELFSym::STV_DEFAULT);
+ Sym->SourceType = isOther;
+ return Sym;
+ }
// ELF specific fields
unsigned NameIdx; // Index in .strtab of name, once emitted.
@@ -92,9 +157,9 @@
STV_PROTECTED = 3 // Visible in other components but not preemptable
};
- ELFSym(const GlobalValue *gv) : GV(gv), NameIdx(0), Value(0),
- Size(0), Info(0), Other(STV_DEFAULT),
- SectionIdx(0), SymTabIdx(0) {}
+ ELFSym() : SourceType(isOther), NameIdx(0), Value(0),
+ Size(0), Info(0), Other(STV_DEFAULT), SectionIdx(0),
+ SymTabIdx(0) {}
unsigned getBind() const { return (Info >> 4) & 0xf; }
unsigned getType() const { return Info & 0xf; }
Modified: llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp?rev=77232&r1=77231&r2=77232&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFCodeEmitter.cpp Mon Jul 27 13:54:47 2009
@@ -69,16 +69,11 @@
bool ELFCodeEmitter::finishFunction(MachineFunction &MF) {
// Add a symbol to represent the function.
const Function *F = MF.getFunction();
- ELFSym *FnSym = new ELFSym(F);
- FnSym->setType(ELFSym::STT_FUNC);
- FnSym->setBind(EW.getGlobalELFBinding(F));
- FnSym->setVisibility(EW.getGlobalELFVisibility(F));
+ ELFSym *FnSym = ELFSym::getGV(F, EW.getGlobalELFBinding(F), ELFSym::STT_FUNC,
+ EW.getGlobalELFVisibility(F));
FnSym->SectionIdx = ES->SectionIdx;
FnSym->Size = ES->getCurrentPCOffset()-FnStartOff;
-
- // keep track of the emitted function leaving its symbol index as zero
- // to be patched up later when emitting the symbol table
- EW.setGlobalSymLookup(F, 0);
+ EW.addGlobalSymbol(F);
// Offset from start of Section
FnSym->Value = FnStartOff;
@@ -108,7 +103,9 @@
MachineRelocation &MR = Relocations[i];
intptr_t Addr;
if (MR.isGlobalValue()) {
- EW.PendingGlobals.insert(MR.getGlobalValue());
+ EW.addGlobalSymbol(MR.getGlobalValue());
+ } else if (MR.isExternalSymbol()) {
+ EW.addExternalSymbol(MR.getExternalSymbol());
} else if (MR.isBasicBlock()) {
Addr = getMachineBasicBlockAddress(MR.getBasicBlock());
MR.setConstantVal(ES->SectionIdx);
Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=77232&r1=77231&r2=77232&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Mon Jul 27 13:54:47 2009
@@ -144,6 +144,21 @@
return false;
}
+// addGlobalSymbol - Add a global to be processed and to the
+// global symbol lookup, use a zero index for non private symbols
+// because the table index will be determined later.
+void ELFWriter::addGlobalSymbol(const GlobalValue *GV) {
+ PendingGlobals.insert(GV);
+}
+
+// addExternalSymbol - Add the external to be processed and to the
+// external symbol lookup, use a zero index because the symbol
+// table index will be determined later
+void ELFWriter::addExternalSymbol(const char *External) {
+ PendingExternals.insert(External);
+ ExtSymLookup[External] = 0;
+}
+
// Get jump table section on the section name returned by TAI
ELFSection &ELFWriter::getJumpTableSection() {
unsigned Align = TM.getTargetData()->getPointerABIAlignment();
@@ -169,7 +184,7 @@
default: Kind = SectionKind::get(SectionKind::MergeableConst,false); break;
}
}
-
+
return getSection(TAI->getSectionForMergeableConstant(Kind)->getName(),
ELFSection::SHT_PROGBITS,
ELFSection::SHF_MERGE | ELFSection::SHF_ALLOC,
@@ -278,12 +293,18 @@
if (GblSymLookup.find(GV) != GblSymLookup.end())
return;
+ // If the global is a function already emited in the text section
+ // just add it to the global symbol lookup with a zero index to be
+ // patched up later.
+ if (isa(GV) && !GV->isDeclaration()) {
+ GblSymLookup[GV] = 0;
+ return;
+ }
+
// Handle ELF Bind, Visibility and Type for the current symbol
unsigned SymBind = getGlobalELFBinding(GV);
- ELFSym *GblSym = new ELFSym(GV);
- GblSym->setBind(SymBind);
- GblSym->setVisibility(getGlobalELFVisibility(GV));
- GblSym->setType(getGlobalELFType(GV));
+ ELFSym *GblSym = ELFSym::getGV(GV, SymBind, getGlobalELFType(GV),
+ getGlobalELFVisibility(GV));
if (isELFUndefSym(GV)) {
GblSym->SectionIdx = ELFSection::SHN_UNDEF;
@@ -341,16 +362,18 @@
}
}
- // Private symbols must never go to the symbol table.
- unsigned SymIdx = 0;
if (GV->hasPrivateLinkage()) {
+ // For a private symbols, keep track of the index inside the
+ // private list since it will never go to the symbol table and
+ // won't be patched up later.
PrivateSyms.push_back(GblSym);
- SymIdx = PrivateSyms.size()-1;
+ GblSymLookup[GV] = PrivateSyms.size()-1;
} else {
+ // Non private symbol are left with zero indices until they are patched
+ // up during the symbol table emition (where the indicies are created).
SymbolList.push_back(GblSym);
+ GblSymLookup[GV] = 0;
}
-
- setGlobalSymLookup(GV, SymIdx);
}
void ELFWriter::EmitGlobalConstantStruct(const ConstantStruct *CVS,
@@ -478,10 +501,15 @@
EmitGlobal(I);
// Emit all pending globals
- for (SetVector::const_iterator I = PendingGlobals.begin(),
- E = PendingGlobals.end(); I != E; ++I)
+ for (PendingGblsIter I = PendingGlobals.begin(), E = PendingGlobals.end();
+ I != E; ++I)
EmitGlobal(*I);
+ // Emit all pending externals
+ for (PendingExtsIter I = PendingExternals.begin(), E = PendingExternals.end();
+ I != E; ++I)
+ SymbolList.push_back(ELFSym::getExtSym(*I));
+
// Emit non-executable stack note
if (TAI->getNonexecutableStackDirective())
getNonExecStackSection();
@@ -489,12 +517,8 @@
// Emit a symbol for each section created until now, skip null section
for (unsigned i = 1, e = SectionList.size(); i < e; ++i) {
ELFSection &ES = *SectionList[i];
- ELFSym *SectionSym = new ELFSym(0);
+ ELFSym *SectionSym = ELFSym::getSectionSym();
SectionSym->SectionIdx = ES.SectionIdx;
- SectionSym->Size = 0;
- SectionSym->setBind(ELFSym::STB_LOCAL);
- SectionSym->setType(ELFSym::STT_SECTION);
- SectionSym->setVisibility(ELFSym::STV_DEFAULT);
SymbolList.push_back(SectionSym);
ES.Sym = SymbolList.back();
}
@@ -589,6 +613,10 @@
} else {
Addend = TEW->getDefaultAddendForRelTy(RelType);
}
+ } else if (MR.isExternalSymbol()) {
+ const char *ExtSym = MR.getExternalSymbol();
+ SymIdx = ExtSymLookup[ExtSym];
+ Addend = TEW->getDefaultAddendForRelTy(RelType);
} else {
// Get the symbol index for the section symbol
unsigned SectionIdx = MR.getConstantVal();
@@ -695,7 +723,10 @@
// Use the name mangler to uniquify the LLVM symbol.
std::string Name;
- if (Sym.GV) Name.append(Mang->getMangledName(Sym.GV));
+ if (Sym.isGlobalValue())
+ Name.append(Mang->getMangledName(Sym.getGlobalValue()));
+ else if (Sym.isExternalSym())
+ Name.append(Sym.getExternalSymbol());
if (Name.empty()) {
Sym.NameIdx = 0;
@@ -755,7 +786,7 @@
SymTab.EntSize = TEW->getSymTabEntrySize();
// The first entry in the symtab is the null symbol
- SymbolList.insert(SymbolList.begin(), new ELFSym(0));
+ SymbolList.insert(SymbolList.begin(), new ELFSym());
// Reorder the symbol table with local symbols first!
unsigned FirstNonLocalSymbol = SortSymbols();
@@ -767,8 +798,11 @@
// Emit symbol to the symbol table
EmitSymbol(SymTab, Sym);
- // Record the symbol table index for each global value
- if (Sym.GV) setGlobalSymLookup(Sym.GV, i);
+ // Record the symbol table index for each symbol
+ if (Sym.isGlobalValue())
+ GblSymLookup[Sym.getGlobalValue()] = i;
+ else if (Sym.isExternalSym())
+ ExtSymLookup[Sym.getExternalSymbol()] = i;
// Keep track on the symbol index into the symbol table
Sym.SymTabIdx = i;
Modified: llvm/trunk/lib/CodeGen/ELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.h?rev=77232&r1=77231&r2=77232&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.h (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.h Mon Jul 27 13:54:47 2009
@@ -38,6 +38,8 @@
typedef std::vector::iterator ELFSymIter;
typedef std::vector::iterator ELFSectionIter;
+ typedef SetVector::const_iterator PendingGblsIter;
+ typedef SetVector::const_iterator PendingExtsIter;
/// ELFWriter - This class implements the common target-independent code for
/// writing ELF files. Targets should derive a class from this to
@@ -108,11 +110,22 @@
/// the SectionList. Used to quickly gather the Section Index from TAI names
std::map SectionLookup;
+ /// PendingGlobals - Globals not processed as symbols yet.
+ SetVector PendingGlobals;
+
/// GblSymLookup - This is a mapping from global value to a symbol index
/// in the symbol table or private symbols list. This is useful since reloc
- /// symbol references must be quickly mapped to their indices on the lists
+ /// symbol references must be quickly mapped to their indices on the lists.
std::map GblSymLookup;
+ /// PendingExternals - Externals not processed as symbols yet.
+ SetVector PendingExternals;
+
+ /// ExtSymLookup - This is a mapping from externals to a symbol index
+ /// in the symbol table list. This is useful since reloc symbol references
+ /// must be quickly mapped to their symbol table indices.
+ std::map ExtSymLookup;
+
/// SymbolList - This is the list of symbols emitted to the symbol table.
/// When the SymbolList is finally built, local symbols must be placed in
/// the beginning while non-locals at the end.
@@ -122,11 +135,6 @@
/// present in the SymbolList.
std::vector PrivateSyms;
- /// PendingGlobals - List of externally defined symbols that we have been
- /// asked to emit, but have not seen a reference to. When a reference
- /// is seen, the symbol will move from this list to the SymbolList.
- SetVector PendingGlobals;
-
// Remove tab from section name prefix. This is necessary becase TAI
// sometimes return a section name prefixed with elf unused chars. This is
// a little bit dirty. FIXME: find a better approach, maybe add more
@@ -212,10 +220,15 @@
unsigned getGlobalELFVisibility(const GlobalValue *GV);
unsigned getElfSectionFlags(SectionKind Kind);
- // setGlobalSymLookup - Set global value 'GV' with 'Index' in the lookup map
- void setGlobalSymLookup(const GlobalValue *GV, unsigned Index) {
- GblSymLookup[GV] = Index;
- }
+ // addGlobalSymbol - Add a global to be processed and to the
+ // global symbol lookup, use a zero index for non private symbols
+ // because the table index will be determined later.
+ void addGlobalSymbol(const GlobalValue *GV);
+
+ // addExternalSymbol - Add the external to be processed and to the
+ // external symbol lookup, use a zero index because the symbol
+ // table index will be determined later
+ void addExternalSymbol(const char *External);
// As we complete the ELF file, we need to update fields in the ELF header
// (e.g. the location of the section table). These members keep track of
From sabre at nondot.org Mon Jul 27 14:00:33 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 19:00:33 -0000
Subject: [llvm-commits] [llvm] r77233 - in /llvm/trunk/lib/Target/ARM:
ARMTargetAsmInfo.h ARMTargetMachine.cpp
Message-ID: <200907271900.n6RJ0XN6017345@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 14:00:33 2009
New Revision: 77233
URL: http://llvm.org/viewvc/llvm-project?rev=77233&view=rev
Log:
remove dead code.
Modified:
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h?rev=77233&r1=77232&r2=77233&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h Mon Jul 27 14:00:33 2009
@@ -46,8 +46,6 @@
unsigned countString(const char *p) const;
};
- typedef ARMTargetAsmInfo ARMGenericTargetAsmInfo;
-
EXTERN_TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo);
struct ARMDarwinTargetAsmInfo : public ARMTargetAsmInfo {
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=77233&r1=77232&r2=77233&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Mon Jul 27 14:00:33 2009
@@ -76,12 +76,11 @@
const TargetAsmInfo *ARMBaseTargetMachine::createTargetAsmInfo() const {
switch (Subtarget.TargetType) {
- case ARMSubtarget::isDarwin:
+ default: llvm_unreachable("Unknown ARM subtarget kind");
+ case ARMSubtarget::isDarwin:
return new ARMDarwinTargetAsmInfo(*this);
- case ARMSubtarget::isELF:
+ case ARMSubtarget::isELF:
return new ARMELFTargetAsmInfo(*this);
- default:
- return new ARMGenericTargetAsmInfo(*this);
}
}
From sabre at nondot.org Mon Jul 27 14:14:15 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 19:14:15 -0000
Subject: [llvm-commits] [llvm] r77236 - in /llvm/trunk:
include/llvm/Target/COFFTargetAsmInfo.h
include/llvm/Target/ELFTargetAsmInfo.h include/llvm/Target/TargetAsmInfo.h
lib/Target/COFFTargetAsmInfo.cpp lib/Target/ELFTargetAsmInfo.cpp
lib/Target/TargetAsmInfo.cpp
Message-ID: <200907271914.n6RJEFBJ017873@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 14:14:14 2009
New Revision: 77236
URL: http://llvm.org/viewvc/llvm-project?rev=77236&view=rev
Log:
Sink getSectionPrefixForUniqueGlobal down into the TAI
implementations that need it, rearrange ELFTAI.
Modified:
llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
llvm/trunk/lib/Target/TargetAsmInfo.cpp
Modified: llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h?rev=77236&r1=77235&r2=77236&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h Mon Jul 27 14:14:14 2009
@@ -17,12 +17,12 @@
protected:
explicit COFFTargetAsmInfo(const TargetMachine &TM);
public:
-
- virtual const char *
- getSectionPrefixForUniqueGlobal(SectionKind kind) const;
-
virtual void getSectionFlagsAsString(SectionKind Kind,
SmallVectorImpl &Str) const;
+
+ virtual const Section *
+ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind) const;
+
};
}
Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=77236&r1=77235&r2=77236&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Mon Jul 27 14:14:14 2009
@@ -33,8 +33,6 @@
void getSectionFlagsAsString(SectionKind Kind,
SmallVectorImpl &Str) const;
- const char *getSectionPrefixForUniqueGlobal(SectionKind Kind) const;
-
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
SectionKind Kind) const;
Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=77236&r1=77235&r2=77236&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Jul 27 14:14:14 2009
@@ -144,6 +144,9 @@
bool ExplicitSection : 1;
public:
+ // FIXME: REMOVE.
+ Kind getKind() const { return K; }
+
bool isWeak() const { return Weak; }
bool hasExplicitSection() const { return ExplicitSection; }
@@ -669,15 +672,6 @@
virtual const Section *getSectionForMergeableConstant(SectionKind Kind)const;
- /// getSectionPrefixForUniqueGlobal - Return a string that we should prepend
- /// onto a global's name in order to get the unique section name for the
- /// global. This is important for globals that need to be merged across
- /// translation units.
- virtual const char *
- getSectionPrefixForUniqueGlobal(SectionKind Kind) const {
- return 0;
- }
-
/// getKindForNamedSection - If this target wants to be able to override
/// section flags based on the name of the section specified for a global
/// variable, it can implement this. This is used on ELF systems so that
Modified: llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp?rev=77236&r1=77235&r2=77236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp Mon Jul 27 14:14:14 2009
@@ -53,15 +53,6 @@
DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
}
-const char *COFFTargetAsmInfo::
-getSectionPrefixForUniqueGlobal(SectionKind Kind) const {
- if (Kind.isText())
- return ".text$linkonce";
- if (Kind.isWriteable())
- return ".data$linkonce";
- return ".rdata$linkonce";
-}
-
void COFFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
SmallVectorImpl &Str) const {
// FIXME: Inefficient.
@@ -74,3 +65,45 @@
Str.append(Res.begin(), Res.end());
}
+
+//===----------------------------------------------------------------------===//
+// Move to AsmPrinter (mangler access).
+//===----------------------------------------------------------------------===//
+
+#include "llvm/GlobalVariable.h"
+
+static const char *getSectionPrefixForUniqueGlobal(SectionKind Kind) {
+ if (Kind.isText())
+ return ".text$linkonce";
+ if (Kind.isWriteable())
+ return ".data$linkonce";
+ return ".rdata$linkonce";
+}
+
+const Section *
+COFFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind Kind) const {
+ assert(!Kind.isThreadLocal() && "Doesn't support TLS");
+
+ // If this global is linkonce/weak and the target handles this by emitting it
+ // into a 'uniqued' section name, create and return the section now.
+ if (Kind.isWeak()) {
+ const char *Prefix = getSectionPrefixForUniqueGlobal(Kind);
+ // FIXME: Use mangler interface (PR4584).
+ std::string Name = Prefix+GV->getNameStr();
+ return getOrCreateSection(Name.c_str(), false, Kind.getKind());
+ }
+
+ if (Kind.isText())
+ return getTextSection();
+
+ if (Kind.isBSS())
+ if (const Section *S = getBSSSection_())
+ return S;
+
+ if (Kind.isReadOnly())
+ if (const Section *S = getReadOnlySection())
+ return S;
+
+ return getDataSection();
+}
Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=77236&r1=77235&r2=77236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Mon Jul 27 14:14:14 2009
@@ -12,16 +12,8 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/GlobalVariable.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
-#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/ELFTargetAsmInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/ADT/SmallVector.h"
using namespace llvm;
ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM)
@@ -53,72 +45,6 @@
SectionKind::MergeableConst16);
}
-
-const Section*
-ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind) const {
- if (Kind.isText()) return TextSection;
- if (Kind.isMergeableCString()) {
- const TargetData *TD = TM.getTargetData();
- Constant *C = cast(GV)->getInitializer();
- const Type *Ty = cast(C->getType())->getElementType();
-
- unsigned Size = TD->getTypeAllocSize(Ty);
- if (Size <= 16) {
- assert(getCStringSection() && "Should have string section prefix");
-
- // We also need alignment here.
- // FIXME: this is getting the alignment of the character, not the
- // alignment of the string!!
- unsigned Align = TD->getPrefTypeAlignment(Ty);
- if (Align < Size)
- Align = Size;
-
- std::string Name = getCStringSection() + utostr(Size) + '.' +
- utostr(Align);
- return getOrCreateSection(Name.c_str(), false,
- SectionKind::MergeableCString);
- }
-
- return getReadOnlySection();
- }
-
- if (Kind.isMergeableConst()) {
- if (Kind.isMergeableConst4())
- return MergeableConst4Section;
- if (Kind.isMergeableConst8())
- return MergeableConst8Section;
- if (Kind.isMergeableConst16())
- return MergeableConst16Section;
- return ReadOnlySection; // .const
- }
-
- if (Kind.isReadOnly()) return getReadOnlySection();
-
-
- if (Kind.isThreadData()) return TLSDataSection;
- if (Kind.isThreadBSS()) return TLSBSSSection;
-
- if (Kind.isBSS()) return getBSSSection_();
-
-
- if (Kind.isDataNoRel()) return DataSection;
- if (Kind.isDataRelLocal()) return DataRelLocalSection;
- if (Kind.isDataRel()) return DataRelSection;
- if (Kind.isReadOnlyWithRelLocal()) return DataRelROLocalSection;
-
- assert(Kind.isReadOnlyWithRel() && "Unknown section kind");
- return DataRelROSection;
-}
-
-/// getSectionForMergeableConstant - Given a Mergeable constant with the
-/// specified size and relocation information, return a section that it
-/// should be placed in.
-const Section *
-ELFTargetAsmInfo::getSectionForMergeableConstant(SectionKind Kind) const {
- return SelectSectionForGlobal(0, Kind);
-}
-
/// getFlagsForNamedSection - If this target wants to be able to infer
/// section flags based on the name of the section specified for a global
/// variable, it can implement this.
@@ -148,24 +74,6 @@
return K;
}
-const char *
-ELFTargetAsmInfo::getSectionPrefixForUniqueGlobal(SectionKind Kind) const{
- if (Kind.isText()) return ".gnu.linkonce.t.";
- if (Kind.isReadOnly()) return ".gnu.linkonce.r.";
-
- if (Kind.isThreadData()) return ".gnu.linkonce.td.";
- if (Kind.isThreadBSS()) return ".gnu.linkonce.tb.";
-
- if (Kind.isBSS()) return ".gnu.linkonce.b.";
- if (Kind.isDataNoRel()) return ".gnu.linkonce.d.";
- if (Kind.isDataRelLocal()) return ".gnu.linkonce.d.rel.local.";
- if (Kind.isDataRel()) return ".gnu.linkonce.d.rel.";
- if (Kind.isReadOnlyWithRelLocal()) return ".gnu.linkonce.d.rel.ro.local.";
-
- assert(Kind.isReadOnlyWithRel() && "Unknown section kind");
- return ".gnu.linkonce.d.rel.ro.";
-}
-
void ELFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
SmallVectorImpl &Str) const {
@@ -219,3 +127,108 @@
Str.push_back('6');
}
}
+
+
+
+//===----------------------------------------------------------------------===//
+// Move to AsmPrinter (mangler access).
+//===----------------------------------------------------------------------===//
+
+#include "llvm/DerivedTypes.h"
+#include "llvm/GlobalVariable.h"
+#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetMachine.h"
+#include "llvm/ADT/StringExtras.h"
+
+static const char *getSectionPrefixForUniqueGlobal(SectionKind Kind) {
+ if (Kind.isText()) return ".gnu.linkonce.t.";
+ if (Kind.isReadOnly()) return ".gnu.linkonce.r.";
+
+ if (Kind.isThreadData()) return ".gnu.linkonce.td.";
+ if (Kind.isThreadBSS()) return ".gnu.linkonce.tb.";
+
+ if (Kind.isBSS()) return ".gnu.linkonce.b.";
+ if (Kind.isDataNoRel()) return ".gnu.linkonce.d.";
+ if (Kind.isDataRelLocal()) return ".gnu.linkonce.d.rel.local.";
+ if (Kind.isDataRel()) return ".gnu.linkonce.d.rel.";
+ if (Kind.isReadOnlyWithRelLocal()) return ".gnu.linkonce.d.rel.ro.local.";
+
+ assert(Kind.isReadOnlyWithRel() && "Unknown section kind");
+ return ".gnu.linkonce.d.rel.ro.";
+}
+
+const Section*
+ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind Kind) const {
+
+ // If this global is linkonce/weak and the target handles this by emitting it
+ // into a 'uniqued' section name, create and return the section now.
+ if (Kind.isWeak()) {
+ const char *Prefix = getSectionPrefixForUniqueGlobal(Kind);
+ // FIXME: Use mangler interface (PR4584).
+ std::string Name = Prefix+GV->getNameStr();
+ return getOrCreateSection(Name.c_str(), false, Kind.getKind());
+ }
+
+ if (Kind.isText()) return TextSection;
+ if (Kind.isMergeableCString()) {
+ const TargetData *TD = TM.getTargetData();
+ Constant *C = cast(GV)->getInitializer();
+ const Type *Ty = cast(C->getType())->getElementType();
+
+ unsigned Size = TD->getTypeAllocSize(Ty);
+ if (Size <= 16) {
+ assert(getCStringSection() && "Should have string section prefix");
+
+ // We also need alignment here.
+ // FIXME: this is getting the alignment of the character, not the
+ // alignment of the string!!
+ unsigned Align = TD->getPrefTypeAlignment(Ty);
+ if (Align < Size)
+ Align = Size;
+
+ std::string Name = getCStringSection() + utostr(Size) + '.' +
+ utostr(Align);
+ return getOrCreateSection(Name.c_str(), false,
+ SectionKind::MergeableCString);
+ }
+
+ return getReadOnlySection();
+ }
+
+ if (Kind.isMergeableConst()) {
+ if (Kind.isMergeableConst4())
+ return MergeableConst4Section;
+ if (Kind.isMergeableConst8())
+ return MergeableConst8Section;
+ if (Kind.isMergeableConst16())
+ return MergeableConst16Section;
+ return ReadOnlySection; // .const
+ }
+
+ if (Kind.isReadOnly()) return getReadOnlySection();
+
+
+ if (Kind.isThreadData()) return TLSDataSection;
+ if (Kind.isThreadBSS()) return TLSBSSSection;
+
+ if (Kind.isBSS()) return getBSSSection_();
+
+
+ if (Kind.isDataNoRel()) return DataSection;
+ if (Kind.isDataRelLocal()) return DataRelLocalSection;
+ if (Kind.isDataRel()) return DataRelSection;
+ if (Kind.isReadOnlyWithRelLocal()) return DataRelROLocalSection;
+
+ assert(Kind.isReadOnlyWithRel() && "Unknown section kind");
+ return DataRelROSection;
+}
+
+/// getSectionForMergeableConstant - Given a Mergeable constant with the
+/// specified size and relocation information, return a section that it
+/// should be placed in.
+const Section *
+ELFTargetAsmInfo::getSectionForMergeableConstant(SectionKind Kind) const {
+ return SelectSectionForGlobal(0, Kind);
+}
+
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77236&r1=77235&r2=77236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Jul 27 14:14:14 2009
@@ -319,15 +319,6 @@
return getOrCreateSection(GV->getSection().c_str(), false, GVKind);
}
- // If this global is linkonce/weak and the target handles this by emitting it
- // into a 'uniqued' section name, create and return the section now.
- if (Kind.isWeak()) {
- if (const char *Prefix = getSectionPrefixForUniqueGlobal(Kind)) {
- // FIXME: Use mangler interface (PR4584).
- std::string Name = Prefix+GV->getNameStr();
- return getOrCreateSection(Name.c_str(), false, GVKind);
- }
- }
// Use default section depending on the 'type' of global
return SelectSectionForGlobal(GV, Kind);
From bruno.cardoso at gmail.com Mon Jul 27 14:32:57 2009
From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes)
Date: Mon, 27 Jul 2009 19:32:57 -0000
Subject: [llvm-commits] [llvm] r77238 - in /llvm/trunk/lib/CodeGen: ELF.h
ELFWriter.cpp ELFWriter.h
Message-ID: <200907271932.n6RJWvBU018431@zion.cs.uiuc.edu>
Author: bruno
Date: Mon Jul 27 14:32:57 2009
New Revision: 77238
URL: http://llvm.org/viewvc/llvm-project?rev=77238&view=rev
Log:
add module identifier to the elf object file
Modified:
llvm/trunk/lib/CodeGen/ELF.h
llvm/trunk/lib/CodeGen/ELFWriter.cpp
llvm/trunk/lib/CodeGen/ELFWriter.h
Modified: llvm/trunk/lib/CodeGen/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELF.h?rev=77238&r1=77237&r2=77238&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELF.h (original)
+++ llvm/trunk/lib/CodeGen/ELF.h Mon Jul 27 14:32:57 2009
@@ -59,10 +59,10 @@
// ELF symbols are related to llvm ones by being one of the two llvm
// types, for the other ones (section, file, func) a null pointer is
- // assumed.
+ // assumed by default.
union {
const GlobalValue *GV; // If this is a pointer to a GV
- const char *Ext; // If this is a pointer to a named symbol
+ const char *Ext; // If this is a pointer to a named symbol
} Source;
// Describes from which source type this ELF symbol comes from,
@@ -118,9 +118,20 @@
// getSectionSym - Returns a elf symbol to represent an elf section
static ELFSym *getSectionSym() {
ELFSym *Sym = new ELFSym();
- Sym->setBind(ELFSym::STB_LOCAL);
- Sym->setType(ELFSym::STT_SECTION);
- Sym->setVisibility(ELFSym::STV_DEFAULT);
+ Sym->setBind(STB_LOCAL);
+ Sym->setType(STT_SECTION);
+ Sym->setVisibility(STV_DEFAULT);
+ Sym->SourceType = isOther;
+ return Sym;
+ }
+
+ // getSectionSym - Returns a elf symbol to represent an elf section
+ static ELFSym *getFileSym() {
+ ELFSym *Sym = new ELFSym();
+ Sym->setBind(STB_LOCAL);
+ Sym->setType(STT_FILE);
+ Sym->setVisibility(STV_DEFAULT);
+ Sym->SectionIdx = 0xfff1; // ELFSection::SHN_ABS;
Sym->SourceType = isOther;
return Sym;
}
@@ -164,6 +175,7 @@
unsigned getBind() const { return (Info >> 4) & 0xf; }
unsigned getType() const { return Info & 0xf; }
bool isLocalBind() const { return getBind() == STB_LOCAL; }
+ bool isFileType() const { return getType() == STT_FILE; }
void setBind(unsigned X) {
assert(X == (X & 0xF) && "Bind value out of range!");
Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=77238&r1=77237&r2=77238&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Mon Jul 27 14:32:57 2009
@@ -514,6 +514,9 @@
if (TAI->getNonexecutableStackDirective())
getNonExecStackSection();
+ // Emit module name
+ SymbolList.push_back(ELFSym::getFileSym());
+
// Emit a symbol for each section created until now, skip null section
for (unsigned i = 1, e = SectionList.size(); i < e; ++i) {
ELFSection &ES = *SectionList[i];
@@ -524,7 +527,7 @@
}
// Emit string table
- EmitStringTable();
+ EmitStringTable(M.getModuleIdentifier());
// Emit the symbol table now, if non-empty.
EmitSymbolTable();
@@ -709,7 +712,7 @@
/// EmitStringTable - If the current symbol table is non-empty, emit the string
/// table for it
-void ELFWriter::EmitStringTable() {
+void ELFWriter::EmitStringTable(const std::string &ModuleName) {
if (!SymbolList.size()) return; // Empty symbol table.
ELFSection &StrTab = getStringTableSection();
@@ -721,12 +724,14 @@
for (ELFSymIter I=SymbolList.begin(), E=SymbolList.end(); I != E; ++I) {
ELFSym &Sym = *(*I);
- // Use the name mangler to uniquify the LLVM symbol.
std::string Name;
if (Sym.isGlobalValue())
+ // Use the name mangler to uniquify the LLVM symbol.
Name.append(Mang->getMangledName(Sym.getGlobalValue()));
else if (Sym.isExternalSym())
Name.append(Sym.getExternalSymbol());
+ else if (Sym.isFileType())
+ Name.append(ModuleName);
if (Name.empty()) {
Sym.NameIdx = 0;
Modified: llvm/trunk/lib/CodeGen/ELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.h?rev=77238&r1=77237&r2=77238&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.h (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.h Mon Jul 27 14:32:57 2009
@@ -250,7 +250,7 @@
void EmitSectionTableStringTable();
void EmitSymbol(BinaryObject &SymbolTable, ELFSym &Sym);
void EmitSymbolTable();
- void EmitStringTable();
+ void EmitStringTable(const std::string &ModuleName);
void OutputSectionsAndSectionTable();
void RelocateField(BinaryObject &BO, uint32_t Offset, int64_t Value,
unsigned Size);
From bruno.cardoso at gmail.com Mon Jul 27 14:38:39 2009
From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes)
Date: Mon, 27 Jul 2009 19:38:39 -0000
Subject: [llvm-commits] [llvm] r77239 - /llvm/trunk/lib/CodeGen/ELF.h
Message-ID: <200907271938.n6RJcdVO018592@zion.cs.uiuc.edu>
Author: bruno
Date: Mon Jul 27 14:38:38 2009
New Revision: 77239
URL: http://llvm.org/viewvc/llvm-project?rev=77239&view=rev
Log:
fix comment
Modified:
llvm/trunk/lib/CodeGen/ELF.h
Modified: llvm/trunk/lib/CodeGen/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELF.h?rev=77239&r1=77238&r2=77239&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELF.h (original)
+++ llvm/trunk/lib/CodeGen/ELF.h Mon Jul 27 14:38:38 2009
@@ -125,7 +125,7 @@
return Sym;
}
- // getSectionSym - Returns a elf symbol to represent an elf section
+ // getFileSym - Returns a elf symbol to represent the module identifier
static ELFSym *getFileSym() {
ELFSym *Sym = new ELFSym();
Sym->setBind(STB_LOCAL);
From pawel.worach at gmail.com Mon Jul 27 14:44:47 2009
From: pawel.worach at gmail.com (Pawel Worach)
Date: Mon, 27 Jul 2009 21:44:47 +0200
Subject: [llvm-commits] [patch] make Program::FindProgramByName not look in
"." unless it's in $PATH
Message-ID:
Hi,
This patch fixes the FIXME regarding looking in "." for ld, as,
clang-cc and friends unconditionally.
If "." is in $PATH it will pick up the program in "." correctly.
Tested on Unix only.
Solution suggested by edwin on #llvm.
Regards
--
Pawel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: program-path.diff
Type: application/octet-stream
Size: 1141 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090727/6d5e4646/attachment.obj
From scallanan at apple.com Mon Jul 27 14:45:29 2009
From: scallanan at apple.com (Sean Callanan)
Date: Mon, 27 Jul 2009 19:45:29 -0000
Subject: [llvm-commits] [llvm] r77240 -
/llvm/trunk/include/llvm/Support/MemoryObject.h
Message-ID: <200907271945.n6RJjTLR018790@zion.cs.uiuc.edu>
Author: spyffe
Date: Mon Jul 27 14:45:28 2009
New Revision: 77240
URL: http://llvm.org/viewvc/llvm-project?rev=77240&view=rev
Log:
Thanks, Bill!
Modified:
llvm/trunk/include/llvm/Support/MemoryObject.h
Modified: llvm/trunk/include/llvm/Support/MemoryObject.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryObject.h?rev=77240&r1=77239&r2=77240&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MemoryObject.h (original)
+++ llvm/trunk/include/llvm/Support/MemoryObject.h Mon Jul 27 14:45:28 2009
@@ -20,7 +20,7 @@
class MemoryObject {
public:
/// Destructor - Override as necessary.
- ~MemoryObject() {
+ virtual ~MemoryObject() {
}
/// getBase - Returns the lowest valid address in the region.
From david_goodwin at apple.com Mon Jul 27 14:59:26 2009
From: david_goodwin at apple.com (David Goodwin)
Date: Mon, 27 Jul 2009 19:59:26 -0000
Subject: [llvm-commits] [llvm] r77242 - in /llvm/trunk/lib/Target/ARM:
ARMInstrFormats.td ARMInstrThumb.td
Message-ID: <200907271959.n6RJxQfE019336@zion.cs.uiuc.edu>
Author: david_goodwin
Date: Mon Jul 27 14:59:26 2009
New Revision: 77242
URL: http://llvm.org/viewvc/llvm-project?rev=77242&view=rev
Log:
Remove TPat. No patterns depend on just isThumb(). Must use either T1Pat (isThumb1Only()) or T2Pat (is Thumb2).
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=77242&r1=77241&r2=77242&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Jul 27 14:59:26 2009
@@ -816,15 +816,6 @@
class TJTI pattern>
: ThumbI;
-// TPat - Same as Pat<>, but requires that the compiler be in Thumb mode.
-class TPat : Pat {
- list Predicates = [IsThumb];
-}
-
-class Tv5Pat : Pat {
- list Predicates = [IsThumb, HasV5T];
-}
-
// Thumb1 only
class Thumb1I pattern>
@@ -894,10 +885,6 @@
class T1pIs pattern>
: Thumb1pI;
-class T1Pat : Pat {
- list Predicates = [IsThumb1Only];
-}
-
// Thumb2I - Thumb2 instruction. Almost all Thumb2 instructions are predicable.
class Thumb2I pattern>
@@ -967,6 +954,15 @@
list Predicates = [IsThumb2];
}
+// Tv5Pat - Same as Pat<>, but requires V5T Thumb mode.
+class Tv5Pat : Pat {
+ list Predicates = [IsThumb1Only, HasV5T];
+}
+
+// T1Pat - Same as Pat<>, but requires that the compiler be in Thumb1 mode.
+class T1Pat : Pat {
+ list Predicates = [IsThumb1Only];
+}
// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
class T2Pat : Pat {
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=77242&r1=77241&r2=77242&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Mon Jul 27 14:59:26 2009
@@ -575,31 +575,31 @@
//
// Add with carry
-def : TPat<(addc tGPR:$lhs, imm0_7:$rhs),
- (tADDi3 tGPR:$lhs, imm0_7:$rhs)>;
-def : TPat<(addc tGPR:$lhs, imm8_255:$rhs),
- (tADDi3 tGPR:$lhs, imm8_255:$rhs)>;
-def : TPat<(addc tGPR:$lhs, tGPR:$rhs),
- (tADDrr tGPR:$lhs, tGPR:$rhs)>;
+def : T1Pat<(addc tGPR:$lhs, imm0_7:$rhs),
+ (tADDi3 tGPR:$lhs, imm0_7:$rhs)>;
+def : T1Pat<(addc tGPR:$lhs, imm8_255:$rhs),
+ (tADDi3 tGPR:$lhs, imm8_255:$rhs)>;
+def : T1Pat<(addc tGPR:$lhs, tGPR:$rhs),
+ (tADDrr tGPR:$lhs, tGPR:$rhs)>;
// Subtract with carry
-def : TPat<(addc tGPR:$lhs, imm0_7_neg:$rhs),
- (tSUBi3 tGPR:$lhs, imm0_7_neg:$rhs)>;
-def : TPat<(addc tGPR:$lhs, imm8_255_neg:$rhs),
- (tSUBi8 tGPR:$lhs, imm8_255_neg:$rhs)>;
-def : TPat<(subc tGPR:$lhs, tGPR:$rhs),
- (tSUBrr tGPR:$lhs, tGPR:$rhs)>;
+def : T1Pat<(addc tGPR:$lhs, imm0_7_neg:$rhs),
+ (tSUBi3 tGPR:$lhs, imm0_7_neg:$rhs)>;
+def : T1Pat<(addc tGPR:$lhs, imm8_255_neg:$rhs),
+ (tSUBi8 tGPR:$lhs, imm8_255_neg:$rhs)>;
+def : T1Pat<(subc tGPR:$lhs, tGPR:$rhs),
+ (tSUBrr tGPR:$lhs, tGPR:$rhs)>;
// ConstantPool, GlobalAddress
-def : TPat<(ARMWrapper tglobaladdr :$dst), (tLEApcrel tglobaladdr :$dst)>;
-def : TPat<(ARMWrapper tconstpool :$dst), (tLEApcrel tconstpool :$dst)>;
+def : T1Pat<(ARMWrapper tglobaladdr :$dst), (tLEApcrel tglobaladdr :$dst)>;
+def : T1Pat<(ARMWrapper tconstpool :$dst), (tLEApcrel tconstpool :$dst)>;
// JumpTable
-def : TPat<(ARMWrapperJT tjumptable:$dst, imm:$id),
- (tLEApcrelJT tjumptable:$dst, imm:$id)>;
+def : T1Pat<(ARMWrapperJT tjumptable:$dst, imm:$id),
+ (tLEApcrelJT tjumptable:$dst, imm:$id)>;
// Direct calls
-def : TPat<(ARMtcall texternalsym:$func), (tBL texternalsym:$func)>;
+def : T1Pat<(ARMtcall texternalsym:$func), (tBL texternalsym:$func)>;
def : Tv5Pat<(ARMcall texternalsym:$func), (tBLXi texternalsym:$func)>;
// Indirect calls to ARM routines
From gohman at apple.com Mon Jul 27 15:20:24 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 13:20:24 -0700
Subject: [llvm-commits] [patch] make Program::FindProgramByName not look
in "." unless it's in $PATH
In-Reply-To:
References:
Message-ID:
On Jul 27, 2009, at 12:44 PM, Pawel Worach wrote:
> Hi,
>
> This patch fixes the FIXME regarding looking in "." for ld, as,
> clang-cc and friends unconditionally.
> If "." is in $PATH it will pick up the program in "." correctly.
> Tested on Unix only.
>
> Solution suggested by edwin on #llvm.
Hello,
The traditional behavior of sh(1) and friends is to use the given
path verbatim if it contains any slashes, not just if it's
absolute.
Dan
From sabre at nondot.org Mon Jul 27 15:28:54 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 15:28:54 -0500
Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html
Message-ID: <200907272028.n6RKSs4H020342@zion.cs.uiuc.edu>
Changes in directory llvm-www/devmtg/2008-08:
index.html updated: 1.27 -> 1.28
---
Log message:
add youtube video link
---
Diffs of the changes: (+3 -1)
index.html | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: llvm-www/devmtg/2008-08/index.html
diff -u llvm-www/devmtg/2008-08/index.html:1.27 llvm-www/devmtg/2008-08/index.html:1.28
--- llvm-www/devmtg/2008-08/index.html:1.27 Tue Aug 5 12:13:10 2008
+++ llvm-www/devmtg/2008-08/index.html Mon Jul 27 15:27:50 2009
@@ -31,6 +31,8 @@
major LLVM subsystems, followed by talks on applications of LLVM for various
specific projects.
+In addition to being available here, the videos are also available on youtube.
| Media | Who | Description |
@@ -371,7 +373,7 @@
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">
-
Last modified: $Date: 2008/08/05 17:13:10 $
+
Last modified: $Date: 2009/07/27 20:27:50 $
From dpatel at apple.com Mon Jul 27 15:30:06 2009
From: dpatel at apple.com (Devang Patel)
Date: Mon, 27 Jul 2009 20:30:06 -0000
Subject: [llvm-commits] [llvm] r77243 -
/llvm/trunk/include/llvm/Analysis/DebugInfo.h
Message-ID: <200907272030.n6RKU6ZK020400@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Jul 27 15:30:05 2009
New Revision: 77243
URL: http://llvm.org/viewvc/llvm-project?rev=77243&view=rev
Log:
80 columns!
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=77243&r1=77242&r2=77243&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Mon Jul 27 15:30:05 2009
@@ -213,9 +213,15 @@
// 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 isProtected() const { return (getFlags() & FlagProtected) != 0; }
- bool isForwardDecl() const { return (getFlags() & FlagFwdDecl) != 0; }
+ bool isPrivate() const { return
+ (getFlags() & FlagPrivate) != 0;
+ }
+ bool isProtected() const {
+ return (getFlags() & FlagProtected) != 0;
+ }
+ bool isForwardDecl() const {
+ return (getFlags() & FlagFwdDecl) != 0;
+ }
/// dump - print type.
void dump() const;
@@ -552,8 +558,9 @@
/// Find the debug info descriptor corresponding to this global variable.
Value *findDbgGlobalDeclare(GlobalVariable *V);
- bool getLocationInfo(const Value *V, std::string &DisplayName, std::string &Type,
- unsigned &LineNo, std::string &File, std::string &Dir);
+ bool getLocationInfo(const Value *V, std::string &DisplayName,
+ std::string &Type, unsigned &LineNo, std::string &File,
+ std::string &Dir);
/// CollectDebugInfoAnchors - Collect debugging information anchors.
void CollectDebugInfoAnchors(Module &M,
From a at bolka.at Mon Jul 27 15:37:11 2009
From: a at bolka.at (Andreas Bolka)
Date: Mon, 27 Jul 2009 20:37:11 -0000
Subject: [llvm-commits] [llvm] r77244 - /llvm/trunk/docs/LangRef.html
Message-ID: <200907272037.n6RKbBlU020662@zion.cs.uiuc.edu>
Author: abolka
Date: Mon Jul 27 15:37:10 2009
New Revision: 77244
URL: http://llvm.org/viewvc/llvm-project?rev=77244&view=rev
Log:
Fix typo.
Modified:
llvm/trunk/docs/LangRef.html
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=77244&r1=77243&r2=77244&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Mon Jul 27 15:37:10 2009
@@ -1252,7 +1252,7 @@
Any memory access must be done though a pointer value associated
-with with address range of the memory access, otherwise the behavior
+with an address range of the memory access, otherwise the behavior
is undefined. Pointer values are associated with address ranges
according to the following rules:
From gohman at apple.com Mon Jul 27 15:49:45 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 20:49:45 -0000
Subject: [llvm-commits] [llvm] r77245 -
/llvm/trunk/lib/Support/raw_ostream.cpp
Message-ID: <200907272049.n6RKnj5q021011@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 15:49:44 2009
New Revision: 77245
URL: http://llvm.org/viewvc/llvm-project?rev=77245&view=rev
Log:
Add an assertion check to raw_ostream's destructor to verify
that the subclass hasn't left any pending data in the buffer.
Modified:
llvm/trunk/lib/Support/raw_ostream.cpp
Modified: llvm/trunk/lib/Support/raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=77245&r1=77244&r2=77245&view=diff
==============================================================================
--- llvm/trunk/lib/Support/raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/raw_ostream.cpp Mon Jul 27 15:49:44 2009
@@ -45,6 +45,11 @@
using namespace llvm;
raw_ostream::~raw_ostream() {
+ // raw_ostream's subclasses should take care to flush the buffer
+ // in their destructors.
+ assert(OutBufCur == OutBufStart &&
+ "raw_ostream destructor called with non-empty buffer!");
+
delete [] OutBufStart;
// If there are any pending errors, report them now. Clients wishing
From gohman at apple.com Mon Jul 27 15:50:43 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 13:50:43 -0700
Subject: [llvm-commits] [llvm] r77170 - in /llvm/trunk/tools/lto:
LTOCodeGenerator.cpp LTOModule.cpp
In-Reply-To: <200907262216.n6QMGfTB032208@zion.cs.uiuc.edu>
References: <200907262216.n6QMGfTB032208@zion.cs.uiuc.edu>
Message-ID: <9B684429-0A62-4A8F-A3FF-67B9DC926544@apple.com>
On Jul 26, 2009, at 3:16 PM, Nick Lewycky wrote:
> * flush the formatted_raw_ostream& or else not all of the assembly
> will make
> it to the .s file. (It doesn't do this in its destructor?!)
Hi Nick, this sounds like a bug. raw_ostream's subclasses should
flush the buffer in their destructors. Or is the raw_ostream
destructor not getting called?
Dan
From resistor at mac.com Mon Jul 27 15:59:44 2009
From: resistor at mac.com (Owen Anderson)
Date: Mon, 27 Jul 2009 20:59:44 -0000
Subject: [llvm-commits] [llvm] r77247 - in /llvm/trunk: docs/tutorial/
examples/Kaleidoscope/ include/llvm/ include/llvm/Support/ lib/Analysis/
lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/SelectionDAG/
lib/ExecutionEngine/JIT/ lib/Target/X86/ lib/Transforms/Scalar/ lib/VMCore/
Message-ID: <200907272059.n6RKxjTC021335@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Jul 27 15:59:43 2009
New Revision: 77247
URL: http://llvm.org/viewvc/llvm-project?rev=77247&view=rev
Log:
Move ConstantFP construction back to the 2.5-ish API.
Modified:
llvm/trunk/docs/tutorial/LangImpl3.html
llvm/trunk/docs/tutorial/LangImpl4.html
llvm/trunk/docs/tutorial/LangImpl5.html
llvm/trunk/docs/tutorial/LangImpl6.html
llvm/trunk/docs/tutorial/LangImpl7.html
llvm/trunk/examples/Kaleidoscope/toy.cpp
llvm/trunk/include/llvm/Constants.h
llvm/trunk/include/llvm/LLVMContext.h
llvm/trunk/include/llvm/Support/PatternMatch.h
llvm/trunk/lib/Analysis/ConstantFolding.cpp
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
llvm/trunk/lib/VMCore/ConstantFold.cpp
llvm/trunk/lib/VMCore/Constants.cpp
llvm/trunk/lib/VMCore/Core.cpp
llvm/trunk/lib/VMCore/Instructions.cpp
llvm/trunk/lib/VMCore/LLVMContext.cpp
llvm/trunk/lib/VMCore/LLVMContextImpl.cpp
llvm/trunk/lib/VMCore/LLVMContextImpl.h
Modified: llvm/trunk/docs/tutorial/LangImpl3.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl3.html?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl3.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl3.html Mon Jul 27 15:59:43 2009
@@ -159,7 +159,7 @@
Value *NumberExprAST::Codegen() {
- return getGlobalContext().getConstantFP(APFloat(Val));
+ return ConstantFP::get(getGlobalContext(), APFloat(Val));
}
@@ -1034,7 +1034,7 @@
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return getGlobalContext().getConstantFP(APFloat(Val));
+ return ConstantFP::get(getGlobalContext(), APFloat(Val));
}
Value *VariableExprAST::Codegen() {
Modified: llvm/trunk/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl4.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl4.html Mon Jul 27 15:59:43 2009
@@ -869,7 +869,7 @@
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return getGlobalContext().getConstantFP(APFloat(Val));
+ return ConstantFP::get(getGlobalContext(), APFloat(Val));
}
Value *VariableExprAST::Codegen() {
Modified: llvm/trunk/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl5.html Mon Jul 27 15:59:43 2009
@@ -364,7 +364,7 @@
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"ifcond");
@@ -796,7 +796,7 @@
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = getGlobalContext().getConstantFP(APFloat(1.0));
+ StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0));
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
@@ -815,7 +815,7 @@
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"loopcond");
@@ -1360,7 +1360,7 @@
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return getGlobalContext().getConstantFP(APFloat(Val));
+ return ConstantFP::get(getGlobalContext(), APFloat(Val));
}
Value *VariableExprAST::Codegen() {
@@ -1411,7 +1411,7 @@
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
@@ -1510,7 +1510,7 @@
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = getGlobalContext().getConstantFP(APFloat(1.0));
+ StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0));
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
@@ -1521,7 +1521,7 @@
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"loopcond");
// Create the "after loop" block and insert it.
Modified: llvm/trunk/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl6.html Mon Jul 27 15:59:43 2009
@@ -1365,7 +1365,7 @@
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return getGlobalContext().getConstantFP(APFloat(Val));
+ return ConstantFP::get(getGlobalContext(), APFloat(Val));
}
Value *VariableExprAST::Codegen() {
@@ -1436,7 +1436,7 @@
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
@@ -1535,7 +1535,7 @@
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = getGlobalContext().getConstantFP(APFloat(1.0));
+ StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0));
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
@@ -1546,7 +1546,7 @@
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"loopcond");
// Create the "after loop" block and insert it.
Modified: llvm/trunk/docs/tutorial/LangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl7.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl7.html Mon Jul 27 15:59:43 2009
@@ -923,7 +923,7 @@
InitVal = Init->Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
- InitVal = getGlobalContext().getConstantFP(APFloat(0.0));
+ InitVal = ConstantFP::get(getGlobalContext(), APFloat(0.0));
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
@@ -1623,7 +1623,7 @@
Value *NumberExprAST::Codegen() {
- return getGlobalContext().getConstantFP(APFloat(Val));
+ return ConstantFP::get(getGlobalContext(), APFloat(Val));
}
Value *VariableExprAST::Codegen() {
@@ -1716,7 +1716,7 @@
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
@@ -1822,7 +1822,7 @@
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = getGlobalContext().getConstantFP(APFloat(1.0));
+ StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0));
}
// Compute the end condition.
@@ -1837,7 +1837,7 @@
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"loopcond");
// Create the "after loop" block and insert it.
@@ -1881,7 +1881,7 @@
InitVal = Init->Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
- InitVal = getGlobalContext().getConstantFP(APFloat(0.0));
+ InitVal = ConstantFP::get(getGlobalContext(), APFloat(0.0));
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
Modified: llvm/trunk/examples/Kaleidoscope/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/toy.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/toy.cpp Mon Jul 27 15:59:43 2009
@@ -623,7 +623,7 @@
Value *NumberExprAST::Codegen() {
- return getGlobalContext().getConstantFP(APFloat(Val));
+ return ConstantFP::get(getGlobalContext(), APFloat(Val));
}
Value *VariableExprAST::Codegen() {
@@ -716,7 +716,7 @@
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
@@ -821,7 +821,7 @@
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = getGlobalContext().getConstantFP(APFloat(1.0));
+ StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0));
}
// Compute the end condition.
@@ -836,7 +836,7 @@
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- getGlobalContext().getConstantFP(APFloat(0.0)),
+ ConstantFP::get(getGlobalContext(), APFloat(0.0)),
"loopcond");
// Create the "after loop" block and insert it.
@@ -879,7 +879,7 @@
InitVal = Init->Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
- InitVal = getGlobalContext().getConstantFP(APFloat(0.0));
+ InitVal = ConstantFP::get(getGlobalContext(), APFloat(0.0));
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
Modified: llvm/trunk/include/llvm/Constants.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constants.h?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Constants.h (original)
+++ llvm/trunk/include/llvm/Constants.h Mon Jul 27 15:59:43 2009
@@ -50,7 +50,6 @@
ConstantInt(const ConstantInt &); // DO NOT IMPLEMENT
ConstantInt(const IntegerType *Ty, const APInt& V);
APInt Val;
- friend class LLVMContextImpl;
protected:
// allocate space for exactly zero operands
void *operator new(size_t s) {
@@ -238,6 +237,19 @@
return User::operator new(s, 0);
}
public:
+ /// Floating point negation must be implemented with f(x) = -0.0 - x. This
+ /// method returns the negative zero constant for floating point or vector
+ /// floating point types; for all other types, it returns the null value.
+ static Constant* getZeroValueForNegation(const Type* Ty);
+
+ /// get() - This returns a ConstantFP, or a vector containing a splat of a
+ /// ConstantFP, for the specified value in the specified type. This should
+ /// only be used for simple constant values like 2.0/1.0 etc, that are
+ /// known-valid both as host double and as the target format.
+ static Constant* get(const Type* Ty, double V);
+ static ConstantFP* get(LLVMContext &Context, const APFloat& V);
+ static ConstantFP* getNegativeZero(const Type* Ty);
+
/// isValueValidForType - return true if Ty is big enough to represent V.
static bool isValueValidForType(const Type *Ty, const APFloat& V);
inline const APFloat& getValueAPF() const { return Val; }
Modified: llvm/trunk/include/llvm/LLVMContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LLVMContext.h?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LLVMContext.h (original)
+++ llvm/trunk/include/llvm/LLVMContext.h Mon Jul 27 15:59:43 2009
@@ -56,6 +56,7 @@
LLVMContextImpl* pImpl;
friend class ConstantInt;
+ friend class ConstantFP;
public:
LLVMContext();
~LLVMContext();
@@ -180,21 +181,6 @@
///
Constant* getConstantExprSizeOf(const Type* Ty);
- /// Floating point negation must be implemented with f(x) = -0.0 - x. This
- /// method returns the negative zero constant for floating point or vector
- /// floating point types; for all other types, it returns the null value.
- Constant* getZeroValueForNegation(const Type* Ty);
-
- // ConstantFP accessors
- ConstantFP* getConstantFP(const APFloat& V);
-
- /// get() - This returns a ConstantFP, or a vector containing a splat of a
- /// ConstantFP, for the specified value in the specified type. This should
- /// only be used for simple constant values like 2.0/1.0 etc, that are
- /// known-valid both as host double and as the target format.
- Constant* getConstantFP(const Type* Ty, double V);
- ConstantFP* getConstantFPNegativeZero(const Type* Ty);
-
// ConstantVector accessors
Constant* getConstantVector(const VectorType* T,
const std::vector& V);
Modified: llvm/trunk/include/llvm/Support/PatternMatch.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PatternMatch.h?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/PatternMatch.h (original)
+++ llvm/trunk/include/llvm/Support/PatternMatch.h Mon Jul 27 15:59:43 2009
@@ -506,7 +506,7 @@
}
private:
bool matchIfNeg(Value *LHS, Value *RHS, LLVMContext &Context) {
- return LHS == Context.getZeroValueForNegation(LHS->getType()) &&
+ return LHS == ConstantFP::getZeroValueForNegation(LHS->getType()) &&
L.match(RHS, Context);
}
};
@@ -535,7 +535,7 @@
}
private:
bool matchIfFNeg(Value *LHS, Value *RHS, LLVMContext &Context) {
- return LHS == Context.getZeroValueForNegation(LHS->getType()) &&
+ return LHS == ConstantFP::getZeroValueForNegation(LHS->getType()) &&
L.match(RHS, Context);
}
};
Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original)
+++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Mon Jul 27 15:59:43 2009
@@ -655,9 +655,9 @@
}
if (Ty == Type::FloatTy)
- return Context.getConstantFP(APFloat((float)V));
+ return ConstantFP::get(Context, APFloat((float)V));
if (Ty == Type::DoubleTy)
- return Context.getConstantFP(APFloat(V));
+ return ConstantFP::get(Context, APFloat(V));
llvm_unreachable("Can only constant fold float/double");
return 0; // dummy return to suppress warning
}
@@ -674,9 +674,9 @@
}
if (Ty == Type::FloatTy)
- return Context.getConstantFP(APFloat((float)V));
+ return ConstantFP::get(Context, APFloat((float)V));
if (Ty == Type::DoubleTy)
- return Context.getConstantFP(APFloat(V));
+ return ConstantFP::get(Context, APFloat(V));
llvm_unreachable("Can only constant fold float/double");
return 0; // dummy return to suppress warning
}
@@ -796,10 +796,10 @@
}
} else if (ConstantInt *Op2C = dyn_cast(Operands[1])) {
if (Name == "llvm.powi.f32") {
- return Context.getConstantFP(APFloat((float)std::pow((float)Op1V,
+ return ConstantFP::get(Context, APFloat((float)std::pow((float)Op1V,
(int)Op2C->getZExtValue())));
} else if (Name == "llvm.powi.f64") {
- return Context.getConstantFP(APFloat((double)std::pow((double)Op1V,
+ return ConstantFP::get(Context, APFloat((double)std::pow((double)Op1V,
(int)Op2C->getZExtValue())));
}
}
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jul 27 15:59:43 2009
@@ -2143,7 +2143,7 @@
ID.APFloatVal.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
&Ignored);
}
- V = Context.getConstantFP(ID.APFloatVal);
+ V = ConstantFP::get(Context, ID.APFloatVal);
if (V->getType() != Ty)
return Error(ID.Loc, "floating point constant does not have type '" +
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Jul 27 15:59:43 2009
@@ -896,19 +896,19 @@
if (Record.empty())
return Error("Invalid FLOAT record");
if (CurTy == Type::FloatTy)
- V = Context.getConstantFP(APFloat(APInt(32, (uint32_t)Record[0])));
+ V = ConstantFP::get(Context, APFloat(APInt(32, (uint32_t)Record[0])));
else if (CurTy == Type::DoubleTy)
- V = Context.getConstantFP(APFloat(APInt(64, Record[0])));
+ V = ConstantFP::get(Context, APFloat(APInt(64, Record[0])));
else if (CurTy == Type::X86_FP80Ty) {
// Bits are not stored the same way as a normal i80 APInt, compensate.
uint64_t Rearrange[2];
Rearrange[0] = (Record[1] & 0xffffLL) | (Record[0] << 16);
Rearrange[1] = Record[0] >> 48;
- V = Context.getConstantFP(APFloat(APInt(80, 2, Rearrange)));
+ V = ConstantFP::get(Context, APFloat(APInt(80, 2, Rearrange)));
} else if (CurTy == Type::FP128Ty)
- V = Context.getConstantFP(APFloat(APInt(128, 2, &Record[0]), true));
+ V = ConstantFP::get(Context, APFloat(APInt(128, 2, &Record[0]), true));
else if (CurTy == Type::PPC_FP128Ty)
- V = Context.getConstantFP(APFloat(APInt(128, 2, &Record[0])));
+ V = ConstantFP::get(Context, APFloat(APInt(128, 2, &Record[0])));
else
V = Context.getUndef(CurTy);
break;
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jul 27 15:59:43 2009
@@ -916,7 +916,7 @@
SDValue SelectionDAG::getConstantFP(const APFloat& V, MVT VT, bool isTarget) {
- return getConstantFP(*Context->getConstantFP(V), VT, isTarget);
+ return getConstantFP(*ConstantFP::get(*getContext(), V), VT, isTarget);
}
SDValue SelectionDAG::getConstantFP(const ConstantFP& V, MVT VT, bool isTarget){
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Jul 27 15:59:43 2009
@@ -2148,8 +2148,7 @@
const VectorType *DestTy = cast(I.getType());
const Type *ElTy = DestTy->getElementType();
unsigned VL = DestTy->getNumElements();
- std::vector NZ(VL,
- DAG.getContext()->getConstantFPNegativeZero(ElTy));
+ std::vector NZ(VL, ConstantFP::getNegativeZero(ElTy));
Constant *CNZ = DAG.getContext()->getConstantVector(&NZ[0], NZ.size());
if (CV == CNZ) {
SDValue Op2 = getValue(I.getOperand(1));
@@ -2160,8 +2159,7 @@
}
}
if (ConstantFP *CFP = dyn_cast(I.getOperand(0)))
- if (CFP->isExactlyValue(
- DAG.getContext()->getConstantFPNegativeZero(Ty)->getValueAPF())) {
+ if (CFP->isExactlyValue(ConstantFP::getNegativeZero(Ty)->getValueAPF())) {
SDValue Op2 = getValue(I.getOperand(1));
setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
Op2.getValueType(), Op2));
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Mon Jul 27 15:59:43 2009
@@ -490,15 +490,15 @@
C = ConstantInt::get(F->getContext(), AV.IntVal);
break;
case Type::FloatTyID:
- C = Context.getConstantFP(APFloat(AV.FloatVal));
+ C = ConstantFP::get(F->getContext(), APFloat(AV.FloatVal));
break;
case Type::DoubleTyID:
- C = Context.getConstantFP(APFloat(AV.DoubleVal));
+ C = ConstantFP::get(F->getContext(), APFloat(AV.DoubleVal));
break;
case Type::PPC_FP128TyID:
case Type::X86_FP80TyID:
case Type::FP128TyID:
- C = Context.getConstantFP(APFloat(AV.IntVal));
+ C = ConstantFP::get(F->getContext(), APFloat(AV.IntVal));
break;
case Type::PointerTyID:
void *ArgPtr = GVTOP(AV);
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jul 27 15:59:43 2009
@@ -4898,9 +4898,9 @@
std::vector CV1;
CV1.push_back(
- Context->getConstantFP(APFloat(APInt(64, 0x4530000000000000ULL))));
+ ConstantFP::get(*Context, APFloat(APInt(64, 0x4530000000000000ULL))));
CV1.push_back(
- Context->getConstantFP(APFloat(APInt(64, 0x4330000000000000ULL))));
+ ConstantFP::get(*Context, APFloat(APInt(64, 0x4330000000000000ULL))));
Constant *C1 = Context->getConstantVector(CV1);
SDValue CPIdx1 = DAG.getConstantPool(C1, getPointerTy(), 16);
@@ -5113,11 +5113,11 @@
EltVT = VT.getVectorElementType();
std::vector CV;
if (EltVT == MVT::f64) {
- Constant *C = Context->getConstantFP(APFloat(APInt(64, ~(1ULL << 63))));
+ Constant *C = ConstantFP::get(*Context, APFloat(APInt(64, ~(1ULL << 63))));
CV.push_back(C);
CV.push_back(C);
} else {
- Constant *C = Context->getConstantFP(APFloat(APInt(32, ~(1U << 31))));
+ Constant *C = ConstantFP::get(*Context, APFloat(APInt(32, ~(1U << 31))));
CV.push_back(C);
CV.push_back(C);
CV.push_back(C);
@@ -5143,11 +5143,11 @@
}
std::vector CV;
if (EltVT == MVT::f64) {
- Constant *C = Context->getConstantFP(APFloat(APInt(64, 1ULL << 63)));
+ Constant *C = ConstantFP::get(*Context, APFloat(APInt(64, 1ULL << 63)));
CV.push_back(C);
CV.push_back(C);
} else {
- Constant *C = Context->getConstantFP(APFloat(APInt(32, 1U << 31)));
+ Constant *C = ConstantFP::get(*Context, APFloat(APInt(32, 1U << 31)));
CV.push_back(C);
CV.push_back(C);
CV.push_back(C);
@@ -5194,13 +5194,13 @@
// First get the sign bit of second operand.
std::vector CV;
if (SrcVT == MVT::f64) {
- CV.push_back(Context->getConstantFP(APFloat(APInt(64, 1ULL << 63))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(64, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(64, 1ULL << 63))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(64, 0))));
} else {
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, 1U << 31))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, 0))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, 0))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, 1U << 31))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, 0))));
}
Constant *C = Context->getConstantVector(CV);
SDValue CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
@@ -5223,13 +5223,13 @@
// Clear first operand sign bit.
CV.clear();
if (VT == MVT::f64) {
- CV.push_back(Context->getConstantFP(APFloat(APInt(64, ~(1ULL << 63)))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(64, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(64, ~(1ULL << 63)))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(64, 0))));
} else {
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, ~(1U << 31)))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, 0))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, 0))));
- CV.push_back(Context->getConstantFP(APFloat(APInt(32, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, ~(1U << 31)))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, 0))));
+ CV.push_back(ConstantFP::get(*Context, APFloat(APInt(32, 0))));
}
C = Context->getConstantVector(CV);
CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jul 27 15:59:43 2009
@@ -2354,7 +2354,7 @@
if (Constant *RHSC = dyn_cast(RHS)) {
// X + 0 --> X
if (ConstantFP *CFP = dyn_cast(RHSC)) {
- if (CFP->isExactlyValue(Context->getConstantFPNegativeZero
+ if (CFP->isExactlyValue(ConstantFP::getNegativeZero
(I.getType())->getValueAPF()))
return ReplaceInstUsesWith(I, LHS);
}
@@ -8779,7 +8779,7 @@
APFloat F = CFP->getValueAPF();
(void)F.convert(Sem, APFloat::rmNearestTiesToEven, &losesInfo);
if (!losesInfo)
- return Context->getConstantFP(F);
+ return ConstantFP::get(*Context, F);
return 0;
}
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Jul 27 15:59:43 2009
@@ -2177,8 +2177,6 @@
if (isa(BackedgeTakenCount))
return;
- LLVMContext &Context = L->getHeader()->getContext();
-
for (unsigned Stride = 0, e = IU->StrideOrder.size(); Stride != e;
++Stride) {
std::map::iterator SI =
@@ -2240,7 +2238,7 @@
ConstantInt *Init = dyn_cast(PH->getIncomingValue(Entry));
if (!Init) continue;
- Constant *NewInit = Context.getConstantFP(DestTy, Init->getZExtValue());
+ Constant *NewInit = ConstantFP::get(DestTy, Init->getZExtValue());
BinaryOperator *Incr =
dyn_cast(PH->getIncomingValue(Latch));
@@ -2264,7 +2262,7 @@
PHINode *NewPH = PHINode::Create(DestTy, "IV.S.", PH);
/* create new increment. '++d' in above example. */
- Constant *CFP = Context.getConstantFP(DestTy, C->getZExtValue());
+ Constant *CFP = ConstantFP::get(DestTy, C->getZExtValue());
BinaryOperator *NewIncr =
BinaryOperator::Create(Incr->getOpcode() == Instruction::Add ?
Instruction::FAdd : Instruction::FSub,
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Mon Jul 27 15:59:43 2009
@@ -1035,7 +1035,7 @@
if (Op2C == 0) return 0;
if (Op2C->getValueAPF().isZero()) // pow(x, 0.0) -> 1.0
- return Context->getConstantFP(CI->getType(), 1.0);
+ return ConstantFP::get(CI->getType(), 1.0);
if (Op2C->isExactlyValue(0.5)) {
// FIXME: This is not safe for -0.0 and -inf. This can only be done when
@@ -1055,7 +1055,7 @@
if (Op2C->isExactlyValue(2.0)) // pow(x, 2.0) -> x*x
return B.CreateFMul(Op1, Op1, "pow2");
if (Op2C->isExactlyValue(-1.0)) // pow(x, -1.0) -> 1.0/x
- return B.CreateFDiv(Context->getConstantFP(CI->getType(), 1.0),
+ return B.CreateFDiv(ConstantFP::get(CI->getType(), 1.0),
Op1, "powrecip");
return 0;
}
@@ -1094,7 +1094,7 @@
else
Name = "ldexpl";
- Constant *One = Context->getConstantFP(APFloat(1.0f));
+ Constant *One = ConstantFP::get(*Context, APFloat(1.0f));
if (Op->getType() != Type::FloatTy)
One = Context->getConstantExprFPExtend(One, Op->getType());
Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/ConstantFold.cpp (original)
+++ llvm/trunk/lib/VMCore/ConstantFold.cpp Mon Jul 27 15:59:43 2009
@@ -161,7 +161,7 @@
return V;
if (DestTy->isFloatingPoint())
- return Context.getConstantFP(APFloat(CI->getValue(),
+ return ConstantFP::get(Context, APFloat(CI->getValue(),
DestTy != Type::PPC_FP128Ty));
// Otherwise, can't fold this (vector?)
@@ -245,7 +245,7 @@
DestTy == Type::FP128Ty ? APFloat::IEEEquad :
APFloat::Bogus,
APFloat::rmNearestTiesToEven, &ignored);
- return Context.getConstantFP(Val);
+ return ConstantFP::get(Context, Val);
}
return 0; // Can't fold.
case Instruction::FPToUI:
@@ -279,7 +279,7 @@
(void)apf.convertFromAPInt(api,
opc==Instruction::SIToFP,
APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(apf);
+ return ConstantFP::get(Context, apf);
}
return 0;
case Instruction::ZExt:
@@ -795,19 +795,19 @@
break;
case Instruction::FAdd:
(void)C3V.add(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FSub:
(void)C3V.subtract(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FMul:
(void)C3V.multiply(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FDiv:
(void)C3V.divide(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
case Instruction::FRem:
(void)C3V.mod(C2V, APFloat::rmNearestTiesToEven);
- return Context.getConstantFP(C3V);
+ return ConstantFP::get(Context, C3V);
}
}
} else if (const VectorType *VTy = dyn_cast(C1->getType())) {
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon Jul 27 15:59:43 2009
@@ -258,6 +258,87 @@
}
#endif
+/// get() - This returns a constant fp for the specified value in the
+/// specified type. This should only be used for simple constant values like
+/// 2.0/1.0 etc, that are known-valid both as double and as the target format.
+Constant* ConstantFP::get(const Type* Ty, double V) {
+ LLVMContext &Context = Ty->getContext();
+
+ APFloat FV(V);
+ bool ignored;
+ FV.convert(*TypeToFloatSemantics(Ty->getScalarType()),
+ APFloat::rmNearestTiesToEven, &ignored);
+ Constant *C = get(Context, FV);
+
+ // For vectors, broadcast the value.
+ if (const VectorType *VTy = dyn_cast(Ty))
+ return Context.getConstantVector(
+ std::vector(VTy->getNumElements(), C));
+
+ return C;
+}
+
+ConstantFP* ConstantFP::getNegativeZero(const Type* Ty) {
+ LLVMContext &Context = Ty->getContext();
+ APFloat apf = cast (Context.getNullValue(Ty))->getValueAPF();
+ apf.changeSign();
+ return get(Context, apf);
+}
+
+
+Constant* ConstantFP::getZeroValueForNegation(const Type* Ty) {
+ LLVMContext &Context = Ty->getContext();
+ if (const VectorType *PTy = dyn_cast(Ty))
+ if (PTy->getElementType()->isFloatingPoint()) {
+ std::vector zeros(PTy->getNumElements(),
+ getNegativeZero(PTy->getElementType()));
+ return Context.getConstantVector(PTy, zeros);
+ }
+
+ if (Ty->isFloatingPoint())
+ return getNegativeZero(Ty);
+
+ return Context.getNullValue(Ty);
+}
+
+
+// ConstantFP accessors.
+ConstantFP* ConstantFP::get(LLVMContext &Context, const APFloat& V) {
+ DenseMapAPFloatKeyInfo::KeyTy Key(V);
+
+ LLVMContextImpl* pImpl = Context.pImpl;
+
+ pImpl->ConstantsLock.reader_acquire();
+ ConstantFP *&Slot = pImpl->FPConstants[Key];
+ pImpl->ConstantsLock.reader_release();
+
+ if (!Slot) {
+ sys::SmartScopedWriter Writer(pImpl->ConstantsLock);
+ ConstantFP *&NewSlot = pImpl->FPConstants[Key];
+ if (!NewSlot) {
+ const Type *Ty;
+ if (&V.getSemantics() == &APFloat::IEEEsingle)
+ Ty = Type::FloatTy;
+ else if (&V.getSemantics() == &APFloat::IEEEdouble)
+ Ty = Type::DoubleTy;
+ else if (&V.getSemantics() == &APFloat::x87DoubleExtended)
+ Ty = Type::X86_FP80Ty;
+ else if (&V.getSemantics() == &APFloat::IEEEquad)
+ Ty = Type::FP128Ty;
+ else {
+ assert(&V.getSemantics() == &APFloat::PPCDoubleDouble &&
+ "Unknown FP format");
+ Ty = Type::PPC_FP128Ty;
+ }
+ NewSlot = new ConstantFP(Ty, V);
+ }
+
+ return NewSlot;
+ }
+
+ return Slot;
+}
+
ConstantFP::ConstantFP(const Type *Ty, const APFloat& V)
: Constant(Ty, ConstantFPVal, 0, 0), Val(V) {
assert(&V.getSemantics() == TypeToFloatSemantics(Ty) &&
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Mon Jul 27 15:59:43 2009
@@ -388,11 +388,11 @@
bool ignored;
APN.convert(SemanticsForType(unwrap(RealTy)), APFloat::rmNearestTiesToEven,
&ignored);
- return wrap(getGlobalContext().getConstantFP(APN));
+ return wrap(ConstantFP::get(getGlobalContext(), APN));
}
LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text) {
- return wrap(getGlobalContext().getConstantFP(
+ return wrap(ConstantFP::get(getGlobalContext(),
APFloat(SemanticsForType(unwrap(RealTy)), Text)));
}
Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Mon Jul 27 15:59:43 2009
@@ -1577,7 +1577,7 @@
BinaryOperator *BinaryOperator::CreateNeg(LLVMContext &Context,
Value *Op, const Twine &Name,
Instruction *InsertBefore) {
- Value *zero = Context.getZeroValueForNegation(Op->getType());
+ Value *zero = ConstantFP::getZeroValueForNegation(Op->getType());
return new BinaryOperator(Instruction::Sub,
zero, Op,
Op->getType(), Name, InsertBefore);
@@ -1586,7 +1586,7 @@
BinaryOperator *BinaryOperator::CreateNeg(LLVMContext &Context,
Value *Op, const Twine &Name,
BasicBlock *InsertAtEnd) {
- Value *zero = Context.getZeroValueForNegation(Op->getType());
+ Value *zero = ConstantFP::getZeroValueForNegation(Op->getType());
return new BinaryOperator(Instruction::Sub,
zero, Op,
Op->getType(), Name, InsertAtEnd);
@@ -1595,7 +1595,7 @@
BinaryOperator *BinaryOperator::CreateFNeg(LLVMContext &Context,
Value *Op, const Twine &Name,
Instruction *InsertBefore) {
- Value *zero = Context.getZeroValueForNegation(Op->getType());
+ Value *zero = ConstantFP::getZeroValueForNegation(Op->getType());
return new BinaryOperator(Instruction::FSub,
zero, Op,
Op->getType(), Name, InsertBefore);
@@ -1604,7 +1604,7 @@
BinaryOperator *BinaryOperator::CreateFNeg(LLVMContext &Context,
Value *Op, const Twine &Name,
BasicBlock *InsertAtEnd) {
- Value *zero = Context.getZeroValueForNegation(Op->getType());
+ Value *zero = ConstantFP::getZeroValueForNegation(Op->getType());
return new BinaryOperator(Instruction::FSub,
zero, Op,
Op->getType(), Name, InsertAtEnd);
Modified: llvm/trunk/lib/VMCore/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContext.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContext.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContext.cpp Mon Jul 27 15:59:43 2009
@@ -41,15 +41,16 @@
case Type::IntegerTyID:
return ConstantInt::get(Ty, 0);
case Type::FloatTyID:
- return getConstantFP(APFloat(APInt(32, 0)));
+ return ConstantFP::get(Ty->getContext(), APFloat(APInt(32, 0)));
case Type::DoubleTyID:
- return getConstantFP(APFloat(APInt(64, 0)));
+ return ConstantFP::get(Ty->getContext(), APFloat(APInt(64, 0)));
case Type::X86_FP80TyID:
- return getConstantFP(APFloat(APInt(80, 2, zero)));
+ return ConstantFP::get(Ty->getContext(), APFloat(APInt(80, 2, zero)));
case Type::FP128TyID:
- return getConstantFP(APFloat(APInt(128, 2, zero), true));
+ return ConstantFP::get(Ty->getContext(),
+ APFloat(APInt(128, 2, zero), true));
case Type::PPC_FP128TyID:
- return getConstantFP(APFloat(APInt(128, 2, zero)));
+ return ConstantFP::get(Ty->getContext(), APFloat(APInt(128, 2, zero)));
case Type::PointerTyID:
return getConstantPointerNull(cast(Ty));
case Type::StructTyID:
@@ -276,7 +277,7 @@
assert(C->getType()->isIntOrIntVector() &&
"Cannot NEG a nonintegral value!");
return getConstantExpr(Instruction::Sub,
- getZeroValueForNegation(C->getType()),
+ ConstantFP::getZeroValueForNegation(C->getType()),
C);
}
@@ -284,7 +285,7 @@
assert(C->getType()->isFPOrFPVector() &&
"Cannot FNEG a non-floating-point value!");
return getConstantExpr(Instruction::FSub,
- getZeroValueForNegation(C->getType()),
+ ConstantFP::getZeroValueForNegation(C->getType()),
C);
}
@@ -424,65 +425,6 @@
return getConstantExprCast(Instruction::PtrToInt, GEP, Type::Int64Ty);
}
-Constant* LLVMContext::getZeroValueForNegation(const Type* Ty) {
- if (const VectorType *PTy = dyn_cast(Ty))
- if (PTy->getElementType()->isFloatingPoint()) {
- std::vector zeros(PTy->getNumElements(),
- getConstantFPNegativeZero(PTy->getElementType()));
- return getConstantVector(PTy, zeros);
- }
-
- if (Ty->isFloatingPoint())
- return getConstantFPNegativeZero(Ty);
-
- return getNullValue(Ty);
-}
-
-
-// ConstantFP accessors.
-ConstantFP* LLVMContext::getConstantFP(const APFloat& V) {
- return pImpl->getConstantFP(V);
-}
-
-static const fltSemantics *TypeToFloatSemantics(const Type *Ty) {
- if (Ty == Type::FloatTy)
- return &APFloat::IEEEsingle;
- if (Ty == Type::DoubleTy)
- return &APFloat::IEEEdouble;
- if (Ty == Type::X86_FP80Ty)
- return &APFloat::x87DoubleExtended;
- else if (Ty == Type::FP128Ty)
- return &APFloat::IEEEquad;
-
- assert(Ty == Type::PPC_FP128Ty && "Unknown FP format");
- return &APFloat::PPCDoubleDouble;
-}
-
-/// get() - This returns a constant fp for the specified value in the
-/// specified type. This should only be used for simple constant values like
-/// 2.0/1.0 etc, that are known-valid both as double and as the target format.
-Constant* LLVMContext::getConstantFP(const Type* Ty, double V) {
- APFloat FV(V);
- bool ignored;
- FV.convert(*TypeToFloatSemantics(Ty->getScalarType()),
- APFloat::rmNearestTiesToEven, &ignored);
- Constant *C = getConstantFP(FV);
-
- // For vectors, broadcast the value.
- if (const VectorType *VTy = dyn_cast(Ty))
- return
- getConstantVector(std::vector(VTy->getNumElements(), C));
-
- return C;
-}
-
-ConstantFP* LLVMContext::getConstantFPNegativeZero(const Type* Ty) {
- APFloat apf = cast (getNullValue(Ty))->getValueAPF();
- apf.changeSign();
- return getConstantFP(apf);
-}
-
-
// ConstantVector accessors.
Constant* LLVMContext::getConstantVector(const VectorType* T,
const std::vector& V) {
Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.cpp?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.cpp Mon Jul 27 15:59:43 2009
@@ -49,41 +49,6 @@
LLVMContextImpl::LLVMContextImpl(LLVMContext &C) :
Context(C), TheTrueVal(0), TheFalseVal(0) { }
-
-ConstantFP *LLVMContextImpl::getConstantFP(const APFloat &V) {
- DenseMapAPFloatKeyInfo::KeyTy Key(V);
-
- ConstantsLock.reader_acquire();
- ConstantFP *&Slot = FPConstants[Key];
- ConstantsLock.reader_release();
-
- if (!Slot) {
- sys::SmartScopedWriter Writer(ConstantsLock);
- ConstantFP *&NewSlot = FPConstants[Key];
- if (!NewSlot) {
- const Type *Ty;
- if (&V.getSemantics() == &APFloat::IEEEsingle)
- Ty = Type::FloatTy;
- else if (&V.getSemantics() == &APFloat::IEEEdouble)
- Ty = Type::DoubleTy;
- else if (&V.getSemantics() == &APFloat::x87DoubleExtended)
- Ty = Type::X86_FP80Ty;
- else if (&V.getSemantics() == &APFloat::IEEEquad)
- Ty = Type::FP128Ty;
- else {
- assert(&V.getSemantics() == &APFloat::PPCDoubleDouble &&
- "Unknown FP format");
- Ty = Type::PPC_FP128Ty;
- }
- NewSlot = new ConstantFP(Ty, V);
- }
-
- return NewSlot;
- }
-
- return Slot;
-}
-
MDString *LLVMContextImpl::getMDString(const char *StrBegin,
unsigned StrLength) {
sys::SmartScopedWriter Writer(ConstantsLock);
Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.h?rev=77247&r1=77246&r2=77247&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.h Mon Jul 27 15:59:43 2009
@@ -457,11 +457,10 @@
LLVMContextImpl(const LLVMContextImpl&);
friend class ConstantInt;
+ friend class ConstantFP;
public:
LLVMContextImpl(LLVMContext &C);
- ConstantFP *getConstantFP(const APFloat &V);
-
MDString *getMDString(const char *StrBegin, unsigned StrLength);
MDNode *getMDNode(Value*const* Vals, unsigned NumVals);
From resistor at mac.com Mon Jul 27 16:00:36 2009
From: resistor at mac.com (Owen Anderson)
Date: Mon, 27 Jul 2009 21:00:36 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77248 - in /llvm-gcc-4.2/trunk:
boehm-gc/cord/de_win.h gcc/llvm-convert.cpp
Message-ID: <200907272100.n6RL0aVM021385@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Jul 27 16:00:35 2009
New Revision: 77248
URL: http://llvm.org/viewvc/llvm-project?rev=77248&view=rev
Log:
Update for LLVM API change.
Modified:
llvm-gcc-4.2/trunk/boehm-gc/cord/de_win.h
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/boehm-gc/cord/de_win.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/boehm-gc/cord/de_win.h?rev=77248&r1=77247&r2=77248&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/boehm-gc/cord/de_win.h (original)
+++ llvm-gcc-4.2/trunk/boehm-gc/cord/de_win.h Mon Jul 27 16:00:35 2009
@@ -100,4 +100,4 @@
/* Invalidate line i on the screen. */
void de_error(char *s);
- /* Display error message. */
\ No newline at end of file
+ /* Display error message. */
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=77248&r1=77247&r2=77248&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 27 16:00:35 2009
@@ -7013,7 +7013,8 @@
std::swap(UArr[0], UArr[1]);
return
- Context.getConstantFP(Ty==Type::FloatTy ? APFloat((float)V) : APFloat(V));
+ ConstantFP::get(Context, Ty==Type::FloatTy ?
+ APFloat((float)V) : APFloat(V));
} else if (Ty==Type::X86_FP80Ty) {
long RealArr[4];
uint64_t UArr[2];
@@ -7021,7 +7022,7 @@
UArr[0] = ((uint64_t)((uint32_t)RealArr[0])) |
((uint64_t)((uint32_t)RealArr[1]) << 32);
UArr[1] = (uint16_t)RealArr[2];
- return Context.getConstantFP(APFloat(APInt(80, 2, UArr)));
+ return ConstantFP::get(Context, APFloat(APInt(80, 2, UArr)));
} else if (Ty==Type::PPC_FP128Ty) {
long RealArr[4];
uint64_t UArr[2];
@@ -7031,7 +7032,7 @@
((uint64_t)((uint32_t)RealArr[1]));
UArr[1] = ((uint64_t)((uint32_t)RealArr[2]) << 32) |
((uint64_t)((uint32_t)RealArr[3]));
- return Context.getConstantFP(APFloat(APInt(128, 2, UArr)));
+ return ConstantFP::get(Context, APFloat(APInt(128, 2, UArr)));
}
assert(0 && "Floating point type not handled yet");
return 0; // outwit compiler warning
From gohman at apple.com Mon Jul 27 16:07:16 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 14:07:16 -0700
Subject: [llvm-commits] [llvm] r77149 - /llvm/trunk/lib/VMCore/Value.cpp
In-Reply-To: <200907260922.n6Q9MMQX020945@zion.cs.uiuc.edu>
References: <200907260922.n6Q9MMQX020945@zion.cs.uiuc.edu>
Message-ID: <1531E511-8F9B-49B7-98A1-6C46B17930B5@apple.com>
On Jul 26, 2009, at 2:22 AM, Daniel Dunbar wrote:
> Author: ddunbar
> Date: Sun Jul 26 04:22:02 2009
> New Revision: 77149
>
> URL: http://llvm.org/viewvc/llvm-project?rev=77149&view=rev
> Log:
> Make sure getName().data() is always null terminated.
Hi Daniel,
The doxygen comment for StringRef::data() says it may not be null
terminated. This is also consistent with std::string. If there are
clients that need a nul-terminated string, shouldn't there be a
c_str() method?
Dan
From sabre at nondot.org Mon Jul 27 16:13:35 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 21:13:35 -0000
Subject: [llvm-commits] [llvm] r77250 -
/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
Message-ID: <200907272113.n6RLDZVY021731@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 16:13:35 2009
New Revision: 77250
URL: http://llvm.org/viewvc/llvm-project?rev=77250&view=rev
Log:
simplify #includes.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=77250&r1=77249&r2=77250&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Mon Jul 27 16:13:35 2009
@@ -16,11 +16,9 @@
#ifndef LLVM_CODEGEN_ASMPRINTER_H
#define LLVM_CODEGEN_ASMPRINTER_H
-#include "llvm/ADT/DenseMap.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Support/DataTypes.h"
#include "llvm/Target/TargetMachine.h"
-#include
+#include "llvm/ADT/DenseMap.h"
namespace llvm {
class GCStrategy;
From daniel at zuster.org Mon Jul 27 16:22:31 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 27 Jul 2009 21:22:31 -0000
Subject: [llvm-commits] [llvm] r77251 - in /llvm/trunk:
include/llvm/MC/MCContext.h include/llvm/MC/MCSection.h
include/llvm/MC/MCSymbol.h lib/MC/MCContext.cpp
Message-ID: <200907272122.n6RLMVQo022007@zion.cs.uiuc.edu>
Author: ddunbar
Date: Mon Jul 27 16:22:30 2009
New Revision: 77251
URL: http://llvm.org/viewvc/llvm-project?rev=77251&view=rev
Log:
Move MCContext and friends to StringRef based APIs.
Modified:
llvm/trunk/include/llvm/MC/MCContext.h
llvm/trunk/include/llvm/MC/MCSection.h
llvm/trunk/include/llvm/MC/MCSymbol.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=77251&r1=77250&r2=77251&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCContext.h (original)
+++ llvm/trunk/include/llvm/MC/MCContext.h Mon Jul 27 16:22:30 2009
@@ -18,6 +18,7 @@
class MCValue;
class MCSection;
class MCSymbol;
+ class StringRef;
/// MCContext - Context object for machine code objects.
class MCContext {
@@ -46,19 +47,19 @@
~MCContext();
/// GetSection - Get or create a new section with the given @param Name.
- MCSection *GetSection(const char *Name);
+ MCSection *GetSection(const StringRef &Name);
/// CreateSymbol - Create a new symbol with the specified @param Name.
///
/// @param Name - The symbol name, which must be unique across all symbols.
- MCSymbol *CreateSymbol(const char *Name);
+ MCSymbol *CreateSymbol(const StringRef &Name);
/// GetOrCreateSymbol - Lookup the symbol inside with the specified
/// @param Name. If it exists, return it. If not, create a forward
/// reference and return it.
///
/// @param Name - The symbol name, which must be unique across all symbols.
- MCSymbol *GetOrCreateSymbol(const char *Name);
+ MCSymbol *GetOrCreateSymbol(const StringRef &Name);
/// CreateTemporarySymbol - Create a new temporary symbol with the specified
/// @param Name.
@@ -66,10 +67,10 @@
/// @param Name - The symbol name, for debugging purposes only, temporary
/// symbols do not surive assembly. If non-empty the name must be unique
/// across all symbols.
- MCSymbol *CreateTemporarySymbol(const char *Name = "");
+ MCSymbol *CreateTemporarySymbol(const StringRef &Name = "");
/// LookupSymbol - Get the symbol for @param Name, or null.
- MCSymbol *LookupSymbol(const char *Name) const;
+ MCSymbol *LookupSymbol(const StringRef &Name) const;
/// ClearSymbolValue - Erase a value binding for @param Symbol, if one
/// exists.
Modified: llvm/trunk/include/llvm/MC/MCSection.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSection.h?rev=77251&r1=77250&r2=77251&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSection.h (original)
+++ llvm/trunk/include/llvm/MC/MCSection.h Mon Jul 27 16:22:30 2009
@@ -15,6 +15,7 @@
#define LLVM_MC_MCSECTION_H
#include
+#include "llvm/ADT/StringRef.h"
namespace llvm {
@@ -25,7 +26,7 @@
std::string Name;
private:
friend class MCContext;
- MCSection(const char *_Name) : Name(_Name) {}
+ MCSection(const StringRef &_Name) : Name(_Name) {}
MCSection(const MCSection&); // DO NOT IMPLEMENT
void operator=(const MCSection&); // DO NOT IMPLEMENT
Modified: llvm/trunk/include/llvm/MC/MCSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=77251&r1=77250&r2=77251&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSymbol.h (original)
+++ llvm/trunk/include/llvm/MC/MCSymbol.h Mon Jul 27 16:22:30 2009
@@ -15,6 +15,7 @@
#define LLVM_MC_MCSYMBOL_H
#include
+#include "llvm/ADT/StringRef.h"
namespace llvm {
class MCSection;
@@ -46,7 +47,7 @@
private: // MCContext creates and uniques these.
friend class MCContext;
- MCSymbol(const char *_Name, bool _IsTemporary)
+ MCSymbol(const StringRef &_Name, bool _IsTemporary)
: Name(_Name), Section(0), IsTemporary(_IsTemporary), IsExternal(false) {}
MCSymbol(const MCSymbol&); // DO NOT IMPLEMENT
Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=77251&r1=77250&r2=77251&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Mon Jul 27 16:22:30 2009
@@ -21,7 +21,7 @@
MCContext::~MCContext() {
}
-MCSection *MCContext::GetSection(const char *Name) {
+MCSection *MCContext::GetSection(const StringRef &Name) {
MCSection *&Entry = Sections[Name];
if (!Entry)
@@ -30,7 +30,7 @@
return Entry;
}
-MCSymbol *MCContext::CreateSymbol(const char *Name) {
+MCSymbol *MCContext::CreateSymbol(const StringRef &Name) {
assert(Name[0] != '\0' && "Normal symbols cannot be unnamed!");
// Create and bind the symbol, and ensure that names are unique.
@@ -39,7 +39,7 @@
return Entry = new (*this) MCSymbol(Name, false);
}
-MCSymbol *MCContext::GetOrCreateSymbol(const char *Name) {
+MCSymbol *MCContext::GetOrCreateSymbol(const StringRef &Name) {
MCSymbol *&Entry = Symbols[Name];
if (Entry) return Entry;
@@ -47,9 +47,9 @@
}
-MCSymbol *MCContext::CreateTemporarySymbol(const char *Name) {
+MCSymbol *MCContext::CreateTemporarySymbol(const StringRef &Name) {
// If unnamed, just create a symbol.
- if (Name[0] == '\0')
+ if (Name.empty())
new (*this) MCSymbol("", true);
// Otherwise create as usual.
@@ -58,7 +58,7 @@
return Entry = new (*this) MCSymbol(Name, true);
}
-MCSymbol *MCContext::LookupSymbol(const char *Name) const {
+MCSymbol *MCContext::LookupSymbol(const StringRef &Name) const {
return Symbols.lookup(Name);
}
From sabre at nondot.org Mon Jul 27 16:28:04 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 27 Jul 2009 21:28:04 -0000
Subject: [llvm-commits] [llvm] r77252 - in /llvm/trunk:
include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
Message-ID: <200907272128.n6RLS4Ow022173@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 16:28:04 2009
New Revision: 77252
URL: http://llvm.org/viewvc/llvm-project?rev=77252&view=rev
Log:
hoist MCContext/MCStreamer up to AsmPrinter since we're going to start creating
MCSections soon instead of Section for all targets, and we need something to
own them.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=77252&r1=77251&r2=77252&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Mon Jul 27 16:28:04 2009
@@ -33,6 +33,8 @@
class MachineConstantPoolValue;
class MachineModuleInfo;
class MCInst;
+ class MCContext;
+ class MCStreamer;
class DwarfWriter;
class Mangler;
class Section;
@@ -81,6 +83,17 @@
///
const TargetRegisterInfo *TRI;
+ /// OutContext - This is the context for the output file that we are
+ /// streaming. This owns all of the global MC-related objects for the
+ /// generated translation unit.
+ MCContext &OutContext;
+
+ /// OutStreamer - This is the MCStreamer object for the file we are
+ /// generating. This contains the transient state for the current
+ /// translation unit that we are generating (such as the current section
+ /// etc).
+ MCStreamer &OutStreamer;
+
/// The current machine function.
const MachineFunction *MF;
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=77252&r1=77251&r2=77252&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Jul 27 16:28:04 2009
@@ -22,6 +22,8 @@
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Analysis/DebugInfo.h"
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
@@ -47,6 +49,10 @@
const TargetAsmInfo *T, bool VDef)
: MachineFunctionPass(&ID), FunctionNumber(0), O(o),
TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
+
+ OutContext(*new MCContext()),
+ OutStreamer(*createAsmStreamer(OutContext, O)),
+
IsInTextSection(false), LastMI(0), LastFn(0), Counter(~0U),
PrevDLT(0, ~0U, ~0U) {
DW = 0; MMI = 0;
@@ -61,6 +67,9 @@
for (gcp_iterator I = GCMetadataPrinters.begin(),
E = GCMetadataPrinters.end(); I != E; ++I)
delete I->second;
+
+ delete &OutStreamer;
+ delete &OutContext;
}
/// SwitchToTextSection - Switch to the specified text section of the executable
@@ -270,6 +279,8 @@
delete Mang; Mang = 0;
DW = 0; MMI = 0;
+
+ OutStreamer.Finish();
return false;
}
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=77252&r1=77251&r2=77252&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Jul 27 16:28:04 2009
@@ -751,18 +751,6 @@
printInstruction(MI);
}
-/// doInitialization
-bool X86ATTAsmPrinter::doInitialization(Module &M) {
- if (NewAsmPrinter) {
- Context = new MCContext();
- // FIXME: Send this to "O" instead of outs(). For now, we force it to
- // stdout to make it easy to compare.
- Streamer = createAsmStreamer(*Context, outs());
- }
-
- return AsmPrinter::doInitialization(M);
-}
-
void X86ATTAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
const TargetData *TD = TM.getTargetData();
@@ -988,18 +976,7 @@
}
// Do common shutdown.
- bool Changed = AsmPrinter::doFinalization(M);
-
- if (NewAsmPrinter) {
- Streamer->Finish();
-
- delete Streamer;
- delete Context;
- Streamer = 0;
- Context = 0;
- }
-
- return Changed;
+ return AsmPrinter::doFinalization(M);
}
// Include the auto-generated portion of the assembly writer.
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h?rev=77252&r1=77251&r2=77252&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Mon Jul 27 16:28:04 2009
@@ -33,16 +33,11 @@
class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
const X86Subtarget *Subtarget;
-
- MCContext *Context;
- MCStreamer *Streamer;
public:
explicit X86ATTAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
const TargetAsmInfo *T, bool V)
: AsmPrinter(O, TM, T, V) {
Subtarget = &TM.getSubtarget();
- Context = 0;
- Streamer = 0;
}
virtual const char *getPassName() const {
@@ -60,7 +55,6 @@
AsmPrinter::getAnalysisUsage(AU);
}
- bool doInitialization(Module &M);
bool doFinalization(Module &M);
/// printInstruction - This method is automatically generated by tablegen
From gohman at apple.com Mon Jul 27 16:46:02 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 21:46:02 -0000
Subject: [llvm-commits] [llvm] r77255 - in /llvm/trunk:
include/llvm/Support/raw_ostream.h lib/Support/raw_ostream.cpp
Message-ID: <200907272146.n6RLk2mV022803@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 16:46:02 2009
New Revision: 77255
URL: http://llvm.org/viewvc/llvm-project?rev=77255&view=rev
Log:
Make raw_null_ostream flush its buffer in its destructor, so that
it conforms to the assertion added in r77245. This fixes a failure
in qa_override.c in clang's testsuite.
Modified:
llvm/trunk/include/llvm/Support/raw_ostream.h
llvm/trunk/lib/Support/raw_ostream.cpp
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=77255&r1=77254&r2=77255&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/raw_ostream.h (original)
+++ llvm/trunk/include/llvm/Support/raw_ostream.h Mon Jul 27 16:46:02 2009
@@ -420,6 +420,7 @@
public:
explicit raw_null_ostream() {}
+ ~raw_null_ostream();
};
} // end llvm namespace
Modified: llvm/trunk/lib/Support/raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=77255&r1=77254&r2=77255&view=diff
==============================================================================
--- llvm/trunk/lib/Support/raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/raw_ostream.cpp Mon Jul 27 16:46:02 2009
@@ -438,6 +438,15 @@
// raw_null_ostream
//===----------------------------------------------------------------------===//
+raw_null_ostream::~raw_null_ostream() {
+#ifndef NDEBUG
+ // ~raw_ostream asserts that the buffer is empty. This isn't necessary
+ // with raw_null_ostream, but it's better to have raw_null_ostream follow
+ // the rules than to change the rules just for raw_null_ostream.
+ flush();
+#endif
+}
+
void raw_null_ostream::write_impl(const char *Ptr, size_t Size) {
}
From daniel at zuster.org Mon Jul 27 16:47:07 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 27 Jul 2009 21:47:07 -0000
Subject: [llvm-commits] [llvm] r77256 - /llvm/trunk/lib/VMCore/Constants.cpp
Message-ID: <200907272147.n6RLl7JC022842@zion.cs.uiuc.edu>
Author: ddunbar
Date: Mon Jul 27 16:47:07 2009
New Revision: 77256
URL: http://llvm.org/viewvc/llvm-project?rev=77256&view=rev
Log:
Unbreak build.
Modified:
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=77256&r1=77255&r2=77256&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon Jul 27 16:47:07 2009
@@ -242,7 +242,6 @@
// ConstantFP
//===----------------------------------------------------------------------===//
-#ifndef NDEBUG
static const fltSemantics *TypeToFloatSemantics(const Type *Ty) {
if (Ty == Type::FloatTy)
return &APFloat::IEEEsingle;
@@ -256,7 +255,6 @@
assert(Ty == Type::PPC_FP128Ty && "Unknown FP format");
return &APFloat::PPCDoubleDouble;
}
-#endif
/// get() - This returns a constant fp for the specified value in the
/// specified type. This should only be used for simple constant values like
From gohman at apple.com Mon Jul 27 16:49:34 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 21:49:34 -0000
Subject: [llvm-commits] [llvm] r77257 - /llvm/trunk/include/llvm/Operator.h
Message-ID: <200907272149.n6RLnZ41022923@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 16:49:34 2009
New Revision: 77257
URL: http://llvm.org/viewvc/llvm-project?rev=77257&view=rev
Log:
Order unsigned before signed, for consistency.
Modified:
llvm/trunk/include/llvm/Operator.h
Modified: llvm/trunk/include/llvm/Operator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Operator.h?rev=77257&r1=77256&r2=77257&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Operator.h (original)
+++ llvm/trunk/include/llvm/Operator.h Mon Jul 27 16:49:34 2009
@@ -66,21 +66,21 @@
///
class OverflowingBinaryOperator : public Operator {
public:
- /// hasNoSignedOverflow - Test whether this operation is known to never
- /// undergo signed overflow.
- bool hasNoSignedOverflow() const {
+ /// hasNoUnsignedOverflow - Test whether this operation is known to never
+ /// undergo unsigned overflow.
+ bool hasNoUnsignedOverflow() const {
return SubclassOptionalData & (1 << 0);
}
- void setHasNoSignedOverflow(bool B) {
+ void setHasNoUnsignedOverflow(bool B) {
SubclassOptionalData = (SubclassOptionalData & ~(1 << 0)) | (B << 0);
}
- /// hasNoUnsignedOverflow - Test whether this operation is known to never
- /// undergo unsigned overflow.
- bool hasNoUnsignedOverflow() const {
+ /// hasNoSignedOverflow - Test whether this operation is known to never
+ /// undergo signed overflow.
+ bool hasNoSignedOverflow() const {
return SubclassOptionalData & (1 << 1);
}
- void setHasNoUnsignedOverflow(bool B) {
+ void setHasNoSignedOverflow(bool B) {
SubclassOptionalData = (SubclassOptionalData & ~(1 << 1)) | (B << 1);
}
From daniel at zuster.org Mon Jul 27 16:49:56 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 27 Jul 2009 21:49:56 -0000
Subject: [llvm-commits] [llvm] r77258 - in /llvm/trunk:
include/llvm/MC/MCStreamer.h include/llvm/Target/TargetAsmParser.h
lib/MC/MCAsmStreamer.cpp lib/Target/X86/AsmParser/X86AsmParser.cpp
tools/llvm-mc/AsmLexer.h tools/llvm-mc/AsmParser.cpp
tools/llvm-mc/AsmParser.h tools/llvm-mc/MC-X86Specific.cpp
Message-ID: <200907272149.n6RLnvuP022948@zion.cs.uiuc.edu>
Author: ddunbar
Date: Mon Jul 27 16:49:56 2009
New Revision: 77258
URL: http://llvm.org/viewvc/llvm-project?rev=77258&view=rev
Log:
llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.
- My DFS traversal of LLVM is, at least for now, nearly complete! :)
Modified:
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/include/llvm/Target/TargetAsmParser.h
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/trunk/tools/llvm-mc/AsmLexer.h
llvm/trunk/tools/llvm-mc/AsmParser.cpp
llvm/trunk/tools/llvm-mc/AsmParser.h
llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Mon Jul 27 16:49:56 2009
@@ -22,6 +22,7 @@
class MCInst;
class MCSection;
class MCSymbol;
+ class StringRef;
class raw_ostream;
/// MCStreamer - Streaming machine code generation interface. This interface
@@ -166,12 +167,11 @@
/// @name Generating Data
/// @{
- /// EmitBytes - Emit @param Length bytes starting at @param Data into the
- /// output.
+ /// EmitBytes - Emit the bytes in @param Data into the output.
///
/// This is used to implement assembler directives such as .byte, .ascii,
/// etc.
- virtual void EmitBytes(const char *Data, unsigned Length) = 0;
+ virtual void EmitBytes(const StringRef &Data) = 0;
/// EmitValue - Emit the expression @param Value into the output as a native
/// integer of the given @param Size bytes.
Modified: llvm/trunk/include/llvm/Target/TargetAsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmParser.h?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmParser.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmParser.h Mon Jul 27 16:49:56 2009
@@ -13,6 +13,7 @@
namespace llvm {
class MCAsmParser;
class MCInst;
+class StringRef;
class Target;
/// TargetAsmParser - Generic interface to target specific assembly parsers.
@@ -42,7 +43,7 @@
/// \param Name - The instruction name.
/// \param Inst [out] - On success, the parsed instruction.
/// \return True on failure.
- virtual bool ParseInstruction(MCAsmParser &AP, const char *Name,
+ virtual bool ParseInstruction(MCAsmParser &AP, const StringRef &Name,
MCInst &Inst) = 0;
};
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Mon Jul 27 16:49:56 2009
@@ -57,7 +57,7 @@
virtual void AbortAssembly(const char *AbortReason = NULL);
- virtual void EmitBytes(const char *Data, unsigned Length);
+ virtual void EmitBytes(const StringRef &Data);
virtual void EmitValue(const MCValue &Value, unsigned Size);
@@ -208,9 +208,9 @@
OS << '\n';
}
-void MCAsmStreamer::EmitBytes(const char *Data, unsigned Length) {
+void MCAsmStreamer::EmitBytes(const StringRef &Data) {
assert(CurSection && "Cannot emit contents before setting section!");
- for (unsigned i = 0; i != Length; ++i)
+ for (unsigned i = 0, e = Data.size(); i != e; ++i)
OS << ".byte " << (unsigned) Data[i] << '\n';
}
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Jul 27 16:49:56 2009
@@ -21,14 +21,14 @@
class X86ATTAsmParser : public TargetAsmParser {
bool ParseOperand(X86Operand &Op);
- bool MatchInstruction(const char *Name,
+ bool MatchInstruction(const StringRef &Name,
llvm::SmallVector &Operands,
MCInst &Inst);
public:
explicit X86ATTAsmParser(const Target &);
- virtual bool ParseInstruction(MCAsmParser &AP, const char *Name,
+ virtual bool ParseInstruction(MCAsmParser &AP, const StringRef &Name,
MCInst &Inst);
};
}
@@ -43,13 +43,13 @@
}
bool
-X86ATTAsmParser::MatchInstruction(const char *Name,
+X86ATTAsmParser::MatchInstruction(const StringRef &Name,
llvm::SmallVector &Operands,
MCInst &Inst) {
return false;
}
-bool X86ATTAsmParser::ParseInstruction(MCAsmParser &AP, const char *Name,
+bool X86ATTAsmParser::ParseInstruction(MCAsmParser &AP, const StringRef &Name,
MCInst &Inst) {
llvm::SmallVector Operands;
Modified: llvm/trunk/tools/llvm-mc/AsmLexer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmLexer.h?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmLexer.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmLexer.h Mon Jul 27 16:49:56 2009
@@ -14,6 +14,7 @@
#ifndef ASMLEXER_H
#define ASMLEXER_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/MC/MCAsmLexer.h"
#include "llvm/Support/DataTypes.h"
#include
@@ -84,8 +85,13 @@
asmtok::TokKind getKind() const { return CurKind; }
bool is(asmtok::TokKind K) const { return CurKind == K; }
bool isNot(asmtok::TokKind K) const { return CurKind != K; }
-
- const char *getCurStrVal() const {
+
+ /// getCurStrVal - Get the string for the current token, this includes all
+ /// characters (for example, the quotes on strings) in the token.
+ ///
+ /// The returned StringRef points into the source manager's memory buffer, and
+ /// is safe to store across calls to Lex().
+ StringRef getCurStrVal() const {
assert((CurKind == asmtok::Identifier || CurKind == asmtok::Register ||
CurKind == asmtok::String) &&
"This token doesn't have a string value");
Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Mon Jul 27 16:49:56 2009
@@ -313,7 +313,7 @@
// If we have an identifier, handle it as the key symbol.
SMLoc IDLoc = Lexer.getLoc();
- const char *IDVal = Lexer.getCurStrVal();
+ StringRef IDVal = Lexer.getCurStrVal();
// Consume the identifier, see what is after it.
switch (Lexer.Lex()) {
@@ -353,194 +353,194 @@
// Otherwise, we have a normal instruction or directive.
if (IDVal[0] == '.') {
// FIXME: This should be driven based on a hash lookup and callback.
- if (!strcmp(IDVal, ".section"))
+ if (IDVal == ".section")
return ParseDirectiveDarwinSection();
- if (!strcmp(IDVal, ".text"))
+ if (IDVal == ".text")
// FIXME: This changes behavior based on the -static flag to the
// assembler.
return ParseDirectiveSectionSwitch("__TEXT,__text",
"regular,pure_instructions");
- if (!strcmp(IDVal, ".const"))
+ if (IDVal == ".const")
return ParseDirectiveSectionSwitch("__TEXT,__const");
- if (!strcmp(IDVal, ".static_const"))
+ if (IDVal == ".static_const")
return ParseDirectiveSectionSwitch("__TEXT,__static_const");
- if (!strcmp(IDVal, ".cstring"))
+ if (IDVal == ".cstring")
return ParseDirectiveSectionSwitch("__TEXT,__cstring",
"cstring_literals");
- if (!strcmp(IDVal, ".literal4"))
+ if (IDVal == ".literal4")
return ParseDirectiveSectionSwitch("__TEXT,__literal4", "4byte_literals");
- if (!strcmp(IDVal, ".literal8"))
+ if (IDVal == ".literal8")
return ParseDirectiveSectionSwitch("__TEXT,__literal8", "8byte_literals");
- if (!strcmp(IDVal, ".literal16"))
+ if (IDVal == ".literal16")
return ParseDirectiveSectionSwitch("__TEXT,__literal16",
"16byte_literals");
- if (!strcmp(IDVal, ".constructor"))
+ if (IDVal == ".constructor")
return ParseDirectiveSectionSwitch("__TEXT,__constructor");
- if (!strcmp(IDVal, ".destructor"))
+ if (IDVal == ".destructor")
return ParseDirectiveSectionSwitch("__TEXT,__destructor");
- if (!strcmp(IDVal, ".fvmlib_init0"))
+ if (IDVal == ".fvmlib_init0")
return ParseDirectiveSectionSwitch("__TEXT,__fvmlib_init0");
- if (!strcmp(IDVal, ".fvmlib_init1"))
+ if (IDVal == ".fvmlib_init1")
return ParseDirectiveSectionSwitch("__TEXT,__fvmlib_init1");
- if (!strcmp(IDVal, ".symbol_stub")) // FIXME: Different on PPC.
+ if (IDVal == ".symbol_stub") // FIXME: Different on PPC.
return ParseDirectiveSectionSwitch("__IMPORT,__jump_table,symbol_stubs",
"self_modifying_code+pure_instructions,5");
// FIXME: .picsymbol_stub on PPC.
- if (!strcmp(IDVal, ".data"))
+ if (IDVal == ".data")
return ParseDirectiveSectionSwitch("__DATA,__data");
- if (!strcmp(IDVal, ".static_data"))
+ if (IDVal == ".static_data")
return ParseDirectiveSectionSwitch("__DATA,__static_data");
- if (!strcmp(IDVal, ".non_lazy_symbol_pointer"))
+ if (IDVal == ".non_lazy_symbol_pointer")
return ParseDirectiveSectionSwitch("__DATA,__nl_symbol_pointer",
"non_lazy_symbol_pointers");
- if (!strcmp(IDVal, ".lazy_symbol_pointer"))
+ if (IDVal == ".lazy_symbol_pointer")
return ParseDirectiveSectionSwitch("__DATA,__la_symbol_pointer",
"lazy_symbol_pointers");
- if (!strcmp(IDVal, ".dyld"))
+ if (IDVal == ".dyld")
return ParseDirectiveSectionSwitch("__DATA,__dyld");
- if (!strcmp(IDVal, ".mod_init_func"))
+ if (IDVal == ".mod_init_func")
return ParseDirectiveSectionSwitch("__DATA,__mod_init_func",
"mod_init_funcs");
- if (!strcmp(IDVal, ".mod_term_func"))
+ if (IDVal == ".mod_term_func")
return ParseDirectiveSectionSwitch("__DATA,__mod_term_func",
"mod_term_funcs");
- if (!strcmp(IDVal, ".const_data"))
+ if (IDVal == ".const_data")
return ParseDirectiveSectionSwitch("__DATA,__const", "regular");
// FIXME: Verify attributes on sections.
- if (!strcmp(IDVal, ".objc_class"))
+ if (IDVal == ".objc_class")
return ParseDirectiveSectionSwitch("__OBJC,__class");
- if (!strcmp(IDVal, ".objc_meta_class"))
+ if (IDVal == ".objc_meta_class")
return ParseDirectiveSectionSwitch("__OBJC,__meta_class");
- if (!strcmp(IDVal, ".objc_cat_cls_meth"))
+ if (IDVal == ".objc_cat_cls_meth")
return ParseDirectiveSectionSwitch("__OBJC,__cat_cls_meth");
- if (!strcmp(IDVal, ".objc_cat_inst_meth"))
+ if (IDVal == ".objc_cat_inst_meth")
return ParseDirectiveSectionSwitch("__OBJC,__cat_inst_meth");
- if (!strcmp(IDVal, ".objc_protocol"))
+ if (IDVal == ".objc_protocol")
return ParseDirectiveSectionSwitch("__OBJC,__protocol");
- if (!strcmp(IDVal, ".objc_string_object"))
+ if (IDVal == ".objc_string_object")
return ParseDirectiveSectionSwitch("__OBJC,__string_object");
- if (!strcmp(IDVal, ".objc_cls_meth"))
+ if (IDVal == ".objc_cls_meth")
return ParseDirectiveSectionSwitch("__OBJC,__cls_meth");
- if (!strcmp(IDVal, ".objc_inst_meth"))
+ if (IDVal == ".objc_inst_meth")
return ParseDirectiveSectionSwitch("__OBJC,__inst_meth");
- if (!strcmp(IDVal, ".objc_cls_refs"))
+ if (IDVal == ".objc_cls_refs")
return ParseDirectiveSectionSwitch("__OBJC,__cls_refs");
- if (!strcmp(IDVal, ".objc_message_refs"))
+ if (IDVal == ".objc_message_refs")
return ParseDirectiveSectionSwitch("__OBJC,__message_refs");
- if (!strcmp(IDVal, ".objc_symbols"))
+ if (IDVal == ".objc_symbols")
return ParseDirectiveSectionSwitch("__OBJC,__symbols");
- if (!strcmp(IDVal, ".objc_category"))
+ if (IDVal == ".objc_category")
return ParseDirectiveSectionSwitch("__OBJC,__category");
- if (!strcmp(IDVal, ".objc_class_vars"))
+ if (IDVal == ".objc_class_vars")
return ParseDirectiveSectionSwitch("__OBJC,__class_vars");
- if (!strcmp(IDVal, ".objc_instance_vars"))
+ if (IDVal == ".objc_instance_vars")
return ParseDirectiveSectionSwitch("__OBJC,__instance_vars");
- if (!strcmp(IDVal, ".objc_module_info"))
+ if (IDVal == ".objc_module_info")
return ParseDirectiveSectionSwitch("__OBJC,__module_info");
- if (!strcmp(IDVal, ".objc_class_names"))
+ if (IDVal == ".objc_class_names")
return ParseDirectiveSectionSwitch("__TEXT,__cstring","cstring_literals");
- if (!strcmp(IDVal, ".objc_meth_var_types"))
+ if (IDVal == ".objc_meth_var_types")
return ParseDirectiveSectionSwitch("__TEXT,__cstring","cstring_literals");
- if (!strcmp(IDVal, ".objc_meth_var_names"))
+ if (IDVal == ".objc_meth_var_names")
return ParseDirectiveSectionSwitch("__TEXT,__cstring","cstring_literals");
- if (!strcmp(IDVal, ".objc_selector_strs"))
+ if (IDVal == ".objc_selector_strs")
return ParseDirectiveSectionSwitch("__OBJC,__selector_strs");
// Assembler features
- if (!strcmp(IDVal, ".set"))
+ if (IDVal == ".set")
return ParseDirectiveSet();
// Data directives
- if (!strcmp(IDVal, ".ascii"))
+ if (IDVal == ".ascii")
return ParseDirectiveAscii(false);
- if (!strcmp(IDVal, ".asciz"))
+ if (IDVal == ".asciz")
return ParseDirectiveAscii(true);
// FIXME: Target hooks for size? Also for "word", "hword".
- if (!strcmp(IDVal, ".byte"))
+ if (IDVal == ".byte")
return ParseDirectiveValue(1);
- if (!strcmp(IDVal, ".short"))
+ if (IDVal == ".short")
return ParseDirectiveValue(2);
- if (!strcmp(IDVal, ".long"))
+ if (IDVal == ".long")
return ParseDirectiveValue(4);
- if (!strcmp(IDVal, ".quad"))
+ if (IDVal == ".quad")
return ParseDirectiveValue(8);
// FIXME: Target hooks for IsPow2.
- if (!strcmp(IDVal, ".align"))
+ if (IDVal == ".align")
return ParseDirectiveAlign(/*IsPow2=*/true, /*ExprSize=*/1);
- if (!strcmp(IDVal, ".align32"))
+ if (IDVal == ".align32")
return ParseDirectiveAlign(/*IsPow2=*/true, /*ExprSize=*/4);
- if (!strcmp(IDVal, ".balign"))
+ if (IDVal == ".balign")
return ParseDirectiveAlign(/*IsPow2=*/false, /*ExprSize=*/1);
- if (!strcmp(IDVal, ".balignw"))
+ if (IDVal == ".balignw")
return ParseDirectiveAlign(/*IsPow2=*/false, /*ExprSize=*/2);
- if (!strcmp(IDVal, ".balignl"))
+ if (IDVal == ".balignl")
return ParseDirectiveAlign(/*IsPow2=*/false, /*ExprSize=*/4);
- if (!strcmp(IDVal, ".p2align"))
+ if (IDVal == ".p2align")
return ParseDirectiveAlign(/*IsPow2=*/true, /*ExprSize=*/1);
- if (!strcmp(IDVal, ".p2alignw"))
+ if (IDVal == ".p2alignw")
return ParseDirectiveAlign(/*IsPow2=*/true, /*ExprSize=*/2);
- if (!strcmp(IDVal, ".p2alignl"))
+ if (IDVal == ".p2alignl")
return ParseDirectiveAlign(/*IsPow2=*/true, /*ExprSize=*/4);
- if (!strcmp(IDVal, ".org"))
+ if (IDVal == ".org")
return ParseDirectiveOrg();
- if (!strcmp(IDVal, ".fill"))
+ if (IDVal == ".fill")
return ParseDirectiveFill();
- if (!strcmp(IDVal, ".space"))
+ if (IDVal == ".space")
return ParseDirectiveSpace();
// Symbol attribute directives
- if (!strcmp(IDVal, ".globl") || !strcmp(IDVal, ".global"))
+ if (IDVal == ".globl" || IDVal == ".global")
return ParseDirectiveSymbolAttribute(MCStreamer::Global);
- if (!strcmp(IDVal, ".hidden"))
+ if (IDVal == ".hidden")
return ParseDirectiveSymbolAttribute(MCStreamer::Hidden);
- if (!strcmp(IDVal, ".indirect_symbol"))
+ if (IDVal == ".indirect_symbol")
return ParseDirectiveSymbolAttribute(MCStreamer::IndirectSymbol);
- if (!strcmp(IDVal, ".internal"))
+ if (IDVal == ".internal")
return ParseDirectiveSymbolAttribute(MCStreamer::Internal);
- if (!strcmp(IDVal, ".lazy_reference"))
+ if (IDVal == ".lazy_reference")
return ParseDirectiveSymbolAttribute(MCStreamer::LazyReference);
- if (!strcmp(IDVal, ".no_dead_strip"))
+ if (IDVal == ".no_dead_strip")
return ParseDirectiveSymbolAttribute(MCStreamer::NoDeadStrip);
- if (!strcmp(IDVal, ".private_extern"))
+ if (IDVal == ".private_extern")
return ParseDirectiveSymbolAttribute(MCStreamer::PrivateExtern);
- if (!strcmp(IDVal, ".protected"))
+ if (IDVal == ".protected")
return ParseDirectiveSymbolAttribute(MCStreamer::Protected);
- if (!strcmp(IDVal, ".reference"))
+ if (IDVal == ".reference")
return ParseDirectiveSymbolAttribute(MCStreamer::Reference);
- if (!strcmp(IDVal, ".weak"))
+ if (IDVal == ".weak")
return ParseDirectiveSymbolAttribute(MCStreamer::Weak);
- if (!strcmp(IDVal, ".weak_definition"))
+ if (IDVal == ".weak_definition")
return ParseDirectiveSymbolAttribute(MCStreamer::WeakDefinition);
- if (!strcmp(IDVal, ".weak_reference"))
+ if (IDVal == ".weak_reference")
return ParseDirectiveSymbolAttribute(MCStreamer::WeakReference);
- if (!strcmp(IDVal, ".comm"))
+ if (IDVal == ".comm")
return ParseDirectiveComm(/*IsLocal=*/false);
- if (!strcmp(IDVal, ".lcomm"))
+ if (IDVal == ".lcomm")
return ParseDirectiveComm(/*IsLocal=*/true);
- if (!strcmp(IDVal, ".zerofill"))
+ if (IDVal == ".zerofill")
return ParseDirectiveDarwinZerofill();
- if (!strcmp(IDVal, ".desc"))
+ if (IDVal == ".desc")
return ParseDirectiveDarwinSymbolDesc();
- if (!strcmp(IDVal, ".lsym"))
+ if (IDVal == ".lsym")
return ParseDirectiveDarwinLsym();
- if (!strcmp(IDVal, ".subsections_via_symbols"))
+ if (IDVal == ".subsections_via_symbols")
return ParseDirectiveDarwinSubsectionsViaSymbols();
- if (!strcmp(IDVal, ".abort"))
+ if (IDVal == ".abort")
return ParseDirectiveAbort();
- if (!strcmp(IDVal, ".include"))
+ if (IDVal == ".include")
return ParseDirectiveInclude();
- if (!strcmp(IDVal, ".dump"))
+ if (IDVal == ".dump")
return ParseDirectiveDarwinDumpOrLoad(IDLoc, /*IsDump=*/true);
- if (!strcmp(IDVal, ".load"))
+ if (IDVal == ".load")
return ParseDirectiveDarwinDumpOrLoad(IDLoc, /*IsLoad=*/false);
Warning(IDLoc, "ignoring directive for now");
@@ -566,7 +566,7 @@
return false;
}
-bool AsmParser::ParseAssignment(const char *Name, bool IsDotSet) {
+bool AsmParser::ParseAssignment(const StringRef &Name, bool IsDotSet) {
// FIXME: Use better location, we should use proper tokens.
SMLoc EqualLoc = Lexer.getLoc();
@@ -605,7 +605,7 @@
if (Lexer.isNot(asmtok::Identifier))
return TokError("expected identifier after '.set' directive");
- const char *Name = Lexer.getCurStrVal();
+ StringRef Name = Lexer.getCurStrVal();
if (Lexer.Lex() != asmtok::Comma)
return TokError("unexpected token in '.set'");
@@ -632,7 +632,7 @@
if (Lexer.isNot(asmtok::Identifier))
return TokError("expected identifier in '.section' directive");
Section += ',';
- Section += Lexer.getCurStrVal();
+ Section += Lexer.getCurStrVal().str();
Lexer.Lex();
}
@@ -671,10 +671,10 @@
// FIXME: This shouldn't use a const char* + strlen, the string could have
// embedded nulls.
// FIXME: Should have accessor for getting string contents.
- const char *Str = Lexer.getCurStrVal();
- Out.EmitBytes(Str + 1, strlen(Str) - 2);
+ StringRef Str = Lexer.getCurStrVal();
+ Out.EmitBytes(Str.substr(1, Str.size() - 2));
if (ZeroTerminated)
- Out.EmitBytes("\0", 1);
+ Out.EmitBytes(StringRef("\0", 1));
Lexer.Lex();
@@ -1026,7 +1026,7 @@
if (Lexer.isNot(asmtok::Identifier))
return TokError("expected section name after comma in '.zerofill' "
"directive");
- Section += Lexer.getCurStrVal();
+ Section += Lexer.getCurStrVal().str();
Lexer.Lex();
// FIXME: we will need to tell GetSection() that this is to be created with or
@@ -1117,7 +1117,7 @@
/// ParseDirectiveAbort
/// ::= .abort [ "abort_string" ]
bool AsmParser::ParseDirectiveAbort() {
- const char *Str = NULL;
+ StringRef Str = "";
if (Lexer.isNot(asmtok::EndOfStatement)) {
if (Lexer.isNot(asmtok::String))
return TokError("expected string in '.abort' directive");
@@ -1132,7 +1132,8 @@
Lexer.Lex();
- Out.AbortAssembly(Str);
+ // FIXME: Handle here.
+ Out.AbortAssembly(Str.str().c_str());
return false;
}
Modified: llvm/trunk/tools/llvm-mc/AsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.h?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.h Mon Jul 27 16:49:56 2009
@@ -58,7 +58,7 @@
void EatToEndOfStatement();
- bool ParseAssignment(const char *Name, bool IsDotSet);
+ bool ParseAssignment(const StringRef &Name, bool IsDotSet);
/// ParseExpression - Parse a general assembly expression.
///
@@ -97,7 +97,7 @@
bool ParseParenExpr(AsmExpr *&Res);
// X86 specific.
- bool ParseX86InstOperands(const char *InstName, MCInst &Inst);
+ bool ParseX86InstOperands(const StringRef &InstName, MCInst &Inst);
bool ParseX86Operand(X86Operand &Op);
bool ParseX86MemOperand(X86Operand &Op);
bool ParseX86Register(X86Operand &Op);
Modified: llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp?rev=77258&r1=77257&r2=77258&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp (original)
+++ llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp Mon Jul 27 16:49:56 2009
@@ -235,7 +235,7 @@
/// MatchX86Inst - Convert a parsed instruction name and operand list into a
/// concrete instruction.
-static bool MatchX86Inst(const char *Name,
+static bool MatchX86Inst(const StringRef &Name,
llvm::SmallVector &Operands,
MCInst &Inst) {
return false;
@@ -243,7 +243,7 @@
/// ParseX86InstOperands - Parse the operands of an X86 instruction and return
/// them as the operands of an MCInst.
-bool AsmParser::ParseX86InstOperands(const char *InstName, MCInst &Inst) {
+bool AsmParser::ParseX86InstOperands(const StringRef &InstName, MCInst &Inst) {
llvm::SmallVector Operands;
if (Lexer.isNot(asmtok::EndOfStatement)) {
From gohman at apple.com Mon Jul 27 16:53:46 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 21:53:46 -0000
Subject: [llvm-commits] [llvm] r77259 - in /llvm/trunk: docs/LangRef.html
include/llvm/Bitcode/LLVMBitCodes.h include/llvm/Operator.h
lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp
lib/AsmParser/LLToken.h lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp lib/VMCore/AsmWriter.cpp
test/Assembler/flags-plain.ll test/Assembler/flags.ll
Message-ID: <200907272153.n6RLrkuk023065@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 16:53:46 2009
New Revision: 77259
URL: http://llvm.org/viewvc/llvm-project?rev=77259&view=rev
Log:
Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details.
Modified:
llvm/trunk/docs/LangRef.html
llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
llvm/trunk/include/llvm/Operator.h
llvm/trunk/lib/AsmParser/LLLexer.cpp
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/AsmParser/LLToken.h
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
llvm/trunk/test/Assembler/flags-plain.ll
llvm/trunk/test/Assembler/flags.ll
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Mon Jul 27 16:53:46 2009
@@ -2091,6 +2091,7 @@
instruction.
getelementptr ( CSTPTR, IDX0, IDX1, ... )
+ getelementptr inbounds ( CSTPTR, IDX0, IDX1, ... )
Perform the getelementptr operation on
constants. As with the getelementptr
instruction, the index list may have zero or more indexes, which are
@@ -3902,6 +3903,7 @@
Syntax:
<result> = getelementptr <pty>* <ptrval>{, <ty> <idx>}*
+ <result> = getelementptr inbounds <pty>* <ptrval>{, <ty> <idx>}*
Overview:
@@ -3990,6 +3992,20 @@
}
+If the inbounds keyword is present, the result value of the
+ getelementptr is undefined if the base pointer is not pointing
+ into an allocated object, or if any of the addresses formed by successive
+ addition of the offsets implied by the indices to the base address is
+ outside of the allocated object into which the base pointer points.
+
+If the inbounds keyword is not present, the offsets are added to
+ the base address with silently-wrapping two's complement arithmetic, and
+ the result value of the getelementptr may be outside the object
+ pointed to by the base pointer. The result value may not necessarily be
+ used to access memory though, even if it happens to point into allocated
+ storage. See the Pointer Aliasing Rules
+ section for more information.
+
The getelementptr instruction is often confusing. For some more insight into
how it works, see the getelementptr FAQ.
Modified: llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h (original)
+++ llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h Mon Jul 27 16:53:46 2009
@@ -132,7 +132,8 @@
CST_CODE_CE_SHUFFLEVEC = 16, // CE_SHUFFLEVEC: [opval, opval, opval]
CST_CODE_CE_CMP = 17, // CE_CMP: [opty, opval, opval, pred]
CST_CODE_INLINEASM = 18, // INLINEASM: [sideeffect,asmstr,conststr]
- CST_CODE_CE_SHUFVEC_EX = 19 // SHUFVEC_EX: [opty, opval, opval, opval]
+ CST_CODE_CE_SHUFVEC_EX = 19, // SHUFVEC_EX: [opty, opval, opval, opval]
+ CST_CODE_CE_INBOUNDS_GEP = 20 // INBOUNDS_GEP: [n x operands]
};
/// CastOpcodes - These are values used in the bitcode files to encode which
@@ -229,7 +230,8 @@
// support legacy vicmp/vfcmp instructions.
FUNC_CODE_INST_CMP2 = 28, // CMP2: [opty, opval, opval, pred]
// new select on i1 or [N x i1]
- FUNC_CODE_INST_VSELECT = 29 // VSELECT: [ty,opval,opval,predty,pred]
+ FUNC_CODE_INST_VSELECT = 29, // VSELECT: [ty,opval,opval,predty,pred]
+ FUNC_CODE_INST_INBOUNDS_GEP = 30 // INBOUNDS_GEP: [n x operands]
};
} // End bitc namespace
} // End llvm namespace
Modified: llvm/trunk/include/llvm/Operator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Operator.h?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Operator.h (original)
+++ llvm/trunk/include/llvm/Operator.h Mon Jul 27 16:53:46 2009
@@ -181,6 +181,15 @@
class GEPOperator : public Operator {
public:
+ /// isInBounds - Test whether this is an inbounds GEP, as defined
+ /// by LangRef.html.
+ bool isInBounds() const {
+ return SubclassOptionalData & (1 << 0);
+ }
+ void setIsInBounds(bool B) {
+ SubclassOptionalData = (SubclassOptionalData & ~(1 << 0)) | (B << 0);
+ }
+
inline op_iterator idx_begin() { return op_begin()+1; }
inline const_op_iterator idx_begin() const { return op_begin()+1; }
inline op_iterator idx_end() { return op_end(); }
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Mon Jul 27 16:53:46 2009
@@ -504,6 +504,7 @@
KEYWORD(nuw);
KEYWORD(nsw);
KEYWORD(exact);
+ KEYWORD(inbounds);
KEYWORD(align);
KEYWORD(addrspace);
KEYWORD(section);
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jul 27 16:53:46 2009
@@ -457,7 +457,7 @@
/// Aliasee
/// ::= TypeAndValue
/// ::= 'bitcast' '(' TypeAndValue 'to' Type ')'
-/// ::= 'getelementptr' '(' ... ')'
+/// ::= 'getelementptr' 'inbounds'? '(' ... ')'
///
/// Everything through visibility has already been parsed.
///
@@ -2039,7 +2039,11 @@
case lltok::kw_select: {
unsigned Opc = Lex.getUIntVal();
SmallVector Elts;
+ bool InBounds = false;
Lex.Lex();
+ if (Opc == Instruction::GetElementPtr)
+ if (EatIfPresent(lltok::kw_inbounds))
+ InBounds = true;
if (ParseToken(lltok::lparen, "expected '(' in constantexpr") ||
ParseGlobalValueVector(Elts) ||
ParseToken(lltok::rparen, "expected ')' in constantexpr"))
@@ -2055,6 +2059,8 @@
return Error(ID.Loc, "invalid indices for getelementptr");
ID.ConstantVal = Context.getConstantExprGetElementPtr(Elts[0],
Elts.data() + 1, Elts.size() - 1);
+ if (InBounds)
+ cast(ID.ConstantVal)->setIsInBounds(true);
} else if (Opc == Instruction::Select) {
if (Elts.size() != 3)
return Error(ID.Loc, "expected three operands to select");
@@ -3368,9 +3374,14 @@
}
/// ParseGetElementPtr
-/// ::= 'getelementptr' TypeAndValue (',' TypeAndValue)*
+/// ::= 'getelementptr' 'inbounds'? TypeAndValue (',' TypeAndValue)*
bool LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
Value *Ptr, *Val; LocTy Loc, EltLoc;
+ bool InBounds = false;
+
+ if (EatIfPresent(lltok::kw_inbounds))
+ InBounds = true;
+
if (ParseTypeAndValue(Ptr, Loc, PFS)) return true;
if (!isa(Ptr->getType()))
@@ -3388,6 +3399,8 @@
Indices.begin(), Indices.end()))
return Error(Loc, "invalid getelementptr indices");
Inst = GetElementPtrInst::Create(Ptr, Indices.begin(), Indices.end());
+ if (InBounds)
+ cast(Inst)->setIsInBounds(true);
return false;
}
Modified: llvm/trunk/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLToken.h (original)
+++ llvm/trunk/lib/AsmParser/LLToken.h Mon Jul 27 16:53:46 2009
@@ -54,6 +54,7 @@
kw_nuw,
kw_nsw,
kw_exact,
+ kw_inbounds,
kw_align,
kw_addrspace,
kw_section,
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Jul 27 16:53:46 2009
@@ -997,6 +997,7 @@
}
break;
}
+ case bitc::CST_CODE_CE_INBOUNDS_GEP:
case bitc::CST_CODE_CE_GEP: { // CE_GEP: [n x operands]
if (Record.size() & 1) return Error("Invalid CE_GEP record");
SmallVector Elts;
@@ -1007,6 +1008,8 @@
}
V = Context.getConstantExprGetElementPtr(Elts[0], &Elts[1],
Elts.size()-1);
+ if (BitCode == bitc::CST_CODE_CE_INBOUNDS_GEP)
+ cast(V)->setIsInBounds(true);
break;
}
case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#]
@@ -1556,6 +1559,7 @@
I = CastInst::Create((Instruction::CastOps)Opc, Op, ResTy);
break;
}
+ case bitc::FUNC_CODE_INST_INBOUNDS_GEP:
case bitc::FUNC_CODE_INST_GEP: { // GEP: [n x operands]
unsigned OpNum = 0;
Value *BasePtr;
@@ -1571,6 +1575,8 @@
}
I = GetElementPtrInst::Create(BasePtr, GEPIdx.begin(), GEPIdx.end());
+ if (BitCode == bitc::FUNC_CODE_INST_INBOUNDS_GEP)
+ cast(I)->setIsInBounds(true);
break;
}
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Jul 27 16:53:46 2009
@@ -706,6 +706,8 @@
break;
case Instruction::GetElementPtr:
Code = bitc::CST_CODE_CE_GEP;
+ if (cast(C)->isInBounds())
+ Code = bitc::CST_CODE_CE_INBOUNDS_GEP;
for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) {
Record.push_back(VE.getTypeID(C->getOperand(i)->getType()));
Record.push_back(VE.getValueID(C->getOperand(i)));
@@ -829,6 +831,8 @@
case Instruction::GetElementPtr:
Code = bitc::FUNC_CODE_INST_GEP;
+ if (cast(&I)->isInBounds())
+ Code = bitc::FUNC_CODE_INST_INBOUNDS_GEP;
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
PushValueAndType(I.getOperand(i), InstID, Vals, VE);
break;
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Jul 27 16:53:46 2009
@@ -854,6 +854,9 @@
} else if (const SDivOperator *Div = dyn_cast(U)) {
if (Div->isExact())
Out << " exact";
+ } else if (const GEPOperator *GEP = dyn_cast(U)) {
+ if (GEP->isInBounds())
+ Out << " inbounds";
}
}
Modified: llvm/trunk/test/Assembler/flags-plain.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-plain.ll?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/flags-plain.ll (original)
+++ llvm/trunk/test/Assembler/flags-plain.ll Mon Jul 27 16:53:46 2009
@@ -21,3 +21,8 @@
; CHECK: ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91)
ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91)
}
+
+define i64* @gep_plain_ce() {
+; CHECK: ret i64* getelementptr (i64* @addr, i64 171)
+ ret i64* getelementptr (i64* @addr, i64 171)
+}
Modified: llvm/trunk/test/Assembler/flags.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags.ll?rev=77259&r1=77258&r2=77259&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/flags.ll (original)
+++ llvm/trunk/test/Assembler/flags.ll Mon Jul 27 16:53:46 2009
@@ -104,6 +104,18 @@
ret i64 %z
}
+define i64* @gep_nw(i64* %p, i64 %x) {
+; CHECK: %z = getelementptr inbounds i64* %p, i64 %x
+ %z = getelementptr inbounds i64* %p, i64 %x
+ ret i64* %z
+}
+
+define i64* @gep_plain(i64* %p, i64 %x) {
+; CHECK: %z = getelementptr i64* %p, i64 %x
+ %z = getelementptr i64* %p, i64 %x
+ ret i64* %z
+}
+
define i64 @add_both_ce() {
; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
@@ -123,3 +135,10 @@
; CHECK: ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)
ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)
}
+
+define i64* @gep_nw_ce() {
+; CHECK: ret i64* getelementptr inbounds (i64* @addr, i64 171)
+ ret i64* getelementptr inbounds (i64* @addr, i64 171)
+}
+
+
From gohman at apple.com Mon Jul 27 16:54:52 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 21:54:52 -0000
Subject: [llvm-commits] [llvm] r77260 - /llvm/trunk/utils/vim/llvm.vim
Message-ID: <200907272154.n6RLsq0I023125@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 16:54:51 2009
New Revision: 77260
URL: http://llvm.org/viewvc/llvm-project?rev=77260&view=rev
Log:
vim syntax highlighting for inbounds keyword.
Modified:
llvm/trunk/utils/vim/llvm.vim
Modified: llvm/trunk/utils/vim/llvm.vim
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/llvm.vim?rev=77260&r1=77259&r2=77260&view=diff
==============================================================================
--- llvm/trunk/utils/vim/llvm.vim (original)
+++ llvm/trunk/utils/vim/llvm.vim Mon Jul 27 16:54:51 2009
@@ -29,7 +29,7 @@
syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge
syn keyword llvmStatement ult ule une uno
-syn keyword llvmStatement nuw nsw exact
+syn keyword llvmStatement nuw nsw exact inbounds
syn keyword llvmStatement phi call select shl lshr ashr va_arg
syn keyword llvmStatement trunc zext sext
syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
From gohman at apple.com Mon Jul 27 16:55:32 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 21:55:32 -0000
Subject: [llvm-commits] [llvm] r77261 - /llvm/trunk/utils/llvm.grm
Message-ID: <200907272155.n6RLtWfP023189@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 16:55:32 2009
New Revision: 77261
URL: http://llvm.org/viewvc/llvm-project?rev=77261&view=rev
Log:
Add inbounds to the polygen grammar.
Modified:
llvm/trunk/utils/llvm.grm
Modified: llvm/trunk/utils/llvm.grm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm.grm?rev=77261&r1=77260&r2=77261&view=diff
==============================================================================
--- llvm/trunk/utils/llvm.grm (original)
+++ llvm/trunk/utils/llvm.grm Mon Jul 27 16:55:32 2009
@@ -233,7 +233,7 @@
| Types FPVAL ;
ConstExpr::= CastOps "(" ^ ConstVal to Types ^ ")"
- | getelementptr "(" ^ ConstVal IndexList ^ ")"
+ | getelementptr OptInBounds "(" ^ ConstVal IndexList ^ ")"
| select "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
| ArithmeticOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
| LogicalOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
@@ -397,6 +397,7 @@
OptNSW ::= - nsw | _ ;
OptNUW ::= - nuw | _ ;
OptNW ::= OptNUW OptNSW ;
+OptInBounds ::= - inbounds | _ ;
MemoryInst ::= malloc Types OptCAlign
| malloc Types ^ "," INTTYPE ValueRef OptCAlign
@@ -406,6 +407,6 @@
| OptVolatile load Types ValueRef OptCAlign
| OptVolatile store ResolvedVal ^ "," Types ValueRef OptCAlign
| getresult Types ValueRef ^ "," EUINT64VAL
- | getelementptr Types ValueRef IndexList
+ | getelementptr OptInBounds Types ValueRef IndexList
| extractvalue Types ValueRef ^ ConstantIndexList
| insertvalue Types ValueRef ^ "," Types ValueRef ^ ConstantIndexList ;
From gohman at apple.com Mon Jul 27 16:59:50 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 21:59:50 -0000
Subject: [llvm-commits] [llvm] r77262 -
/llvm/trunk/lib/VMCore/LLVMContext.cpp
Message-ID: <200907272159.n6RLxogi023332@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 16:59:50 2009
New Revision: 77262
URL: http://llvm.org/viewvc/llvm-project?rev=77262&view=rev
Log:
Add a comment about the "getelementptr null" trick.
Modified:
llvm/trunk/lib/VMCore/LLVMContext.cpp
Modified: llvm/trunk/lib/VMCore/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContext.cpp?rev=77262&r1=77261&r2=77262&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContext.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContext.cpp Mon Jul 27 16:59:50 2009
@@ -419,6 +419,7 @@
Constant* LLVMContext::getConstantExprSizeOf(const Type* Ty) {
// sizeof is implemented as: (i64) gep (Ty*)null, 1
+ // Note that a non-inbounds gep is used, as null isn't within any object.
Constant *GEPIdx = ConstantInt::get(Type::Int32Ty, 1);
Constant *GEP = getConstantExprGetElementPtr(
getNullValue(getPointerTypeUnqual(Ty)), &GEPIdx, 1);
From resistor at mac.com Mon Jul 27 17:29:26 2009
From: resistor at mac.com (Owen Anderson)
Date: Mon, 27 Jul 2009 22:29:26 -0000
Subject: [llvm-commits] [llvm] r77266 - in /llvm/trunk:
include/llvm/Constants.h include/llvm/LLVMContext.h
lib/Analysis/DebugInfo.cpp lib/AsmParser/LLParser.cpp
lib/Bitcode/Reader/BitcodeReader.cpp lib/CodeGen/ShadowStackGC.cpp
lib/Linker/LinkModules.cpp lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/Utils/ValueMapper.cpp lib/VMCore/ConstantFold.cpp
lib/VMCore/Constants.cpp lib/VMCore/Core.cpp lib/VMCore/LLVMContext.cpp
lib/VMCore/LLVMContextImpl.cpp lib/VMCore/LLVMContextImpl.h
tools/bugpoint/ExtractFunction.cpp
Message-ID: <200907272229.n6RMTRAY024160@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Jul 27 17:29:26 2009
New Revision: 77266
URL: http://llvm.org/viewvc/llvm-project?rev=77266&view=rev
Log:
Move ConstantStruct back to 2.5 API.
Modified:
llvm/trunk/include/llvm/Constants.h
llvm/trunk/include/llvm/LLVMContext.h
llvm/trunk/lib/Analysis/DebugInfo.cpp
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/CodeGen/ShadowStackGC.cpp
llvm/trunk/lib/Linker/LinkModules.cpp
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
llvm/trunk/lib/VMCore/ConstantFold.cpp
llvm/trunk/lib/VMCore/Constants.cpp
llvm/trunk/lib/VMCore/Core.cpp
llvm/trunk/lib/VMCore/LLVMContext.cpp
llvm/trunk/lib/VMCore/LLVMContextImpl.cpp
llvm/trunk/lib/VMCore/LLVMContextImpl.h
llvm/trunk/tools/bugpoint/ExtractFunction.cpp
Modified: llvm/trunk/include/llvm/Constants.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constants.h?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Constants.h (original)
+++ llvm/trunk/include/llvm/Constants.h Mon Jul 27 17:29:26 2009
@@ -385,10 +385,15 @@
friend struct ConstantCreator >;
ConstantStruct(const ConstantStruct &); // DO NOT IMPLEMENT
- friend class LLVMContextImpl;
protected:
ConstantStruct(const StructType *T, const std::vector &Val);
public:
+ // ConstantStruct accessors
+ static Constant* get(const StructType* T, const std::vector& V);
+ static Constant* get(const std::vector& V, bool Packed = false);
+ static Constant* get(Constant* const *Vals, unsigned NumVals,
+ bool Packed = false);
+
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
Modified: llvm/trunk/include/llvm/LLVMContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LLVMContext.h?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LLVMContext.h (original)
+++ llvm/trunk/include/llvm/LLVMContext.h Mon Jul 27 17:29:26 2009
@@ -57,6 +57,7 @@
friend class ConstantInt;
friend class ConstantFP;
+ friend class ConstantStruct;
public:
LLVMContext();
~LLVMContext();
@@ -78,14 +79,6 @@
// ConstantPointerNull accessors
ConstantPointerNull* getConstantPointerNull(const PointerType* T);
-
- // ConstantStruct accessors
- Constant* getConstantStruct(const StructType* T,
- const std::vector& V);
- Constant* getConstantStruct(const std::vector& V,
- bool Packed = false);
- Constant* getConstantStruct(Constant* const *Vals, unsigned NumVals,
- bool Packed = false);
// ConstantAggregateZero accessors
ConstantAggregateZero* getConstantAggregateZero(const Type* Ty);
@@ -233,14 +226,11 @@
void erase(MDNode *M);
void erase(ConstantAggregateZero *Z);
void erase(ConstantArray *Z);
- void erase(ConstantStruct *S);
void erase(ConstantVector *V);
// RAUW helpers
Constant *replaceUsesOfWithOnConstant(ConstantArray *CA,
Value *From, Value *To, Use *U);
- Constant *replaceUsesOfWithOnConstant(ConstantStruct *CS, Value *From,
- Value *To, Use *U);
};
/// FOR BACKWARDS COMPATIBILITY - Returns a global context.
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jul 27 17:29:26 2009
@@ -545,8 +545,7 @@
ConstantInt::get(Type::Int64Ty, Hi)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
// If we already have this range, just return the uniqued version.
DIDescriptor &Entry = SimpleConstantCache[Init];
@@ -587,8 +586,7 @@
ConstantInt::get(Type::Int32Ty, RunTimeVer)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.compile_unit.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -606,8 +604,7 @@
ConstantInt::get(Type::Int64Ty, Val)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.enumerator.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -640,8 +637,7 @@
ConstantInt::get(Type::Int32Ty, Encoding)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.basictype.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -676,8 +672,7 @@
getCastToEmpty(DerivedFrom)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.derivedtype.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -716,8 +711,7 @@
ConstantInt::get(Type::Int32Ty, RuntimeLang)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.composite.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -754,8 +748,7 @@
ConstantInt::get(Type::Int1Ty, isDefinition)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.subprogram.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -788,8 +781,7 @@
VMContext.getConstantExprBitCast(Val, EmptyStructPtr)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.global_variable.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -814,8 +806,7 @@
getCastToEmpty(Type)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.variable.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
@@ -834,8 +825,7 @@
getCastToEmpty(Context)
};
- Constant *Init = VMContext.getConstantStruct(Elts,
- sizeof(Elts)/sizeof(Elts[0]));
+ Constant *Init = ConstantStruct::get(Elts, sizeof(Elts)/sizeof(Elts[0]));
M.addTypeName("llvm.dbg.block.type", Init->getType());
GlobalVariable *GV = new GlobalVariable(M, Init->getType(), true,
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jul 27 17:29:26 2009
@@ -1737,7 +1737,7 @@
ParseToken(lltok::rbrace, "expected end of struct constant"))
return true;
- ID.ConstantVal = Context.getConstantStruct(Elts.data(), Elts.size(), false);
+ ID.ConstantVal = ConstantStruct::get(Elts.data(), Elts.size(), false);
ID.Kind = ValID::t_Constant;
return false;
}
@@ -1757,7 +1757,7 @@
if (isPackedStruct) {
ID.ConstantVal =
- Context.getConstantStruct(Elts.data(), Elts.size(), true);
+ ConstantStruct::get(Elts.data(), Elts.size(), true);
ID.Kind = ValID::t_Constant;
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=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Jul 27 17:29:26 2009
@@ -291,7 +291,7 @@
NewC = Context.getConstantArray(UserCA->getType(), &NewOps[0],
NewOps.size());
} else if (ConstantStruct *UserCS = dyn_cast(UserC)) {
- NewC = Context.getConstantStruct(&NewOps[0], NewOps.size(),
+ NewC = ConstantStruct::get(&NewOps[0], NewOps.size(),
UserCS->getType()->isPacked());
} else if (isa(UserC)) {
NewC = Context.getConstantVector(&NewOps[0], NewOps.size());
@@ -925,7 +925,7 @@
for (unsigned i = 0; i != Size; ++i)
Elts.push_back(ValueList.getConstantFwdRef(Record[i],
STy->getElementType(i)));
- V = Context.getConstantStruct(STy, Elts);
+ V = ConstantStruct::get(STy, Elts);
} else if (const ArrayType *ATy = dyn_cast(CurTy)) {
const Type *EltTy = ATy->getElementType();
for (unsigned i = 0; i != Size; ++i)
Modified: llvm/trunk/lib/CodeGen/ShadowStackGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ShadowStackGC.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ShadowStackGC.cpp (original)
+++ llvm/trunk/lib/CodeGen/ShadowStackGC.cpp Mon Jul 27 17:29:26 2009
@@ -208,12 +208,12 @@
};
Constant *DescriptorElts[] = {
- Context.getConstantStruct(BaseElts, 2),
+ ConstantStruct::get(BaseElts, 2),
Context.getConstantArray(Context.getArrayType(VoidPtr, NumMeta),
Metadata.begin(), NumMeta)
};
- Constant *FrameMap = Context.getConstantStruct(DescriptorElts, 2);
+ Constant *FrameMap = ConstantStruct::get(DescriptorElts, 2);
std::string TypeName("gc_map.");
TypeName += utostr(NumMeta);
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jul 27 17:29:26 2009
@@ -376,7 +376,7 @@
Operands[i] =cast(RemapOperand(CPS->getOperand(i), ValueMap,
Context));
Result =
- Context.getConstantStruct(cast(CPS->getType()), Operands);
+ ConstantStruct::get(cast(CPS->getType()), Operands);
} else if (isa(CPV) || isa(CPV)) {
Result = const_cast(CPV);
} else if (const ConstantVector *CP = dyn_cast(CPV)) {
Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Jul 27 17:29:26 2009
@@ -1962,7 +1962,7 @@
CSVals[1] = Context.getNullValue(PFTy);
CSVals[0] = ConstantInt::get(Type::Int32Ty, 2147483647);
}
- CAList.push_back(Context.getConstantStruct(CSVals));
+ CAList.push_back(ConstantStruct::get(CSVals));
}
// Create the array initializer.
@@ -2070,7 +2070,7 @@
Elts[Idx] = EvaluateStoreInto(Elts[Idx], Val, Addr, OpNo+1, Context);
// Return the modified struct.
- return Context.getConstantStruct(&Elts[0], Elts.size(), STy->isPacked());
+ return ConstantStruct::get(&Elts[0], Elts.size(), STy->isPacked());
} else {
ConstantInt *CI = cast(Addr->getOperand(OpNo));
const ArrayType *ATy = cast(Init->getType());
Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Mon Jul 27 17:29:26 2009
@@ -76,7 +76,7 @@
Values.push_back(cast(MV));
for (++i; i != e; ++i)
Values.push_back(cast(MapValue(*i, VM, Context)));
- return VM[V] = Context.getConstantStruct(CS->getType(), Values);
+ return VM[V] = ConstantStruct::get(CS->getType(), Values);
}
}
return VM[V] = C;
Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/ConstantFold.cpp (original)
+++ llvm/trunk/lib/VMCore/ConstantFold.cpp Mon Jul 27 17:29:26 2009
@@ -519,7 +519,7 @@
Ops[i] = const_cast(Op);
}
if (isa(AggTy))
- return Context.getConstantStruct(Ops);
+ return ConstantStruct::get(Ops);
else
return Context.getConstantArray(cast(AggTy), Ops);
}
@@ -548,7 +548,7 @@
Ops[i] = const_cast(Op);
}
if (isa(AggTy))
- return Context.getConstantStruct(Ops);
+ return ConstantStruct::get(Ops);
else
return Context.getConstantArray(cast(AggTy), Ops);
}
@@ -565,7 +565,7 @@
}
Constant *C;
if (isa(Agg->getType()))
- C = Context.getConstantStruct(Ops);
+ C = ConstantStruct::get(Ops);
else
C = Context.getConstantArray(cast(Agg->getType()), Ops);
return C;
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon Jul 27 17:29:26 2009
@@ -397,6 +397,33 @@
}
}
+// ConstantStruct accessors.
+Constant* ConstantStruct::get(const StructType* T,
+ const std::vector& V) {
+ LLVMContextImpl* pImpl = T->getContext().pImpl;
+
+ // Create a ConstantAggregateZero value if all elements are zeros...
+ for (unsigned i = 0, e = V.size(); i != e; ++i)
+ if (!V[i]->isNullValue())
+ // Implicitly locked.
+ return pImpl->StructConstants.getOrCreate(T, V);
+
+ return T->getContext().getConstantAggregateZero(T);
+}
+
+Constant* ConstantStruct::get(const std::vector& V, bool packed) {
+ std::vector StructEls;
+ StructEls.reserve(V.size());
+ for (unsigned i = 0, e = V.size(); i != e; ++i)
+ StructEls.push_back(V[i]->getType());
+ return get(StructType::get(StructEls, packed), V);
+}
+
+Constant* ConstantStruct::get(Constant* const *Vals, unsigned NumVals,
+ bool Packed) {
+ // FIXME: make this the primary ctor method.
+ return get(std::vector(Vals, Vals+NumVals), Packed);
+}
ConstantVector::ConstantVector(const VectorType *T,
const std::vector &V)
@@ -981,7 +1008,7 @@
//
void ConstantStruct::destroyConstant() {
// Implicitly locked.
- getType()->getContext().erase(this);
+ getType()->getContext().pImpl->StructConstants.remove(this);
destroyConstantImpl();
}
@@ -1897,11 +1924,74 @@
destroyConstant();
}
+static std::vector getValType(ConstantStruct *CS) {
+ std::vector Elements;
+ Elements.reserve(CS->getNumOperands());
+ for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i)
+ Elements.push_back(cast(CS->getOperand(i)));
+ return Elements;
+}
+
void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To,
Use *U) {
- Constant* Replacement =
- getType()->getContext().replaceUsesOfWithOnConstant(this, From, To, U);
- if (!Replacement) return;
+ assert(isa(To) && "Cannot make Constant refer to non-constant!");
+ Constant *ToC = cast(To);
+
+ unsigned OperandToUpdate = U-OperandList;
+ assert(getOperand(OperandToUpdate) == From && "ReplaceAllUsesWith broken!");
+
+ std::pair Lookup;
+ Lookup.first.first = getType();
+ Lookup.second = this;
+ std::vector &Values = Lookup.first.second;
+ Values.reserve(getNumOperands()); // Build replacement struct.
+
+
+ // Fill values with the modified operands of the constant struct. Also,
+ // compute whether this turns into an all-zeros struct.
+ bool isAllZeros = false;
+ if (!ToC->isNullValue()) {
+ for (Use *O = OperandList, *E = OperandList + getNumOperands(); O != E; ++O)
+ Values.push_back(cast(O->get()));
+ } else {
+ isAllZeros = true;
+ for (Use *O = OperandList, *E = OperandList+getNumOperands(); O != E; ++O) {
+ Constant *Val = cast(O->get());
+ Values.push_back(Val);
+ if (isAllZeros) isAllZeros = Val->isNullValue();
+ }
+ }
+ Values[OperandToUpdate] = ToC;
+
+ LLVMContext &Context = getType()->getContext();
+ LLVMContextImpl *pImpl = Context.pImpl;
+
+ Constant *Replacement = 0;
+ if (isAllZeros) {
+ Replacement = Context.getConstantAggregateZero(getType());
+ } else {
+ // Check to see if we have this array type already.
+ sys::SmartScopedWriter Writer(pImpl->ConstantsLock);
+ bool Exists;
+ LLVMContextImpl::StructConstantsTy::MapTy::iterator I =
+ pImpl->StructConstants.InsertOrGetItem(Lookup, Exists);
+
+ if (Exists) {
+ Replacement = I->second;
+ } else {
+ // Okay, the new shape doesn't exist in the system yet. Instead of
+ // creating a new constant struct, inserting it, replaceallusesof'ing the
+ // old with the new, then deleting the old... just update the current one
+ // in place!
+ pImpl->StructConstants.MoveConstantToNewSlot(this, I);
+
+ // Update to the new value.
+ setOperand(OperandToUpdate, ToC);
+ return;
+ }
+ }
+
+ assert(Replacement != this && "I didn't contain From!");
// Everyone using this now uses the replacement.
uncheckedReplaceAllUsesWith(Replacement);
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Mon Jul 27 17:29:26 2009
@@ -416,8 +416,7 @@
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
int Packed) {
- return wrap(getGlobalContext().getConstantStruct(
- unwrap(ConstantVals, Count),
+ return wrap(ConstantStruct::get(unwrap(ConstantVals, Count),
Count, Packed != 0));
}
Modified: llvm/trunk/lib/VMCore/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContext.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContext.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContext.cpp Mon Jul 27 17:29:26 2009
@@ -98,29 +98,6 @@
return ConstantPointerNull::get(T);
}
-
-// ConstantStruct accessors.
-Constant* LLVMContext::getConstantStruct(const StructType* T,
- const std::vector& V) {
- return pImpl->getConstantStruct(T, V);
-}
-
-Constant* LLVMContext::getConstantStruct(const std::vector& V,
- bool packed) {
- std::vector StructEls;
- StructEls.reserve(V.size());
- for (unsigned i = 0, e = V.size(); i != e; ++i)
- StructEls.push_back(V[i]->getType());
- return getConstantStruct(getStructType(StructEls, packed), V);
-}
-
-Constant* LLVMContext::getConstantStruct(Constant* const *Vals,
- unsigned NumVals, bool Packed) {
- // FIXME: make this the primary ctor method.
- return getConstantStruct(std::vector(Vals, Vals+NumVals), Packed);
-}
-
-
// ConstantAggregateZero accessors.
ConstantAggregateZero* LLVMContext::getConstantAggregateZero(const Type* Ty) {
return pImpl->getConstantAggregateZero(Ty);
@@ -552,10 +529,6 @@
pImpl->erase(C);
}
-void LLVMContext::erase(ConstantStruct *S) {
- pImpl->erase(S);
-}
-
void LLVMContext::erase(ConstantVector *V) {
pImpl->erase(V);
}
@@ -564,8 +537,3 @@
Value *From, Value *To, Use *U) {
return pImpl->replaceUsesOfWithOnConstant(CA, From, To, U);
}
-
-Constant *LLVMContext::replaceUsesOfWithOnConstant(ConstantStruct *CS,
- Value *From, Value *To, Use *U) {
- return pImpl->replaceUsesOfWithOnConstant(CS, From, To, U);
-}
Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.cpp Mon Jul 27 17:29:26 2009
@@ -29,14 +29,6 @@
return Elements;
}
-static std::vector getValType(ConstantStruct *CS) {
- std::vector Elements;
- Elements.reserve(CS->getNumOperands());
- for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i)
- Elements.push_back(cast(CS->getOperand(i)));
- return Elements;
-}
-
static std::vector getValType(ConstantVector *CP) {
std::vector Elements;
Elements.reserve(CP->getNumOperands());
@@ -112,17 +104,6 @@
return Context.getConstantAggregateZero(Ty);
}
-Constant *LLVMContextImpl::getConstantStruct(const StructType *Ty,
- const std::vector &V) {
- // Create a ConstantAggregateZero value if all elements are zeros...
- for (unsigned i = 0, e = V.size(); i != e; ++i)
- if (!V[i]->isNullValue())
- // Implicitly locked.
- return StructConstants.getOrCreate(Ty, V);
-
- return Context.getConstantAggregateZero(Ty);
-}
-
Constant *LLVMContextImpl::getConstantVector(const VectorType *Ty,
const std::vector &V) {
assert(!V.empty() && "Vectors can't be empty");
@@ -169,10 +150,6 @@
ArrayConstants.remove(C);
}
-void LLVMContextImpl::erase(ConstantStruct *S) {
- StructConstants.remove(S);
-}
-
void LLVMContextImpl::erase(ConstantVector *V) {
VectorConstants.remove(V);
}
@@ -255,68 +232,4 @@
}
return Replacement;
-}
-
-Constant *LLVMContextImpl::replaceUsesOfWithOnConstant(ConstantStruct *CS,
- Value *From, Value *To, Use *U) {
- assert(isa(To) && "Cannot make Constant refer to non-constant!");
- Constant *ToC = cast(To);
-
- unsigned OperandToUpdate = U - CS->OperandList;
- assert(CS->getOperand(OperandToUpdate) == From &&
- "ReplaceAllUsesWith broken!");
-
- std::pair Lookup;
- Lookup.first.first = CS->getType();
- Lookup.second = CS;
- std::vector &Values = Lookup.first.second;
- Values.reserve(CS->getNumOperands()); // Build replacement struct.
-
-
- // Fill values with the modified operands of the constant struct. Also,
- // compute whether this turns into an all-zeros struct.
- bool isAllZeros = false;
- if (!ToC->isNullValue()) {
- for (Use *O = CS->OperandList, *E = CS->OperandList + CS->getNumOperands();
- O != E; ++O)
- Values.push_back(cast(O->get()));
- } else {
- isAllZeros = true;
- for (Use *O = CS->OperandList, *E = CS->OperandList + CS->getNumOperands();
- O != E; ++O) {
- Constant *Val = cast(O->get());
- Values.push_back(Val);
- if (isAllZeros) isAllZeros = Val->isNullValue();
- }
- }
- Values[OperandToUpdate] = ToC;
-
- Constant *Replacement = 0;
- if (isAllZeros) {
- Replacement = Context.getConstantAggregateZero(CS->getType());
- } else {
- // Check to see if we have this array type already.
- sys::SmartScopedWriter Writer(ConstantsLock);
- bool Exists;
- StructConstantsTy::MapTy::iterator I =
- StructConstants.InsertOrGetItem(Lookup, Exists);
-
- if (Exists) {
- Replacement = I->second;
- } else {
- // Okay, the new shape doesn't exist in the system yet. Instead of
- // creating a new constant struct, inserting it, replaceallusesof'ing the
- // old with the new, then deleting the old... just update the current one
- // in place!
- StructConstants.MoveConstantToNewSlot(CS, I);
-
- // Update to the new value.
- CS->setOperand(OperandToUpdate, ToC);
- return 0;
- }
- }
-
- assert(Replacement != CS && "I didn't contain From!");
-
- return Replacement;
-}
+}
\ No newline at end of file
Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.h?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.h Mon Jul 27 17:29:26 2009
@@ -102,7 +102,7 @@
std::vector C;
for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i)
C.push_back(cast(OldC->getOperand(i)));
- Constant *New = NewTy->getContext().getConstantStruct(NewTy, C);
+ Constant *New = ConstantStruct::get(NewTy, C);
assert(New != OldC && "Didn't replace constant??");
OldC->uncheckedReplaceAllUsesWith(New);
@@ -458,6 +458,7 @@
friend class ConstantInt;
friend class ConstantFP;
+ friend class ConstantStruct;
public:
LLVMContextImpl(LLVMContext &C);
@@ -470,9 +471,6 @@
Constant *getConstantArray(const ArrayType *Ty,
const std::vector &V);
- Constant *getConstantStruct(const StructType *Ty,
- const std::vector &V);
-
Constant *getConstantVector(const VectorType *Ty,
const std::vector &V);
@@ -494,15 +492,12 @@
void erase(MDNode *M);
void erase(ConstantAggregateZero *Z);
void erase(ConstantArray *C);
- void erase(ConstantStruct *S);
void erase(ConstantVector *V);
// RAUW helpers
Constant *replaceUsesOfWithOnConstant(ConstantArray *CA, Value *From,
Value *To, Use *U);
- Constant *replaceUsesOfWithOnConstant(ConstantStruct *CS, Value *From,
- Value *To, Use *U);
};
}
Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=77266&r1=77265&r2=77266&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Mon Jul 27 17:29:26 2009
@@ -187,7 +187,7 @@
std::vector Elts;
Elts.push_back(ConstantInt::get(Type::Int32Ty, TorList[i].second));
Elts.push_back(TorList[i].first);
- ArrayElts.push_back(Context.getConstantStruct(Elts));
+ ArrayElts.push_back(ConstantStruct::get(Elts));
}
return Context.getConstantArray(Context.getArrayType(ArrayElts[0]->getType(),
ArrayElts.size()),
From resistor at mac.com Mon Jul 27 17:30:01 2009
From: resistor at mac.com (Owen Anderson)
Date: Mon, 27 Jul 2009 22:30:01 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77268 - in /llvm-gcc-4.2/trunk/gcc:
llvm-backend.cpp llvm-convert.cpp llvm-types.cpp
Message-ID: <200907272230.n6RMU161024220@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Jul 27 17:30:00 2009
New Revision: 77268
URL: http://llvm.org/viewvc/llvm-project?rev=77268&view=rev
Log:
Update for LLVM API change.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=77268&r1=77267&r2=77268&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Jul 27 17:30:00 2009
@@ -286,7 +286,7 @@
}
// Create string table.
- Constant *LLVMValuesTable = Context.getConstantStruct(ValuesForPCH, false);
+ Constant *LLVMValuesTable = ConstantStruct::get(ValuesForPCH, false);
// Create variable to hold this string table.
new GlobalVariable(*TheModule, LLVMValuesTable->getType(), true,
@@ -811,7 +811,7 @@
// __attribute__(constructor) can be on a function with any type. Make sure
// the pointer is void()*.
StructInit[1] = TheFolder->CreateBitCast(Tors[i].first, FPTy);
- InitList.push_back(Context.getConstantStruct(StructInit, false));
+ InitList.push_back(ConstantStruct::get(StructInit, false));
}
Constant *Array = Context.getConstantArray(
Context.getArrayType(InitList[0]->getType(), InitList.size()), InitList);
@@ -1152,7 +1152,7 @@
};
AttributeAnnotateGlobals.push_back(
- Context.getConstantStruct(Element, 4, false));
+ ConstantStruct::get(Element, 4, false));
}
// Get next annotate attribute.
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=77268&r1=77267&r2=77268&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 27 17:30:00 2009
@@ -7116,7 +7116,7 @@
std::vector Elts;
Elts.push_back(Convert(TREE_REALPART(exp)));
Elts.push_back(Convert(TREE_IMAGPART(exp)));
- return Context.getConstantStruct(Elts, false);
+ return ConstantStruct::get(Elts, false);
}
Constant *TreeConstantToLLVM::ConvertNOP_EXPR(tree exp) {
@@ -7302,7 +7302,7 @@
if (AllEltsSameType)
return Context.getConstantArray(
Context.getArrayType(ElTy, ResultElts.size()), ResultElts);
- return Context.getConstantStruct(ResultElts, false);
+ return ConstantStruct::get(ResultElts, false);
}
@@ -7723,7 +7723,7 @@
// Okay, we're done, return the computed elements.
return
- Context.getConstantStruct(LayoutInfo.ResultElts, LayoutInfo.StructIsPacked);
+ ConstantStruct::get(LayoutInfo.ResultElts, LayoutInfo.StructIsPacked);
}
Constant *TreeConstantToLLVM::ConvertUnionCONSTRUCTOR(tree exp) {
@@ -7755,7 +7755,7 @@
Elts.push_back(Context.getNullValue(FillTy));
}
}
- return Context.getConstantStruct(Elts, false);
+ return ConstantStruct::get(Elts, false);
}
//===----------------------------------------------------------------------===//
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=77268&r1=77267&r2=77268&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Jul 27 17:30:00 2009
@@ -192,7 +192,7 @@
}
// Create string table.
- Constant *LTypesNameTable = Context.getConstantStruct(LTypesNames, false);
+ Constant *LTypesNameTable = ConstantStruct::get(LTypesNames, false);
// Create variable to hold this string table.
GlobalVariable *GV = new GlobalVariable(*TheModule,
From daniel at zuster.org Mon Jul 27 17:39:14 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 27 Jul 2009 22:39:14 -0000
Subject: [llvm-commits] [llvm] r77269 - /llvm/trunk/include/llvm/Value.h
Message-ID: <200907272239.n6RMdFnY024533@zion.cs.uiuc.edu>
Author: ddunbar
Date: Mon Jul 27 17:39:14 2009
New Revision: 77269
URL: http://llvm.org/viewvc/llvm-project?rev=77269&view=rev
Log:
Add a comment on Value explaining the current getName() behavior.
Modified:
llvm/trunk/include/llvm/Value.h
Modified: llvm/trunk/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=77269&r1=77268&r2=77269&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Value.h (original)
+++ llvm/trunk/include/llvm/Value.h Mon Jul 27 17:39:14 2009
@@ -114,6 +114,12 @@
/// getName() - Return a constant reference to the value's name. This is cheap
/// and guaranteed to return the same reference as long as the value is not
/// modified.
+ ///
+ /// This is currently guaranteed to return a StringRef for which data() points
+ /// to a valid null terminated string. This usage is deprecated, however, and
+ /// clients should not rely on it. If such behavior is needed, clients should
+ /// use getNameStr() or switch to an interface that does not depend on null
+ /// termination.
StringRef getName() const;
/// getNameStr() - Return the name of the specified value, *constructing a
From daniel at zuster.org Mon Jul 27 17:43:07 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 27 Jul 2009 15:43:07 -0700
Subject: [llvm-commits] [llvm] r77149 - /llvm/trunk/lib/VMCore/Value.cpp
In-Reply-To: <1531E511-8F9B-49B7-98A1-6C46B17930B5@apple.com>
References: <200907260922.n6Q9MMQX020945@zion.cs.uiuc.edu>
<1531E511-8F9B-49B7-98A1-6C46B17930B5@apple.com>
Message-ID: <6a8523d60907271543va853dd5jf6fa9c1cd887cfd3@mail.gmail.com>
Hi Dan,
The problem is there can't be a c_str method on StringRef, it has no
way to make that guarantee.
Since you essentially called me out on adding a hack, let me explain. :)
In my opinion, the real problem is that historically clients were
using getNameStart() and expecting it to be null terminated. This
happens to be true, because the contents are in a string map and they
are null terminated, but (a) it may not be the full name, and (b) this
was not really part of the getNameStart() contract.
The right solution is for clients to use an API which doesn't depend
on null termination (and I have actively been moving stuff over). I
added a comment to Value::getName to make this clearer.
Seem ok?
- Daniel
On Mon, Jul 27, 2009 at 2:07 PM, Dan Gohman wrote:
>
> On Jul 26, 2009, at 2:22 AM, Daniel Dunbar wrote:
>
>
>> Author: ddunbar
>> Date: Sun Jul 26 04:22:02 2009
>> New Revision: 77149
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=77149&view=rev
>> Log:
>> Make sure getName().data() is always null terminated.
>
> Hi Daniel,
>
> The doxygen comment for StringRef::data() says it may not be null
> terminated. This is also consistent with std::string. If there are
> clients that need a nul-terminated string, shouldn't there be a
> c_str() method?
>
> Dan
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
From mrs at apple.com Mon Jul 27 18:14:11 2009
From: mrs at apple.com (Mike Stump)
Date: Mon, 27 Jul 2009 23:14:11 -0000
Subject: [llvm-commits] [llvm] r77271 - in /llvm/trunk/lib:
CodeGen/SimpleRegisterCoalescing.cpp Transforms/Scalar/LoopUnroll.cpp
Transforms/Utils/LowerSwitch.cpp
Message-ID: <200907272314.n6RNEBsP025576@zion.cs.uiuc.edu>
Author: mrs
Date: Mon Jul 27 18:14:11 2009
New Revision: 77271
URL: http://llvm.org/viewvc/llvm-project?rev=77271&view=rev
Log:
Avoid build warnings.
Modified:
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=77271&r1=77270&r2=77271&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Jul 27 18:14:11 2009
@@ -1308,6 +1308,7 @@
DEBUG(errs() << "\tIncompatible source regclass: "
<< tri_->getName(DstSubReg) << " not in " << SrcSubRC->getName()
<< ".\n");
+ (void)DstSubReg;
return false; // Not coalescable.
}
}
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=77271&r1=77270&r2=77271&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Mon Jul 27 18:14:11 2009
@@ -121,6 +121,7 @@
BasicBlock *Header = L->getHeader();
DEBUG(errs() << "Loop Unroll: F[" << Header->getParent()->getName()
<< "] Loop %" << Header->getName() << "\n");
+ (void)Header;
// Find trip count
unsigned TripCount = L->getSmallConstantTripCount();
Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=77271&r1=77270&r2=77271&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon Jul 27 18:14:11 2009
@@ -309,6 +309,7 @@
DEBUG(errs() << "Clusterify finished. Total clusters: " << Cases.size()
<< ". Total compares: " << numCmps << "\n");
DEBUG(errs() << "Cases: " << Cases << "\n");
+ (void)numCmps;
BasicBlock* SwitchBlock = switchConvert(Cases.begin(), Cases.end(), Val,
OrigBlock, NewDefault);
From daniel at zuster.org Mon Jul 27 18:20:53 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 27 Jul 2009 23:20:53 -0000
Subject: [llvm-commits] [llvm] r77272 - in /llvm/trunk:
include/llvm/MC/MCStreamer.h lib/MC/MCAsmStreamer.cpp
test/MC/AsmParser/directive_abort.s tools/llvm-mc/AsmParser.cpp
tools/llvm-mc/AsmParser.h tools/llvm-mc/MC-X86Specific.cpp
Message-ID: <200907272320.n6RNKrd2025767@zion.cs.uiuc.edu>
Author: ddunbar
Date: Mon Jul 27 18:20:52 2009
New Revision: 77272
URL: http://llvm.org/viewvc/llvm-project?rev=77272&view=rev
Log:
llvm-mc: Implement .abort fully in the front end
Modified:
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/test/MC/AsmParser/directive_abort.s
llvm/trunk/tools/llvm-mc/AsmParser.cpp
llvm/trunk/tools/llvm-mc/AsmParser.h
llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=77272&r1=77271&r2=77272&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Mon Jul 27 18:20:52 2009
@@ -156,13 +156,6 @@
virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = 0,
unsigned Size = 0,unsigned Pow2Alignment = 0) = 0;
- /// AbortAssembly - Stop and don't produce output, printing @param
- /// AbortReason if non-NULL to indicate the reason the assembly is
- /// terminated.
- ///
- /// @param AbortReason - The reason assembly is terminated, if non-NULL.
- virtual void AbortAssembly(const char *AbortReason) = 0;
-
/// @}
/// @name Generating Data
/// @{
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=77272&r1=77271&r2=77272&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Mon Jul 27 18:20:52 2009
@@ -55,8 +55,6 @@
virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = NULL,
unsigned Size = 0, unsigned Pow2Alignment = 0);
- virtual void AbortAssembly(const char *AbortReason = NULL);
-
virtual void EmitBytes(const StringRef &Data);
virtual void EmitValue(const MCValue &Value, unsigned Size);
@@ -132,14 +130,6 @@
OS << '\n';
}
-void MCAsmStreamer::AbortAssembly(const char *AbortReason) {
- OS << ".abort";
- if (AbortReason != NULL)
- OS << ' ' << AbortReason;
- OS << '\n';
-
-}
-
void MCAsmStreamer::EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
bool MakeAbsolute) {
assert(!Symbol->getSection() && "Cannot assign to a label!");
Modified: llvm/trunk/test/MC/AsmParser/directive_abort.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_abort.s?rev=77272&r1=77271&r2=77272&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_abort.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_abort.s Mon Jul 27 18:20:52 2009
@@ -1,8 +1,6 @@
-# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
+# RUN: llvm-mc -triple i386-unknown-unknown %s 2> %t
+# RUN: FileCheck -input-file %t %s
-# CHECK: TEST0:
# CHECK: .abort "please stop assembing"
-# CHECK: .abort
TEST0:
.abort "please stop assembing"
-.abort
Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=77272&r1=77271&r2=77272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Mon Jul 27 18:20:52 2009
@@ -14,6 +14,7 @@
#include "AsmParser.h"
#include "AsmExpr.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCStreamer.h"
@@ -23,12 +24,12 @@
#include "llvm/Target/TargetAsmParser.h"
using namespace llvm;
-void AsmParser::Warning(SMLoc L, const char *Msg) {
- Lexer.PrintMessage(L, Msg, "warning");
+void AsmParser::Warning(SMLoc L, const Twine &Msg) {
+ Lexer.PrintMessage(L, Msg.str(), "warning");
}
-bool AsmParser::Error(SMLoc L, const char *Msg) {
- Lexer.PrintMessage(L, Msg, "error");
+bool AsmParser::Error(SMLoc L, const Twine &Msg) {
+ Lexer.PrintMessage(L, Msg.str(), "error");
return true;
}
@@ -1117,6 +1118,9 @@
/// ParseDirectiveAbort
/// ::= .abort [ "abort_string" ]
bool AsmParser::ParseDirectiveAbort() {
+ // FIXME: Use loc from directive.
+ SMLoc Loc = Lexer.getLoc();
+
StringRef Str = "";
if (Lexer.isNot(asmtok::EndOfStatement)) {
if (Lexer.isNot(asmtok::String))
@@ -1133,7 +1137,10 @@
Lexer.Lex();
// FIXME: Handle here.
- Out.AbortAssembly(Str.str().c_str());
+ if (Str.empty())
+ Error(Loc, ".abort detected. Assembly stopping.");
+ else
+ Error(Loc, ".abort '" + Str + "' detected. Assembly stopping.");
return false;
}
Modified: llvm/trunk/tools/llvm-mc/AsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.h?rev=77272&r1=77271&r2=77272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.h Mon Jul 27 18:20:52 2009
@@ -25,6 +25,7 @@
class MCStreamer;
class MCValue;
class TargetAsmParser;
+class Twine;
class AsmParser : MCAsmParser {
public:
@@ -52,8 +53,8 @@
private:
bool ParseStatement();
- void Warning(SMLoc L, const char *Msg);
- bool Error(SMLoc L, const char *Msg);
+ void Warning(SMLoc L, const Twine &Msg);
+ bool Error(SMLoc L, const Twine &Msg);
bool TokError(const char *Msg);
void EatToEndOfStatement();
Modified: llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp?rev=77272&r1=77271&r2=77272&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp (original)
+++ llvm/trunk/tools/llvm-mc/MC-X86Specific.cpp Mon Jul 27 18:20:52 2009
@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "AsmParser.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/SourceMgr.h"
using namespace llvm;
From gohman at apple.com Mon Jul 27 18:23:48 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 27 Jul 2009 23:23:48 -0000
Subject: [llvm-commits] [llvm] r77273 -
/llvm/trunk/tools/bugpoint/bugpoint.cpp
Message-ID: <200907272323.n6RNNmlH025846@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 18:23:47 2009
New Revision: 77273
URL: http://llvm.org/viewvc/llvm-project?rev=77273&view=rev
Log:
Pass true to the Internalize parameter of createStandardLTOPasses,
to match llvm-ld's default behavior.
Modified:
llvm/trunk/tools/bugpoint/bugpoint.cpp
Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=77273&r1=77272&r2=77273&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/bugpoint.cpp (original)
+++ llvm/trunk/tools/bugpoint/bugpoint.cpp Mon Jul 27 18:23:47 2009
@@ -113,7 +113,7 @@
}
if (StandardLinkOpts)
- createStandardLTOPasses(&PM, /*Internalize=*/false,
+ createStandardLTOPasses(&PM, /*Internalize=*/true,
/*RunInliner=*/true,
/*VerifyEach=*/false);
From mrs at apple.com Mon Jul 27 18:33:35 2009
From: mrs at apple.com (Mike Stump)
Date: Mon, 27 Jul 2009 23:33:35 -0000
Subject: [llvm-commits] [llvm] r77274 -
/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
Message-ID: <200907272333.n6RNXZkU026103@zion.cs.uiuc.edu>
Author: mrs
Date: Mon Jul 27 18:33:34 2009
New Revision: 77274
URL: http://llvm.org/viewvc/llvm-project?rev=77274&view=rev
Log:
Fix a release-asserts warning. Debug functions should be marked used,
if there are no other uses. If people don't need this routine
anymore, if should be deleted.
Modified:
llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=77274&r1=77273&r2=77274&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon Jul 27 18:33:34 2009
@@ -110,6 +110,8 @@
// operator<< - Used for debugging purposes.
//
static raw_ostream& operator<<(raw_ostream &O,
+ const LowerSwitch::CaseVector &C) __attribute((used));
+static raw_ostream& operator<<(raw_ostream &O,
const LowerSwitch::CaseVector &C) {
O << "[";
From david_goodwin at apple.com Mon Jul 27 18:34:12 2009
From: david_goodwin at apple.com (David Goodwin)
Date: Mon, 27 Jul 2009 23:34:12 -0000
Subject: [llvm-commits] [llvm] r77275 - in /llvm/trunk:
lib/Target/ARM/ARMInstrThumb2.td test/CodeGen/Thumb2/thumb2-orn.ll
Message-ID: <200907272334.n6RNYCge026127@zion.cs.uiuc.edu>
Author: david_goodwin
Date: Mon Jul 27 18:34:12 2009
New Revision: 77275
URL: http://llvm.org/viewvc/llvm-project?rev=77275&view=rev
Log:
ORN does not require (and can not have) the ".w" suffix. "Orthogonality" is a dirty word at ARM.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=77275&r1=77274&r2=77275&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Mon Jul 27 18:34:12 2009
@@ -164,23 +164,29 @@
/// T2I_bin_irs - Defines a set of (op reg, {so_imm|r|so_reg}) patterns for a
// binary operation that produces a value. These are predicable and can be
/// changed to modify CPSR.
-multiclass T2I_bin_irs {
+multiclass T2I_bin_irs {
// shifted imm
def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
opc, " $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>;
// register
def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
- opc, ".w $dst, $lhs, $rhs",
+ opc, !strconcat(wide, " $dst, $lhs, $rhs"),
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
let isCommutable = Commutable;
}
// shifted register
def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
- opc, ".w $dst, $lhs, $rhs",
+ opc, !strconcat(wide, " $dst, $lhs, $rhs"),
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
}
+/// T2I_bin_w_irs - Same as T2I_bin_irs except these operations need
+// the ".w" prefix to indicate that they are wide.
+multiclass T2I_bin_w_irs :
+ T2I_bin_irs;
+
/// T2I_rbin_is - Same as T2I_bin_irs except the order of operands are
/// reversed. It doesn't define the 'rr' form since it's handled by its
/// T2I_bin_irs counterpart.
@@ -731,11 +737,11 @@
// Bitwise Instructions.
//
-defm t2AND : T2I_bin_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>, 1>;
-defm t2ORR : T2I_bin_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>, 1>;
-defm t2EOR : T2I_bin_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>, 1>;
+defm t2AND : T2I_bin_w_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>, 1>;
+defm t2ORR : T2I_bin_w_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>, 1>;
+defm t2EOR : T2I_bin_w_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>, 1>;
-defm t2BIC : T2I_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
+defm t2BIC : T2I_bin_w_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
let Constraints = "$src = $dst" in
def t2BFC : T2I<(outs GPR:$dst), (ins GPR:$src, bf_inv_mask_imm:$imm),
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll?rev=77275&r1=77274&r2=77275&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll Mon Jul 27 18:34:12 2009
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %b, 4294967295
From isanbard at gmail.com Mon Jul 27 18:50:57 2009
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 27 Jul 2009 23:50:57 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77276 -
/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
Message-ID: <200907272350.n6RNow4H026564@zion.cs.uiuc.edu>
Author: void
Date: Mon Jul 27 18:50:57 2009
New Revision: 77276
URL: http://llvm.org/viewvc/llvm-project?rev=77276&view=rev
Log:
LTO was stripping some Objective-C metadata symbols because IPSCCP thought that
they were dead. They weren't in the llvm.used list. Mark them as "preserve" so
that they're placed into the list.
The testcase for this is the SingleSource/UnitTests/ObjC/protocols.m file in
the test suite.
Modified:
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=77276&r1=77275&r2=77276&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Jul 27 18:50:57 2009
@@ -6200,6 +6200,9 @@
follow from the alignments of the component types. */
DECL_ALIGN(decl) = BITS_PER_WORD==32 ? 32 : 128;
DECL_USER_ALIGN(decl) = 1;
+
+ /* Let optimizer know that this decl is not removable. */
+ DECL_PRESERVE_P (decl) = 1;
#endif
/* LLVM LOCAL end */
set_user_assembler_name (decl, buf);
@@ -12504,6 +12507,12 @@
decl = create_hidden_decl (objc_protocol_type, string);
DECL_WEAK (decl) = 1;
set_user_assembler_name (decl, string);
+ /* LLVM LOCAL begin 7069676 */
+#ifdef ENABLE_LLVM
+ /* Let optimizer know that this decl is not removable. */
+ DECL_PRESERVE_P (decl) = 1;
+#endif
+ /* LLVM LOCAL end 7069676 */
expr = convert (objc_protocol_type, build_fold_addr_expr (expr));
/* APPLE LOCAL radar 4561192 */
objc_set_alignment_attribute (decl, objc_protocol_type);
@@ -12615,7 +12624,12 @@
decl = create_hidden_decl (objc_protocol_type, buf);
DECL_WEAK (decl) = 1;
set_user_assembler_name (decl, buf);
-
+ /* LLVM LOCAL begin 7069676 */
+#ifdef ENABLE_LLVM
+ /* Let optimizer know that this decl is not removable. */
+ DECL_PRESERVE_P (decl) = 1;
+#endif
+ /* LLVM LOCAL end 7069676 */
return decl;
}
/* APPLE LOCAL end radar 6351990 */
@@ -14194,6 +14208,10 @@
PROTOCOL_V2_FORWARD_DECL (p) = decl;
/* LLVM LOCAL begin - radar 5476262 */
#ifdef ENABLE_LLVM
+ /* begin radar 7069676 */
+ /* Let optimizer know that this decl is not removable. */
+ DECL_PRESERVE_P (decl) = 1;
+ /* end radar 7069676 */
pushdecl_top_level(decl);
#endif
/* LLVM LOCAL end - radar 5476262 */
From gohman at apple.com Mon Jul 27 19:06:49 2009
From: gohman at apple.com (Dan Gohman)
Date: Tue, 28 Jul 2009 00:06:49 -0000
Subject: [llvm-commits] [test-suite] r77278 -
/test-suite/trunk/Makefile.programs
Message-ID: <200907280006.n6S06nGO026994@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 19:06:46 2009
New Revision: 77278
URL: http://llvm.org/viewvc/llvm-project?rev=77278&view=rev
Log:
Use bugpoint's new -std-compile-opts and -std-link-opts options
instead of doing tricks to get this information.
Modified:
test-suite/trunk/Makefile.programs
Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=77278&r1=77277&r2=77278&view=diff
==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Mon Jul 27 19:06:46 2009
@@ -330,17 +330,6 @@
endif # ifndef DISABLE_FOR_LLVM_PROGRAMS
-# Targets to get the pass arguments that opt and llvm-ld are using...
-Output/opt-pass-args: $(LOPT) Output/.dir
- -$(LLVMAS) < /dev/null -o - | \
- $(LOPT) $(EXTRA_LOPT_OPTIONS) -std-compile-opts -disable-output -debug-pass=Arguments 2>&1 | \
- sed 's/Pass Arguments: //' > $@
-
-Output/llvm-ld-pass-args: $(LLVMLDPROG) Output/.dir
- $(LLVMAS) < /dev/null > Output/llvm-ld.test.bc
- $(LLVMLD) Output/llvm-ld.test.bc -o Output/llvm-ld.test-out -debug-pass=Arguments > $@.1 2>&1
- sed 's/Pass Arguments: //' < $@.1 > $@
-
# If the program requires exception handling support, enable (potentially
# expensive) support for it.
ifdef REQUIRES_EH_SUPPORT
@@ -557,13 +546,13 @@
# Rules to bugpoint the opt, llvm-ld, llc, or lli commands...
$(PROGRAMS_TO_TEST:%=Output/%.bugpoint-opt): \
Output/%.bugpoint-opt: Output/%.noopt-llvm.bc $(LBUGPOINT) \
- Output/opt-pass-args Output/%.out-nat
- PWD=$(CURDIR) $(LBUGPOINT) -llc-safe $< `cat Output/opt-pass-args` $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS)
+ Output/%.out-nat
+ PWD=$(CURDIR) $(LBUGPOINT) -llc-safe $< -std-compile-opts $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS)
$(PROGRAMS_TO_TEST:%=Output/%.bugpoint-llvm-ld): \
Output/%.bugpoint-llvm-ld: Output/%.nollvm-ldopt-llvm.bc $(LBUGPOINT) \
- Output/llvm-ld-pass-args Output/%.out-nat
- PWD=$(CURDIR) $(LBUGPOINT) -llc-safe $< `cat Output/llvm-ld-pass-args` $(OPTPASSES) $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS)
+ Output/%.out-nat
+ PWD=$(CURDIR) $(LBUGPOINT) -llc-safe $< -std-link-opts $(OPTPASSES) $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS)
$(PROGRAMS_TO_TEST:%=Output/%.bugpoint-llc): \
Output/%.bugpoint-llc: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat
From bob.wilson at apple.com Mon Jul 27 19:21:56 2009
From: bob.wilson at apple.com (Bob Wilson)
Date: Tue, 28 Jul 2009 00:21:56 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77282 -
/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Message-ID: <200907280021.n6S0LuTe027526@zion.cs.uiuc.edu>
Author: bwilson
Date: Mon Jul 27 19:21:55 2009
New Revision: 77282
URL: http://llvm.org/viewvc/llvm-project?rev=77282&view=rev
Log:
Handle builtin functions with aggregate operands.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=77282&r1=77281&r2=77282&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 27 19:21:55 2009
@@ -4696,8 +4696,16 @@
// Get the result type and operand line in an easy to consume format.
const Type *ResultType = ConvertType(TREE_TYPE(TREE_TYPE(fndecl)));
std::vector Operands;
- for (tree Op = TREE_OPERAND(exp, 1); Op; Op = TREE_CHAIN(Op))
- Operands.push_back(Emit(TREE_VALUE(Op), 0));
+ for (tree Op = TREE_OPERAND(exp, 1); Op; Op = TREE_CHAIN(Op)) {
+ tree OpVal = TREE_VALUE(Op);
+ if (isAggregateTreeType(TREE_TYPE(OpVal))) {
+ MemRef OpLoc = CreateTempLoc(ConvertType(TREE_TYPE(OpVal)));
+ Emit(OpVal, &OpLoc);
+ Operands.push_back(Builder.CreateLoad(OpLoc.Ptr));
+ } else {
+ Operands.push_back(Emit(OpVal, NULL));
+ }
+ }
unsigned FnCode = DECL_FUNCTION_CODE(fndecl);
return LLVM_TARGET_INTRINSIC_LOWER(exp, FnCode, DestLoc, Result, ResultType,
From bob.wilson at apple.com Mon Jul 27 19:32:29 2009
From: bob.wilson at apple.com (Bob Wilson)
Date: Tue, 28 Jul 2009 00:32:29 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r77283 - in
/llvm-gcc-4.2/trunk/gcc/config/arm: arm.c arm_neon.h llvm-arm.cpp neon.ml
Message-ID: <200907280032.n6S0WT6f027821@zion.cs.uiuc.edu>
Author: bwilson
Date: Mon Jul 27 19:32:28 2009
New Revision: 77283
URL: http://llvm.org/viewvc/llvm-project?rev=77283&view=rev
Log:
Change llvm-gcc to use new builtin struct types for ARM Neon builtins that
operate on multiple adjacent vectors. gcc had been treating these arrays
of vectors as wide integers, and subsequent references to the individual
vectors were optimized by llvm to lshr/trunc/bitcast operations on the wide
integer values. With this change, llvm can optimize the vector references
to simple extractvalue operations, which get nicely folded away when
building SelectionDAGs for codegen.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
llvm-gcc-4.2/trunk/gcc/config/arm/arm_neon.h
llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
llvm-gcc-4.2/trunk/gcc/config/arm/neon.ml
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=77283&r1=77282&r2=77283&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Mon Jul 27 19:32:28 2009
@@ -16608,6 +16608,41 @@
}
/* APPLE LOCAL end 7083296 Build without warnings. */
+/* LLVM LOCAL begin multi-vector types */
+#ifdef ENABLE_LLVM
+/* Create a new builtin struct type containing NUMVECS fields (where NUMVECS
+ is in the range from 2 to 4) of type VECTYPE. */
+static tree
+build_multivec_type (tree vectype, unsigned numvecs, const char *tag)
+{
+ tree record, name, fields, fld;
+ char fldname[5];
+ unsigned n;
+
+ record = (*lang_hooks.types.make_type) (RECORD_TYPE);
+ name = build_decl (TYPE_DECL, get_identifier (tag), record);
+ TYPE_NAME (record) = name;
+
+ gcc_assert (numvecs >= 2 && numvecs <= 4);
+ fields = NULL;
+ for (n = 0; n < numvecs; ++n)
+ {
+ /* The fields are created in reverse order because it is easier to
+ chain them together that way. Number them accordingly. */
+ sprintf (fldname, "val%u", numvecs - n - 1);
+ fld = build_decl (FIELD_DECL, get_identifier (fldname), vectype);
+ DECL_FIELD_CONTEXT (fld) = record;
+ TREE_CHAIN (fld) = fields;
+ fields = fld;
+ }
+
+ TYPE_FIELDS (record) = fields;
+ layout_type (record);
+ return record;
+}
+#endif /* ENABLE_LLVM */
+/* LLVM LOCAL end multi-vector types */
+
static void
arm_init_neon_builtins (void)
{
@@ -16617,11 +16652,19 @@
#define qhi_TN neon_polyHI_type_node
#define si_TN neon_intSI_type_node
#define di_TN neon_intDI_type_node
+/* LLVM LOCAL begin multi-vector types */
+#ifdef ENABLE_LLVM
+#define ti_TN V8QI2_type_node
+#define ei_TN V8QI3_type_node
+#define oi_TN V8QI4_type_node
+#else
#define ti_TN intTI_type_node
#define ei_TN intEI_type_node
#define oi_TN intOI_type_node
#define ci_TN intCI_type_node
#define xi_TN intXI_type_node
+#endif
+/* LLVM LOCAL end multi-vector types */
#define sf_TN neon_float_type_node
@@ -16731,12 +16774,99 @@
tree intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode));
tree intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode));
+ /* LLVM LOCAL begin multi-vector types */
+#ifdef ENABLE_LLVM
+ tree V8QI2_type_node = build_multivec_type (V8QI_type_node, 2,
+ "__builtin_neon_v8qi2");
+ tree V4HI2_type_node = build_multivec_type (V4HI_type_node, 2,
+ "__builtin_neon_v4hi2");
+ tree V2SI2_type_node = build_multivec_type (V2SI_type_node, 2,
+ "__builtin_neon_v2si2");
+ tree DI2_type_node = build_multivec_type (neon_intDI_type_node, 2,
+ "__builtin_neon_di2");
+ tree V2SF2_type_node = build_multivec_type (V2SF_type_node, 2,
+ "__builtin_neon_v2sf2");
+ tree V8QI3_type_node = build_multivec_type (V8QI_type_node, 3,
+ "__builtin_neon_v8qi3");
+ tree V4HI3_type_node = build_multivec_type (V4HI_type_node, 3,
+ "__builtin_neon_v4hi3");
+ tree V2SI3_type_node = build_multivec_type (V2SI_type_node, 3,
+ "__builtin_neon_v2si3");
+ tree DI3_type_node = build_multivec_type (neon_intDI_type_node, 3,
+ "__builtin_neon_di3");
+ tree V2SF3_type_node = build_multivec_type (V2SF_type_node, 3,
+ "__builtin_neon_v2sf3");
+ tree V8QI4_type_node = build_multivec_type (V8QI_type_node, 4,
+ "__builtin_neon_v8qi4");
+ tree V4HI4_type_node = build_multivec_type (V4HI_type_node, 4,
+ "__builtin_neon_v4hi4");
+ tree V2SI4_type_node = build_multivec_type (V2SI_type_node, 4,
+ "__builtin_neon_v2si4");
+ tree DI4_type_node = build_multivec_type (neon_intDI_type_node, 4,
+ "__builtin_neon_di4");
+ tree V2SF4_type_node = build_multivec_type (V2SF_type_node, 4,
+ "__builtin_neon_v2sf4");
+ tree V16QI2_type_node = build_multivec_type (V16QI_type_node, 2,
+ "__builtin_neon_v16qi2");
+ tree V8HI2_type_node = build_multivec_type (V8HI_type_node, 2,
+ "__builtin_neon_v8hi2");
+ tree V4SI2_type_node = build_multivec_type (V4SI_type_node, 2,
+ "__builtin_neon_v4si2");
+ tree V4SF2_type_node = build_multivec_type (V4SF_type_node, 2,
+ "__builtin_neon_v4sf2");
+ tree V16QI3_type_node = build_multivec_type (V16QI_type_node, 3,
+ "__builtin_neon_v16qi3");
+ tree V8HI3_type_node = build_multivec_type (V8HI_type_node, 3,
+ "__builtin_neon_v8hi3");
+ tree V4SI3_type_node = build_multivec_type (V4SI_type_node, 3,
+ "__builtin_neon_v4si3");
+ tree V4SF3_type_node = build_multivec_type (V4SF_type_node, 3,
+ "__builtin_neon_v4sf3");
+ tree V16QI4_type_node = build_multivec_type (V16QI_type_node, 4,
+ "__builtin_neon_v16qi4");
+ tree V8HI4_type_node = build_multivec_type (V8HI_type_node, 4,
+ "__builtin_neon_v8hi4");
+ tree V4SI4_type_node = build_multivec_type (V4SI_type_node, 4,
+ "__builtin_neon_v4si4");
+ tree V4SF4_type_node = build_multivec_type (V4SF_type_node, 4,
+ "__builtin_neon_v4sf4");
+#else /* ENABLE_LLVM */
/* Opaque integer types for structures of vectors. */
tree intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode));
tree intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode));
tree intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode));
tree intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode));
+ tree V8QI2_type_node = intTI_type_node;
+ tree V4HI2_type_node = intTI_type_node;
+ tree V2SI2_type_node = intTI_type_node;
+ tree DI2_type_node = intTI_type_node;
+ tree V2SF2_type_node = intTI_type_node;
+ tree V8QI3_type_node = intEI_type_node;
+ tree V4HI3_type_node = intEI_type_node;
+ tree V2SI3_type_node = intEI_type_node;
+ tree DI3_type_node = intEI_type_node;
+ tree V2SF3_type_node = intEI_type_node;
+ tree V8QI4_type_node = intOI_type_node;
+ tree V4HI4_type_node = intOI_type_node;
+ tree V2SI4_type_node = intOI_type_node;
+ tree DI4_type_node = intOI_type_node;
+ tree V2SF4_type_node = intOI_type_node;
+ tree V16QI2_type_node = intOI_type_node;
+ tree V8HI2_type_node = intOI_type_node;
+ tree V4SI2_type_node = intOI_type_node;
+ tree V4SF2_type_node = intOI_type_node;
+ tree V16QI3_type_node = intCI_type_node;
+ tree V8HI3_type_node = intCI_type_node;
+ tree V4SI3_type_node = intCI_type_node;
+ tree V4SF3_type_node = intCI_type_node;
+ tree V16QI4_type_node = intXI_type_node;
+ tree V8HI4_type_node = intXI_type_node;
+ tree V4SI4_type_node = intXI_type_node;
+ tree V4SF4_type_node = intXI_type_node;
+#endif /* ENABLE_LLVM */
+ /* LLVM LOCAL end multi-vector types */
+
/* Pointers to vector types. */
tree V8QI_pointer_node = build_pointer_type (V8QI_type_node);
tree V4HI_pointer_node = build_pointer_type (V4HI_type_node);
@@ -17159,279 +17289,331 @@
V4SF_type_node, intSI_type_node, NULL);
/* Load size-2 structure operations, double-word. */
+ /* LLVM LOCAL begin multi-vector types */
+ /* LLVM: To minimize changes to the GCC source, the original wide-integer
+ mode abbrevations (ti, ei, oi, ci, and xi) have not been replaced by
+ vector-type-specific names (e.g., v8qi2, etc.) in the following
+ types. OI-mode values, however, are type-ambiguous: they can be
+ structs of 4 double-register vectors or 2 quad-register vectors. In
+ places where this ambiguity exists, "d" and "q" suffixes are added to
+ the "oi" name, i.e., "oid" and "oiq", to distinguish the double- and
+ quad-register types. */
tree ti_ftype_const_qi_pointer =
- build_function_type_list (intTI_type_node, const_intQI_pointer_node, NULL);
+ build_function_type_list (V8QI2_type_node, const_intQI_pointer_node, NULL);
tree ti_ftype_const_hi_pointer =
- build_function_type_list (intTI_type_node, const_intHI_pointer_node, NULL);
+ build_function_type_list (V4HI2_type_node, const_intHI_pointer_node, NULL);
tree ti_ftype_const_si_pointer =
- build_function_type_list (intTI_type_node, const_intSI_pointer_node, NULL);
+ build_function_type_list (V2SI2_type_node, const_intSI_pointer_node, NULL);
tree ti_ftype_const_di_pointer =
- build_function_type_list (intTI_type_node, const_intDI_pointer_node, NULL);
+ build_function_type_list (DI2_type_node, const_intDI_pointer_node, NULL);
tree ti_ftype_const_sf_pointer =
- build_function_type_list (intTI_type_node, const_float_pointer_node, NULL);
+ build_function_type_list (V2SF2_type_node, const_float_pointer_node, NULL);
/* Load size-2 structure operations, quad-word; also load size-4,
double-word. */
- tree oi_ftype_const_qi_pointer =
- build_function_type_list (intOI_type_node, const_intQI_pointer_node, NULL);
- tree oi_ftype_const_hi_pointer =
- build_function_type_list (intOI_type_node, const_intHI_pointer_node, NULL);
- tree oi_ftype_const_si_pointer =
- build_function_type_list (intOI_type_node, const_intSI_pointer_node, NULL);
- tree oi_ftype_const_sf_pointer =
- build_function_type_list (intOI_type_node, const_float_pointer_node, NULL);
+ tree oiq_ftype_const_qi_pointer =
+ build_function_type_list (V16QI2_type_node, const_intQI_pointer_node, NULL);
+ tree oiq_ftype_const_hi_pointer =
+ build_function_type_list (V8HI2_type_node, const_intHI_pointer_node, NULL);
+ tree oiq_ftype_const_si_pointer =
+ build_function_type_list (V4SI2_type_node, const_intSI_pointer_node, NULL);
+ tree oiq_ftype_const_sf_pointer =
+ build_function_type_list (V4SF2_type_node, const_float_pointer_node, NULL);
+
+ tree oid_ftype_const_qi_pointer =
+ build_function_type_list (V8QI4_type_node, const_intQI_pointer_node, NULL);
+ tree oid_ftype_const_hi_pointer =
+ build_function_type_list (V4HI4_type_node, const_intHI_pointer_node, NULL);
+ tree oid_ftype_const_si_pointer =
+ build_function_type_list (V2SI4_type_node, const_intSI_pointer_node, NULL);
+ tree oid_ftype_const_sf_pointer =
+ build_function_type_list (V2SF4_type_node, const_float_pointer_node, NULL);
/* Load lane size-2 structure operations, double-word. */
tree ti_ftype_const_qi_pointer_ti_si =
- build_function_type_list (intTI_type_node, const_intQI_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V8QI2_type_node, const_intQI_pointer_node,
+ V8QI2_type_node, intSI_type_node, NULL);
tree ti_ftype_const_hi_pointer_ti_si =
- build_function_type_list (intTI_type_node, const_intHI_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V4HI2_type_node, const_intHI_pointer_node,
+ V4HI2_type_node, intSI_type_node, NULL);
tree ti_ftype_const_si_pointer_ti_si =
- build_function_type_list (intTI_type_node, const_intSI_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V2SI2_type_node, const_intSI_pointer_node,
+ V2SI2_type_node, intSI_type_node, NULL);
tree ti_ftype_const_sf_pointer_ti_si =
- build_function_type_list (intTI_type_node, const_float_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V2SF2_type_node, const_float_pointer_node,
+ V2SF2_type_node, intSI_type_node, NULL);
/* Load lane size-2 structure operations, quad-word; also load lane size-4,
double-word. */
- tree oi_ftype_const_hi_pointer_oi_si =
- build_function_type_list (intOI_type_node, const_intHI_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
- tree oi_ftype_const_si_pointer_oi_si =
- build_function_type_list (intOI_type_node, const_intSI_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
- tree oi_ftype_const_sf_pointer_oi_si =
- build_function_type_list (intOI_type_node, const_float_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
+ tree oiq_ftype_const_hi_pointer_oiq_si =
+ build_function_type_list (V8HI2_type_node, const_intHI_pointer_node,
+ V8HI2_type_node, intSI_type_node, NULL);
+ tree oiq_ftype_const_si_pointer_oiq_si =
+ build_function_type_list (V4SI2_type_node, const_intSI_pointer_node,
+ V4SI2_type_node, intSI_type_node, NULL);
+ tree oiq_ftype_const_sf_pointer_oiq_si =
+ build_function_type_list (V4SF2_type_node, const_float_pointer_node,
+ V4SF2_type_node, intSI_type_node, NULL);
+
+ tree oid_ftype_const_hi_pointer_oid_si =
+ build_function_type_list (V4HI4_type_node, const_intHI_pointer_node,
+ V4HI4_type_node, intSI_type_node, NULL);
+ tree oid_ftype_const_si_pointer_oid_si =
+ build_function_type_list (V2SI4_type_node, const_intSI_pointer_node,
+ V2SI4_type_node, intSI_type_node, NULL);
+ tree oid_ftype_const_sf_pointer_oid_si =
+ build_function_type_list (V2SF4_type_node, const_float_pointer_node,
+ V2SF4_type_node, intSI_type_node, NULL);
/* Store size-2 structure operations, double-word. */
tree void_ftype_qi_pointer_ti =
build_function_type_list (void_type_node, intQI_pointer_node,
- intTI_type_node, NULL);
+ V8QI2_type_node, NULL);
tree void_ftype_hi_pointer_ti =
build_function_type_list (void_type_node, intHI_pointer_node,
- intTI_type_node, NULL);
+ V4HI2_type_node, NULL);
tree void_ftype_si_pointer_ti =
build_function_type_list (void_type_node, intSI_pointer_node,
- intTI_type_node, NULL);
+ V2SI2_type_node, NULL);
tree void_ftype_di_pointer_ti =
build_function_type_list (void_type_node, intDI_pointer_node,
- intTI_type_node, NULL);
+ DI2_type_node, NULL);
tree void_ftype_sf_pointer_ti =
build_function_type_list (void_type_node, float_pointer_node,
- intTI_type_node, NULL);
+ V2SF2_type_node, NULL);
/* Store size-2 structure operations, quad-word; also store size-4,
double-word. */
- tree void_ftype_qi_pointer_oi =
+ tree void_ftype_qi_pointer_oiq =
build_function_type_list (void_type_node, intQI_pointer_node,
- intOI_type_node, NULL);
- tree void_ftype_hi_pointer_oi =
+ V16QI2_type_node, NULL);
+ tree void_ftype_hi_pointer_oiq =
build_function_type_list (void_type_node, intHI_pointer_node,
- intOI_type_node, NULL);
- tree void_ftype_si_pointer_oi =
+ V8HI2_type_node, NULL);
+ tree void_ftype_si_pointer_oiq =
build_function_type_list (void_type_node, intSI_pointer_node,
- intOI_type_node, NULL);
- tree void_ftype_sf_pointer_oi =
+ V4SI2_type_node, NULL);
+ tree void_ftype_sf_pointer_oiq =
build_function_type_list (void_type_node, float_pointer_node,
- intOI_type_node, NULL);
+ V4SF2_type_node, NULL);
+
+ tree void_ftype_qi_pointer_oid =
+ build_function_type_list (void_type_node, intQI_pointer_node,
+ V8QI4_type_node, NULL);
+ tree void_ftype_hi_pointer_oid =
+ build_function_type_list (void_type_node, intHI_pointer_node,
+ V4HI4_type_node, NULL);
+ tree void_ftype_si_pointer_oid =
+ build_function_type_list (void_type_node, intSI_pointer_node,
+ V2SI4_type_node, NULL);
+ tree void_ftype_sf_pointer_oid =
+ build_function_type_list (void_type_node, float_pointer_node,
+ V2SF4_type_node, NULL);
/* Store lane size-2 structure operations, double-word. */
tree void_ftype_qi_pointer_ti_si =
build_function_type_list (void_type_node, intQI_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ V8QI2_type_node, intSI_type_node, NULL);
tree void_ftype_hi_pointer_ti_si =
build_function_type_list (void_type_node, intHI_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ V4HI2_type_node, intSI_type_node, NULL);
tree void_ftype_si_pointer_ti_si =
build_function_type_list (void_type_node, intSI_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ V2SI2_type_node, intSI_type_node, NULL);
tree void_ftype_sf_pointer_ti_si =
build_function_type_list (void_type_node, float_pointer_node,
- intTI_type_node, intSI_type_node, NULL);
+ V2SF2_type_node, intSI_type_node, NULL);
/* Store lane size-2 structure operations, quad-word; also store
lane size-4, double-word. */
- tree void_ftype_hi_pointer_oi_si =
+ tree void_ftype_hi_pointer_oiq_si =
+ build_function_type_list (void_type_node, intHI_pointer_node,
+ V8HI2_type_node, intSI_type_node, NULL);
+ tree void_ftype_si_pointer_oiq_si =
+ build_function_type_list (void_type_node, intSI_pointer_node,
+ V4SI2_type_node, intSI_type_node, NULL);
+ tree void_ftype_sf_pointer_oiq_si =
+ build_function_type_list (void_type_node, float_pointer_node,
+ V4SF2_type_node, intSI_type_node, NULL);
+
+ tree void_ftype_hi_pointer_oid_si =
build_function_type_list (void_type_node, intHI_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
- tree void_ftype_si_pointer_oi_si =
+ V4HI4_type_node, intSI_type_node, NULL);
+ tree void_ftype_si_pointer_oid_si =
build_function_type_list (void_type_node, intSI_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
- tree void_ftype_sf_pointer_oi_si =
+ V2SI4_type_node, intSI_type_node, NULL);
+ tree void_ftype_sf_pointer_oid_si =
build_function_type_list (void_type_node, float_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
+ V2SF4_type_node, intSI_type_node, NULL);
/* Load size-3 structure operations, double-word. */
tree ei_ftype_const_qi_pointer =
- build_function_type_list (intEI_type_node, const_intQI_pointer_node, NULL);
+ build_function_type_list (V8QI3_type_node, const_intQI_pointer_node, NULL);
tree ei_ftype_const_hi_pointer =
- build_function_type_list (intEI_type_node, const_intHI_pointer_node, NULL);
+ build_function_type_list (V4HI3_type_node, const_intHI_pointer_node, NULL);
tree ei_ftype_const_si_pointer =
- build_function_type_list (intEI_type_node, const_intSI_pointer_node, NULL);
+ build_function_type_list (V2SI3_type_node, const_intSI_pointer_node, NULL);
tree ei_ftype_const_di_pointer =
- build_function_type_list (intEI_type_node, const_intDI_pointer_node, NULL);
+ build_function_type_list (DI3_type_node, const_intDI_pointer_node, NULL);
tree ei_ftype_const_sf_pointer =
- build_function_type_list (intEI_type_node, const_float_pointer_node, NULL);
+ build_function_type_list (V2SF3_type_node, const_float_pointer_node, NULL);
/* Load size-3 structure operations, quad-word. */
tree ci_ftype_const_qi_pointer =
- build_function_type_list (intCI_type_node, const_intQI_pointer_node, NULL);
+ build_function_type_list (V16QI3_type_node, const_intQI_pointer_node, NULL);
tree ci_ftype_const_hi_pointer =
- build_function_type_list (intCI_type_node, const_intHI_pointer_node, NULL);
+ build_function_type_list (V8HI3_type_node, const_intHI_pointer_node, NULL);
tree ci_ftype_const_si_pointer =
- build_function_type_list (intCI_type_node, const_intSI_pointer_node, NULL);
+ build_function_type_list (V4SI3_type_node, const_intSI_pointer_node, NULL);
tree ci_ftype_const_sf_pointer =
- build_function_type_list (intCI_type_node, const_float_pointer_node, NULL);
+ build_function_type_list (V4SF3_type_node, const_float_pointer_node, NULL);
/* Load lane size-3 structure operations, double-word. */
tree ei_ftype_const_qi_pointer_ei_si =
- build_function_type_list (intEI_type_node, const_intQI_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V8QI3_type_node, const_intQI_pointer_node,
+ V8QI3_type_node, intSI_type_node, NULL);
tree ei_ftype_const_hi_pointer_ei_si =
- build_function_type_list (intEI_type_node, const_intHI_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V4HI3_type_node, const_intHI_pointer_node,
+ V4HI3_type_node, intSI_type_node, NULL);
tree ei_ftype_const_si_pointer_ei_si =
- build_function_type_list (intEI_type_node, const_intSI_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V2SI3_type_node, const_intSI_pointer_node,
+ V2SI3_type_node, intSI_type_node, NULL);
tree ei_ftype_const_sf_pointer_ei_si =
- build_function_type_list (intEI_type_node, const_float_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V2SF3_type_node, const_float_pointer_node,
+ V2SF3_type_node, intSI_type_node, NULL);
/* Load lane size-3 structure operations, quad-word. */
tree ci_ftype_const_hi_pointer_ci_si =
- build_function_type_list (intCI_type_node, const_intHI_pointer_node,
- intCI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V8HI3_type_node, const_intHI_pointer_node,
+ V8HI3_type_node, intSI_type_node, NULL);
tree ci_ftype_const_si_pointer_ci_si =
- build_function_type_list (intCI_type_node, const_intSI_pointer_node,
- intCI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V4SI3_type_node, const_intSI_pointer_node,
+ V4SI3_type_node, intSI_type_node, NULL);
tree ci_ftype_const_sf_pointer_ci_si =
- build_function_type_list (intCI_type_node, const_float_pointer_node,
- intCI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V4SF3_type_node, const_float_pointer_node,
+ V4SF3_type_node, intSI_type_node, NULL);
/* Store size-3 structure operations, double-word. */
tree void_ftype_qi_pointer_ei =
build_function_type_list (void_type_node, intQI_pointer_node,
- intEI_type_node, NULL);
+ V8QI3_type_node, NULL);
tree void_ftype_hi_pointer_ei =
build_function_type_list (void_type_node, intHI_pointer_node,
- intEI_type_node, NULL);
+ V4HI3_type_node, NULL);
tree void_ftype_si_pointer_ei =
build_function_type_list (void_type_node, intSI_pointer_node,
- intEI_type_node, NULL);
+ V2SI3_type_node, NULL);
tree void_ftype_di_pointer_ei =
build_function_type_list (void_type_node, intDI_pointer_node,
- intEI_type_node, NULL);
+ DI3_type_node, NULL);
tree void_ftype_sf_pointer_ei =
build_function_type_list (void_type_node, float_pointer_node,
- intEI_type_node, NULL);
+ V2SF3_type_node, NULL);
/* Store size-3 structure operations, quad-word. */
tree void_ftype_qi_pointer_ci =
build_function_type_list (void_type_node, intQI_pointer_node,
- intCI_type_node, NULL);
+ V16QI3_type_node, NULL);
tree void_ftype_hi_pointer_ci =
build_function_type_list (void_type_node, intHI_pointer_node,
- intCI_type_node, NULL);
+ V8HI3_type_node, NULL);
tree void_ftype_si_pointer_ci =
build_function_type_list (void_type_node, intSI_pointer_node,
- intCI_type_node, NULL);
+ V4SI3_type_node, NULL);
tree void_ftype_sf_pointer_ci =
build_function_type_list (void_type_node, float_pointer_node,
- intCI_type_node, NULL);
+ V4SF3_type_node, NULL);
/* Store lane size-3 structure operations, double-word. */
tree void_ftype_qi_pointer_ei_si =
build_function_type_list (void_type_node, intQI_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ V8QI3_type_node, intSI_type_node, NULL);
tree void_ftype_hi_pointer_ei_si =
build_function_type_list (void_type_node, intHI_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ V4HI3_type_node, intSI_type_node, NULL);
tree void_ftype_si_pointer_ei_si =
build_function_type_list (void_type_node, intSI_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ V2SI3_type_node, intSI_type_node, NULL);
tree void_ftype_sf_pointer_ei_si =
build_function_type_list (void_type_node, float_pointer_node,
- intEI_type_node, intSI_type_node, NULL);
+ V2SF3_type_node, intSI_type_node, NULL);
/* Store lane size-3 structure operations, quad-word. */
tree void_ftype_hi_pointer_ci_si =
build_function_type_list (void_type_node, intHI_pointer_node,
- intCI_type_node, intSI_type_node, NULL);
+ V8HI3_type_node, intSI_type_node, NULL);
tree void_ftype_si_pointer_ci_si =
build_function_type_list (void_type_node, intSI_pointer_node,
- intCI_type_node, intSI_type_node, NULL);
+ V4SI3_type_node, intSI_type_node, NULL);
tree void_ftype_sf_pointer_ci_si =
build_function_type_list (void_type_node, float_pointer_node,
- intCI_type_node, intSI_type_node, NULL);
+ V4SF3_type_node, intSI_type_node, NULL);
/* Load size-4 structure operations, double-word. */
tree oi_ftype_const_di_pointer =
- build_function_type_list (intOI_type_node, const_intDI_pointer_node, NULL);
+ build_function_type_list (DI4_type_node, const_intDI_pointer_node, NULL);
/* Load size-4 structure operations, quad-word. */
tree xi_ftype_const_qi_pointer =
- build_function_type_list (intXI_type_node, const_intQI_pointer_node, NULL);
+ build_function_type_list (V16QI4_type_node, const_intQI_pointer_node, NULL);
tree xi_ftype_const_hi_pointer =
- build_function_type_list (intXI_type_node, const_intHI_pointer_node, NULL);
+ build_function_type_list (V8HI4_type_node, const_intHI_pointer_node, NULL);
tree xi_ftype_const_si_pointer =
- build_function_type_list (intXI_type_node, const_intSI_pointer_node, NULL);
+ build_function_type_list (V4SI4_type_node, const_intSI_pointer_node, NULL);
tree xi_ftype_const_sf_pointer =
- build_function_type_list (intXI_type_node, const_float_pointer_node, NULL);
+ build_function_type_list (V4SF4_type_node, const_float_pointer_node, NULL);
/* Load lane size-4 structure operations, double-word. */
tree oi_ftype_const_qi_pointer_oi_si =
- build_function_type_list (intOI_type_node, const_intQI_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V8QI4_type_node, const_intQI_pointer_node,
+ V8QI4_type_node, intSI_type_node, NULL);
/* Load lane size-4 structure operations, quad-word. */
tree xi_ftype_const_hi_pointer_xi_si =
- build_function_type_list (intXI_type_node, const_intHI_pointer_node,
- intXI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V8HI4_type_node, const_intHI_pointer_node,
+ V8HI4_type_node, intSI_type_node, NULL);
tree xi_ftype_const_si_pointer_xi_si =
- build_function_type_list (intXI_type_node, const_intSI_pointer_node,
- intXI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V4SI4_type_node, const_intSI_pointer_node,
+ V4SI4_type_node, intSI_type_node, NULL);
tree xi_ftype_const_sf_pointer_xi_si =
- build_function_type_list (intXI_type_node, const_float_pointer_node,
- intXI_type_node, intSI_type_node, NULL);
+ build_function_type_list (V4SF4_type_node, const_float_pointer_node,
+ V4SF4_type_node, intSI_type_node, NULL);
/* Store size-4 structure operations, double-word. */
tree void_ftype_di_pointer_oi =
build_function_type_list (void_type_node, intDI_pointer_node,
- intOI_type_node, NULL);
+ DI4_type_node, NULL);
/* Store size-4 structure operations, quad-word. */
tree void_ftype_qi_pointer_xi =
build_function_type_list (void_type_node, intQI_pointer_node,
- intXI_type_node, NULL);
+ V16QI4_type_node, NULL);
tree void_ftype_hi_pointer_xi =
build_function_type_list (void_type_node, intHI_pointer_node,
- intXI_type_node, NULL);
+ V8HI4_type_node, NULL);
tree void_ftype_si_pointer_xi =
build_function_type_list (void_type_node, intSI_pointer_node,
- intXI_type_node, NULL);
+ V4SI4_type_node, NULL);
tree void_ftype_sf_pointer_xi =
build_function_type_list (void_type_node, float_pointer_node,
- intXI_type_node, NULL);
+ V4SF4_type_node, NULL);
/* Store lane size-4 structure operations, double-word. */
tree void_ftype_qi_pointer_oi_si =
build_function_type_list (void_type_node, intQI_pointer_node,
- intOI_type_node, intSI_type_node, NULL);
+ V8QI4_type_node, intSI_type_node, NULL);
/* Store lane size-4 structure operations, quad-word. */
tree void_ftype_hi_pointer_xi_si =
build_function_type_list (void_type_node, intHI_pointer_node,
- intXI_type_node, intSI_type_node, NULL);
+ V8HI4_type_node, intSI_type_node, NULL);
tree void_ftype_si_pointer_xi_si =
build_function_type_list (void_type_node, intSI_pointer_node,
- intXI_type_node, intSI_type_node, NULL);
+ V4SI4_type_node, intSI_type_node, NULL);
tree void_ftype_sf_pointer_xi_si =
build_function_type_list (void_type_node, float_pointer_node,
- intXI_type_node, intSI_type_node, NULL);
+ V4SF4_type_node, intSI_type_node, NULL);
+ /* LLVM LOCAL end multi-vector types */
tree reinterp_ftype_dreg[5][5];
tree reinterp_ftype_qreg[5][5];
@@ -17466,16 +17648,62 @@
(*lang_hooks.types.register_builtin_type) (intUDI_type_node,
"__builtin_neon_udi");
- (*lang_hooks.types.register_builtin_type) (intTI_type_node,
- "__builtin_neon_ti");
- (*lang_hooks.types.register_builtin_type) (intEI_type_node,
- "__builtin_neon_ei");
- (*lang_hooks.types.register_builtin_type) (intOI_type_node,
- "__builtin_neon_oi");
- (*lang_hooks.types.register_builtin_type) (intCI_type_node,
- "__builtin_neon_ci");
- (*lang_hooks.types.register_builtin_type) (intXI_type_node,
- "__builtin_neon_xi");
+ /* LLVM LOCAL begin multi-vector types */
+ (*lang_hooks.types.register_builtin_type) (V8QI2_type_node,
+ "__builtin_neon_v8qi2");
+ (*lang_hooks.types.register_builtin_type) (V4HI2_type_node,
+ "__builtin_neon_v4hi2");
+ (*lang_hooks.types.register_builtin_type) (V2SI2_type_node,
+ "__builtin_neon_v2si2");
+ (*lang_hooks.types.register_builtin_type) (DI2_type_node,
+ "__builtin_neon_di2");
+ (*lang_hooks.types.register_builtin_type) (V2SF2_type_node,
+ "__builtin_neon_v2sf2");
+ (*lang_hooks.types.register_builtin_type) (V8QI3_type_node,
+ "__builtin_neon_v8qi3");
+ (*lang_hooks.types.register_builtin_type) (V4HI3_type_node,
+ "__builtin_neon_v4hi3");
+ (*lang_hooks.types.register_builtin_type) (V2SI3_type_node,
+ "__builtin_neon_v2si3");
+ (*lang_hooks.types.register_builtin_type) (DI3_type_node,
+ "__builtin_neon_di3");
+ (*lang_hooks.types.register_builtin_type) (V2SF3_type_node,
+ "__builtin_neon_v2sf3");
+ (*lang_hooks.types.register_builtin_type) (V8QI4_type_node,
+ "__builtin_neon_v8qi4");
+ (*lang_hooks.types.register_builtin_type) (V4HI4_type_node,
+ "__builtin_neon_v4hi4");
+ (*lang_hooks.types.register_builtin_type) (V2SI4_type_node,
+ "__builtin_neon_v2si4");
+ (*lang_hooks.types.register_builtin_type) (DI4_type_node,
+ "__builtin_neon_di4");
+ (*lang_hooks.types.register_builtin_type) (V2SF4_type_node,
+ "__builtin_neon_v2sf4");
+ (*lang_hooks.types.register_builtin_type) (V16QI2_type_node,
+ "__builtin_neon_v16qi2");
+ (*lang_hooks.types.register_builtin_type) (V8HI2_type_node,
+ "__builtin_neon_v8hi2");
+ (*lang_hooks.types.register_builtin_type) (V4SI2_type_node,
+ "__builtin_neon_v4si2");
+ (*lang_hooks.types.register_builtin_type) (V4SF2_type_node,
+ "__builtin_neon_v4sf2");
+ (*lang_hooks.types.register_builtin_type) (V16QI3_type_node,
+ "__builtin_neon_v16qi3");
+ (*lang_hooks.types.register_builtin_type) (V8HI3_type_node,
+ "__builtin_neon_v8hi3");
+ (*lang_hooks.types.register_builtin_type) (V4SI3_type_node,
+ "__builtin_neon_v4si3");
+ (*lang_hooks.types.register_builtin_type) (V4SF3_type_node,
+ "__builtin_neon_v4sf3");
+ (*lang_hooks.types.register_builtin_type) (V16QI4_type_node,
+ "__builtin_neon_v16qi4");
+ (*lang_hooks.types.register_builtin_type) (V8HI4_type_node,
+ "__builtin_neon_v8hi4");
+ (*lang_hooks.types.register_builtin_type) (V4SI4_type_node,
+ "__builtin_neon_v4si4");
+ (*lang_hooks.types.register_builtin_type) (V4SF4_type_node,
+ "__builtin_neon_v4sf4");
+ /* LLVM LOCAL end multi-vector types */
/* APPLE LOCAL end 7083296 Build without warnings. */
dreg_types[0] = V8QI_type_node;
@@ -18663,15 +18891,17 @@
switch (1 << j)
{
/* vld2q cases. */
- case T_V16QI: ftype = oi_ftype_const_qi_pointer; break;
- case T_V8HI: ftype = oi_ftype_const_hi_pointer; break;
- case T_V4SI: ftype = oi_ftype_const_si_pointer; break;
- case T_V4SF: ftype = oi_ftype_const_sf_pointer; break;
+ /* LLVM LOCAL begin multi-vector types */
+ case T_V16QI: ftype = oiq_ftype_const_qi_pointer; break;
+ case T_V8HI: ftype = oiq_ftype_const_hi_pointer; break;
+ case T_V4SI: ftype = oiq_ftype_const_si_pointer; break;
+ case T_V4SF: ftype = oiq_ftype_const_sf_pointer; break;
/* vld4 cases. */
- case T_V8QI: ftype = oi_ftype_const_qi_pointer; break;
- case T_V4HI: ftype = oi_ftype_const_hi_pointer; break;
- case T_V2SI: ftype = oi_ftype_const_si_pointer; break;
- case T_V2SF: ftype = oi_ftype_const_sf_pointer; break;
+ case T_V8QI: ftype = oid_ftype_const_qi_pointer; break;
+ case T_V4HI: ftype = oid_ftype_const_hi_pointer; break;
+ case T_V2SI: ftype = oid_ftype_const_si_pointer; break;
+ case T_V2SF: ftype = oid_ftype_const_sf_pointer; break;
+ /* LLVM LOCAL end multi-vector types */
case T_DI: ftype = oi_ftype_const_di_pointer; break;
default: gcc_unreachable ();
}
@@ -18756,28 +18986,30 @@
switch (1 << j)
{
/* vld2q_lane cases. */
+ /* LLVM LOCAL begin multi-vector types */
case T_V8HI:
- ftype = oi_ftype_const_hi_pointer_oi_si;
+ ftype = oiq_ftype_const_hi_pointer_oiq_si;
break;
case T_V4SI:
- ftype = oi_ftype_const_si_pointer_oi_si;
+ ftype = oiq_ftype_const_si_pointer_oiq_si;
break;
case T_V4SF:
- ftype = oi_ftype_const_sf_pointer_oi_si;
+ ftype = oiq_ftype_const_sf_pointer_oiq_si;
break;
/* vld4_lane cases. */
case T_V8QI:
ftype = oi_ftype_const_qi_pointer_oi_si;
break;
case T_V4HI:
- ftype = oi_ftype_const_hi_pointer_oi_si;
+ ftype = oid_ftype_const_hi_pointer_oid_si;
break;
case T_V2SI:
- ftype = oi_ftype_const_si_pointer_oi_si;
+ ftype = oid_ftype_const_si_pointer_oid_si;
break;
case T_V2SF:
- ftype = oi_ftype_const_sf_pointer_oi_si;
+ ftype = oid_ftype_const_sf_pointer_oid_si;
break;
+ /* LLVM LOCAL end multi-vector types */
default:
gcc_unreachable ();
}
@@ -18859,15 +19091,17 @@
switch (1 << j)
{
/* vst2q cases. */
- case T_V16QI: ftype = void_ftype_qi_pointer_oi; break;
- case T_V8HI: ftype = void_ftype_hi_pointer_oi; break;
- case T_V4SI: ftype = void_ftype_si_pointer_oi; break;
- case T_V4SF: ftype = void_ftype_sf_pointer_oi; break;
+ /* LLVM LOCAL begin multi-vector types */
+ case T_V16QI: ftype = void_ftype_qi_pointer_oiq; break;
+ case T_V8HI: ftype = void_ftype_hi_pointer_oiq; break;
+ case T_V4SI: ftype = void_ftype_si_pointer_oiq; break;
+ case T_V4SF: ftype = void_ftype_sf_pointer_oiq; break;
/* vst4 cases. */
- case T_V8QI: ftype = void_ftype_qi_pointer_oi; break;
- case T_V4HI: ftype = void_ftype_hi_pointer_oi; break;
- case T_V2SI: ftype = void_ftype_si_pointer_oi; break;
- case T_V2SF: ftype = void_ftype_sf_pointer_oi; break;
+ case T_V8QI: ftype = void_ftype_qi_pointer_oid; break;
+ case T_V4HI: ftype = void_ftype_hi_pointer_oid; break;
+ case T_V2SI: ftype = void_ftype_si_pointer_oid; break;
+ case T_V2SF: ftype = void_ftype_sf_pointer_oid; break;
+ /* LLVM LOCAL end multi-vector types */
case T_DI: ftype = void_ftype_di_pointer_oi; break;
default: gcc_unreachable ();
}
@@ -18952,28 +19186,30 @@
switch (1 << j)
{
/* vst2q_lane cases. */
+ /* LLVM LOCAL begin multi-vector types */
case T_V8HI:
- ftype = void_ftype_hi_pointer_oi_si;
+ ftype = void_ftype_hi_pointer_oiq_si;
break;
case T_V4SI:
- ftype = void_ftype_si_pointer_oi_si;
+ ftype = void_ftype_si_pointer_oiq_si;
break;
case T_V4SF:
- ftype = void_ftype_sf_pointer_oi_si;
+ ftype = void_ftype_sf_pointer_oiq_si;
break;
/* vst4_lane cases. */
case T_V8QI:
ftype = void_ftype_qi_pointer_oi_si;
break;
case T_V4HI:
- ftype = void_ftype_hi_pointer_oi_si;
+ ftype = void_ftype_hi_pointer_oid_si;
break;
case T_V2SI:
- ftype = void_ftype_si_pointer_oi_si;
+ ftype = void_ftype_si_pointer_oid_si;
break;
case T_V2SF:
- ftype = void_ftype_sf_pointer_oi_si;
+ ftype = void_ftype_sf_pointer_oid_si;
break;
+ /* LLVM LOCAL end multi-vector types */
default:
gcc_unreachable ();
}
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm_neon.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm_neon.h?rev=77283&r1=77282&r2=77283&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm_neon.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm_neon.h Mon Jul 27 19:32:28 2009
@@ -3253,55 +3253,55 @@
#define vtbl2_s8(__a, __b) \
({ \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __au = { __a }; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __au = { __a }; \
(int8x8_t)__builtin_neon_vtbl2v8qi (__au.__o, __b); \
})
#define vtbl2_u8(__a, __b) \
({ \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __au = { __a }; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __au = { __a }; \
(uint8x8_t)__builtin_neon_vtbl2v8qi (__au.__o, __b); \
})
#define vtbl2_p8(__a, __b) \
({ \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __au = { __a }; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __au = { __a }; \
(poly8x8_t)__builtin_neon_vtbl2v8qi (__au.__o, __b); \
})
#define vtbl3_s8(__a, __b) \
({ \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __au = { __a }; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __au = { __a }; \
(int8x8_t)__builtin_neon_vtbl3v8qi (__au.__o, __b); \
})
#define vtbl3_u8(__a, __b) \
({ \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __au = { __a }; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __au = { __a }; \
(uint8x8_t)__builtin_neon_vtbl3v8qi (__au.__o, __b); \
})
#define vtbl3_p8(__a, __b) \
({ \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __au = { __a }; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __au = { __a }; \
(poly8x8_t)__builtin_neon_vtbl3v8qi (__au.__o, __b); \
})
#define vtbl4_s8(__a, __b) \
({ \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __au = { __a }; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __au = { __a }; \
(int8x8_t)__builtin_neon_vtbl4v8qi (__au.__o, __b); \
})
#define vtbl4_u8(__a, __b) \
({ \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __au = { __a }; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __au = { __a }; \
(uint8x8_t)__builtin_neon_vtbl4v8qi (__au.__o, __b); \
})
#define vtbl4_p8(__a, __b) \
({ \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __au = { __a }; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __au = { __a }; \
(poly8x8_t)__builtin_neon_vtbl4v8qi (__au.__o, __b); \
})
@@ -3316,55 +3316,55 @@
#define vtbx2_s8(__a, __b, __c) \
({ \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
(int8x8_t)__builtin_neon_vtbx2v8qi (__a, __bu.__o, __c); \
})
#define vtbx2_u8(__a, __b, __c) \
({ \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
(uint8x8_t)__builtin_neon_vtbx2v8qi (__a, __bu.__o, __c); \
})
#define vtbx2_p8(__a, __b, __c) \
({ \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
(poly8x8_t)__builtin_neon_vtbx2v8qi (__a, __bu.__o, __c); \
})
#define vtbx3_s8(__a, __b, __c) \
({ \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
(int8x8_t)__builtin_neon_vtbx3v8qi (__a, __bu.__o, __c); \
})
#define vtbx3_u8(__a, __b, __c) \
({ \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
(uint8x8_t)__builtin_neon_vtbx3v8qi (__a, __bu.__o, __c); \
})
#define vtbx3_p8(__a, __b, __c) \
({ \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
(poly8x8_t)__builtin_neon_vtbx3v8qi (__a, __bu.__o, __c); \
})
#define vtbx4_s8(__a, __b, __c) \
({ \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
(int8x8_t)__builtin_neon_vtbx4v8qi (__a, __bu.__o, __c); \
})
#define vtbx4_u8(__a, __b, __c) \
({ \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
(uint8x8_t)__builtin_neon_vtbx4v8qi (__a, __bu.__o, __c); \
})
#define vtbx4_p8(__a, __b, __c) \
({ \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
(poly8x8_t)__builtin_neon_vtbx4v8qi (__a, __bu.__o, __c); \
})
@@ -4654,1642 +4654,1642 @@
#define vld2_s8(__a) \
({ \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v8qi (__a); \
__rv.__i; \
})
#define vld2_s16(__a) \
({ \
- union { int16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v4hi (__a); \
__rv.__i; \
})
#define vld2_s32(__a) \
({ \
- union { int32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int32x2x2_t __i; __builtin_neon_v2si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v2si (__a); \
__rv.__i; \
})
#define vld2_f32(__a) \
({ \
- union { float32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { float32x2x2_t __i; __builtin_neon_v2sf2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v2sf (__a); \
__rv.__i; \
})
#define vld2_u8(__a) \
({ \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v8qi (__a); \
__rv.__i; \
})
#define vld2_u16(__a) \
({ \
- union { uint16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v4hi (__a); \
__rv.__i; \
})
#define vld2_u32(__a) \
({ \
- union { uint32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint32x2x2_t __i; __builtin_neon_v2si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v2si (__a); \
__rv.__i; \
})
#define vld2_p8(__a) \
({ \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v8qi (__a); \
__rv.__i; \
})
#define vld2_p16(__a) \
({ \
- union { poly16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { poly16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v4hi (__a); \
__rv.__i; \
})
#define vld2_s64(__a) \
({ \
- union { int64x1x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int64x1x2_t __i; __builtin_neon_di2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2di (__a); \
__rv.__i; \
})
#define vld2_u64(__a) \
({ \
- union { uint64x1x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint64x1x2_t __i; __builtin_neon_di2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2di (__a); \
__rv.__i; \
})
#define vld2q_s8(__a) \
({ \
- union { int8x16x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int8x16x2_t __i; __builtin_neon_v16qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v16qi (__a); \
__rv.__i; \
})
#define vld2q_s16(__a) \
({ \
- union { int16x8x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int16x8x2_t __i; __builtin_neon_v8hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v8hi (__a); \
__rv.__i; \
})
#define vld2q_s32(__a) \
({ \
- union { int32x4x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int32x4x2_t __i; __builtin_neon_v4si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v4si (__a); \
__rv.__i; \
})
#define vld2q_f32(__a) \
({ \
- union { float32x4x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { float32x4x2_t __i; __builtin_neon_v4sf2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v4sf (__a); \
__rv.__i; \
})
#define vld2q_u8(__a) \
({ \
- union { uint8x16x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint8x16x2_t __i; __builtin_neon_v16qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v16qi (__a); \
__rv.__i; \
})
#define vld2q_u16(__a) \
({ \
- union { uint16x8x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint16x8x2_t __i; __builtin_neon_v8hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v8hi (__a); \
__rv.__i; \
})
#define vld2q_u32(__a) \
({ \
- union { uint32x4x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint32x4x2_t __i; __builtin_neon_v4si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v4si (__a); \
__rv.__i; \
})
#define vld2q_p8(__a) \
({ \
- union { poly8x16x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly8x16x2_t __i; __builtin_neon_v16qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v16qi (__a); \
__rv.__i; \
})
#define vld2q_p16(__a) \
({ \
- union { poly16x8x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly16x8x2_t __i; __builtin_neon_v8hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2v8hi (__a); \
__rv.__i; \
})
#define vld2_lane_s8(__a, __b, __c) \
({ \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_s16(__a, __b, __c) \
({ \
- union { int16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { int16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
+ union { int16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_s32(__a, __b, __c) \
({ \
- union { int32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { int32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int32x2x2_t __i; __builtin_neon_v2si2 __o; } __bu = { __b }; \
+ union { int32x2x2_t __i; __builtin_neon_v2si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev2si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_f32(__a, __b, __c) \
({ \
- union { float32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { float32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { float32x2x2_t __i; __builtin_neon_v2sf2 __o; } __bu = { __b }; \
+ union { float32x2x2_t __i; __builtin_neon_v2sf2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev2sf (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_u8(__a, __b, __c) \
({ \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_u16(__a, __b, __c) \
({ \
- union { uint16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { uint16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
+ union { uint16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_u32(__a, __b, __c) \
({ \
- union { uint32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { uint32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint32x2x2_t __i; __builtin_neon_v2si2 __o; } __bu = { __b }; \
+ union { uint32x2x2_t __i; __builtin_neon_v2si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev2si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_p8(__a, __b, __c) \
({ \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_lane_p16(__a, __b, __c) \
({ \
- union { poly16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
- union { poly16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { poly16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
+ union { poly16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2q_lane_s16(__a, __b, __c) \
({ \
- union { int16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { int16x8x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
+ union { int16x8x2_t __i; __builtin_neon_v8hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2q_lane_s32(__a, __b, __c) \
({ \
- union { int32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { int32x4x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int32x4x2_t __i; __builtin_neon_v4si2 __o; } __bu = { __b }; \
+ union { int32x4x2_t __i; __builtin_neon_v4si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev4si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2q_lane_f32(__a, __b, __c) \
({ \
- union { float32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { float32x4x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { float32x4x2_t __i; __builtin_neon_v4sf2 __o; } __bu = { __b }; \
+ union { float32x4x2_t __i; __builtin_neon_v4sf2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev4sf (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2q_lane_u16(__a, __b, __c) \
({ \
- union { uint16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { uint16x8x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
+ union { uint16x8x2_t __i; __builtin_neon_v8hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2q_lane_u32(__a, __b, __c) \
({ \
- union { uint32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { uint32x4x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint32x4x2_t __i; __builtin_neon_v4si2 __o; } __bu = { __b }; \
+ union { uint32x4x2_t __i; __builtin_neon_v4si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev4si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2q_lane_p16(__a, __b, __c) \
({ \
- union { poly16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { poly16x8x2_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
+ union { poly16x8x2_t __i; __builtin_neon_v8hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld2_dup_s8(__a) \
({ \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv8qi (__a); \
__rv.__i; \
})
#define vld2_dup_s16(__a) \
({ \
- union { int16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv4hi (__a); \
__rv.__i; \
})
#define vld2_dup_s32(__a) \
({ \
- union { int32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int32x2x2_t __i; __builtin_neon_v2si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv2si (__a); \
__rv.__i; \
})
#define vld2_dup_f32(__a) \
({ \
- union { float32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { float32x2x2_t __i; __builtin_neon_v2sf2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv2sf (__a); \
__rv.__i; \
})
#define vld2_dup_u8(__a) \
({ \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv8qi (__a); \
__rv.__i; \
})
#define vld2_dup_u16(__a) \
({ \
- union { uint16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv4hi (__a); \
__rv.__i; \
})
#define vld2_dup_u32(__a) \
({ \
- union { uint32x2x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint32x2x2_t __i; __builtin_neon_v2si2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv2si (__a); \
__rv.__i; \
})
#define vld2_dup_p8(__a) \
({ \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv8qi (__a); \
__rv.__i; \
})
#define vld2_dup_p16(__a) \
({ \
- union { poly16x4x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { poly16x4x2_t __i; __builtin_neon_v4hi2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupv4hi (__a); \
__rv.__i; \
})
#define vld2_dup_s64(__a) \
({ \
- union { int64x1x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { int64x1x2_t __i; __builtin_neon_di2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupdi (__a); \
__rv.__i; \
})
#define vld2_dup_u64(__a) \
({ \
- union { uint64x1x2_t __i; __builtin_neon_ti __o; } __rv; \
+ union { uint64x1x2_t __i; __builtin_neon_di2 __o; } __rv; \
__rv.__o = __builtin_neon_vld2_dupdi (__a); \
__rv.__i; \
})
#define vst2_s8(__a, __b) \
({ \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v8qi (__a, __bu.__o); \
})
#define vst2_s16(__a, __b) \
({ \
- union { int16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v4hi (__a, __bu.__o); \
})
#define vst2_s32(__a, __b) \
({ \
- union { int32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int32x2x2_t __i; __builtin_neon_v2si2 __o; } __bu = { __b }; \
__builtin_neon_vst2v2si (__a, __bu.__o); \
})
#define vst2_f32(__a, __b) \
({ \
- union { float32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { float32x2x2_t __i; __builtin_neon_v2sf2 __o; } __bu = { __b }; \
__builtin_neon_vst2v2sf (__a, __bu.__o); \
})
#define vst2_u8(__a, __b) \
({ \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v8qi (__a, __bu.__o); \
})
#define vst2_u16(__a, __b) \
({ \
- union { uint16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v4hi (__a, __bu.__o); \
})
#define vst2_u32(__a, __b) \
({ \
- union { uint32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint32x2x2_t __i; __builtin_neon_v2si2 __o; } __bu = { __b }; \
__builtin_neon_vst2v2si (__a, __bu.__o); \
})
#define vst2_p8(__a, __b) \
({ \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v8qi (__a, __bu.__o); \
})
#define vst2_p16(__a, __b) \
({ \
- union { poly16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { poly16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v4hi (__a, __bu.__o); \
})
#define vst2_s64(__a, __b) \
({ \
- union { int64x1x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int64x1x2_t __i; __builtin_neon_di2 __o; } __bu = { __b }; \
__builtin_neon_vst2di (__a, __bu.__o); \
})
#define vst2_u64(__a, __b) \
({ \
- union { uint64x1x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint64x1x2_t __i; __builtin_neon_di2 __o; } __bu = { __b }; \
__builtin_neon_vst2di (__a, __bu.__o); \
})
#define vst2q_s8(__a, __b) \
({ \
- union { int8x16x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int8x16x2_t __i; __builtin_neon_v16qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v16qi (__a, __bu.__o); \
})
#define vst2q_s16(__a, __b) \
({ \
- union { int16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v8hi (__a, __bu.__o); \
})
#define vst2q_s32(__a, __b) \
({ \
- union { int32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int32x4x2_t __i; __builtin_neon_v4si2 __o; } __bu = { __b }; \
__builtin_neon_vst2v4si (__a, __bu.__o); \
})
#define vst2q_f32(__a, __b) \
({ \
- union { float32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { float32x4x2_t __i; __builtin_neon_v4sf2 __o; } __bu = { __b }; \
__builtin_neon_vst2v4sf (__a, __bu.__o); \
})
#define vst2q_u8(__a, __b) \
({ \
- union { uint8x16x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint8x16x2_t __i; __builtin_neon_v16qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v16qi (__a, __bu.__o); \
})
#define vst2q_u16(__a, __b) \
({ \
- union { uint16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v8hi (__a, __bu.__o); \
})
#define vst2q_u32(__a, __b) \
({ \
- union { uint32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint32x4x2_t __i; __builtin_neon_v4si2 __o; } __bu = { __b }; \
__builtin_neon_vst2v4si (__a, __bu.__o); \
})
#define vst2q_p8(__a, __b) \
({ \
- union { poly8x16x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly8x16x2_t __i; __builtin_neon_v16qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v16qi (__a, __bu.__o); \
})
#define vst2q_p16(__a, __b) \
({ \
- union { poly16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2v8hi (__a, __bu.__o); \
})
#define vst2_lane_s8(__a, __b, __c) \
({ \
- union { int8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev8qi (__a, __bu.__o, __c); \
})
#define vst2_lane_s16(__a, __b, __c) \
({ \
- union { int16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev4hi (__a, __bu.__o, __c); \
})
#define vst2_lane_s32(__a, __b, __c) \
({ \
- union { int32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { int32x2x2_t __i; __builtin_neon_v2si2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev2si (__a, __bu.__o, __c); \
})
#define vst2_lane_f32(__a, __b, __c) \
({ \
- union { float32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { float32x2x2_t __i; __builtin_neon_v2sf2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev2sf (__a, __bu.__o, __c); \
})
#define vst2_lane_u8(__a, __b, __c) \
({ \
- union { uint8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev8qi (__a, __bu.__o, __c); \
})
#define vst2_lane_u16(__a, __b, __c) \
({ \
- union { uint16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev4hi (__a, __bu.__o, __c); \
})
#define vst2_lane_u32(__a, __b, __c) \
({ \
- union { uint32x2x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { uint32x2x2_t __i; __builtin_neon_v2si2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev2si (__a, __bu.__o, __c); \
})
#define vst2_lane_p8(__a, __b, __c) \
({ \
- union { poly8x8x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { poly8x8x2_t __i; __builtin_neon_v8qi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev8qi (__a, __bu.__o, __c); \
})
#define vst2_lane_p16(__a, __b, __c) \
({ \
- union { poly16x4x2_t __i; __builtin_neon_ti __o; } __bu = { __b }; \
+ union { poly16x4x2_t __i; __builtin_neon_v4hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev4hi (__a, __bu.__o, __c); \
})
#define vst2q_lane_s16(__a, __b, __c) \
({ \
- union { int16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev8hi (__a, __bu.__o, __c); \
})
#define vst2q_lane_s32(__a, __b, __c) \
({ \
- union { int32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int32x4x2_t __i; __builtin_neon_v4si2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev4si (__a, __bu.__o, __c); \
})
#define vst2q_lane_f32(__a, __b, __c) \
({ \
- union { float32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { float32x4x2_t __i; __builtin_neon_v4sf2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev4sf (__a, __bu.__o, __c); \
})
#define vst2q_lane_u16(__a, __b, __c) \
({ \
- union { uint16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev8hi (__a, __bu.__o, __c); \
})
#define vst2q_lane_u32(__a, __b, __c) \
({ \
- union { uint32x4x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint32x4x2_t __i; __builtin_neon_v4si2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev4si (__a, __bu.__o, __c); \
})
#define vst2q_lane_p16(__a, __b, __c) \
({ \
- union { poly16x8x2_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly16x8x2_t __i; __builtin_neon_v8hi2 __o; } __bu = { __b }; \
__builtin_neon_vst2_lanev8hi (__a, __bu.__o, __c); \
})
#define vld3_s8(__a) \
({ \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v8qi (__a); \
__rv.__i; \
})
#define vld3_s16(__a) \
({ \
- union { int16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v4hi (__a); \
__rv.__i; \
})
#define vld3_s32(__a) \
({ \
- union { int32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int32x2x3_t __i; __builtin_neon_v2si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v2si (__a); \
__rv.__i; \
})
#define vld3_f32(__a) \
({ \
- union { float32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { float32x2x3_t __i; __builtin_neon_v2sf3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v2sf (__a); \
__rv.__i; \
})
#define vld3_u8(__a) \
({ \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v8qi (__a); \
__rv.__i; \
})
#define vld3_u16(__a) \
({ \
- union { uint16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v4hi (__a); \
__rv.__i; \
})
#define vld3_u32(__a) \
({ \
- union { uint32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint32x2x3_t __i; __builtin_neon_v2si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v2si (__a); \
__rv.__i; \
})
#define vld3_p8(__a) \
({ \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v8qi (__a); \
__rv.__i; \
})
#define vld3_p16(__a) \
({ \
- union { poly16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { poly16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v4hi (__a); \
__rv.__i; \
})
#define vld3_s64(__a) \
({ \
- union { int64x1x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int64x1x3_t __i; __builtin_neon_di3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3di (__a); \
__rv.__i; \
})
#define vld3_u64(__a) \
({ \
- union { uint64x1x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint64x1x3_t __i; __builtin_neon_di3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3di (__a); \
__rv.__i; \
})
#define vld3q_s8(__a) \
({ \
- union { int8x16x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { int8x16x3_t __i; __builtin_neon_v16qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v16qi (__a); \
__rv.__i; \
})
#define vld3q_s16(__a) \
({ \
- union { int16x8x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { int16x8x3_t __i; __builtin_neon_v8hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v8hi (__a); \
__rv.__i; \
})
#define vld3q_s32(__a) \
({ \
- union { int32x4x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { int32x4x3_t __i; __builtin_neon_v4si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v4si (__a); \
__rv.__i; \
})
#define vld3q_f32(__a) \
({ \
- union { float32x4x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { float32x4x3_t __i; __builtin_neon_v4sf3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v4sf (__a); \
__rv.__i; \
})
#define vld3q_u8(__a) \
({ \
- union { uint8x16x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { uint8x16x3_t __i; __builtin_neon_v16qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v16qi (__a); \
__rv.__i; \
})
#define vld3q_u16(__a) \
({ \
- union { uint16x8x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { uint16x8x3_t __i; __builtin_neon_v8hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v8hi (__a); \
__rv.__i; \
})
#define vld3q_u32(__a) \
({ \
- union { uint32x4x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { uint32x4x3_t __i; __builtin_neon_v4si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v4si (__a); \
__rv.__i; \
})
#define vld3q_p8(__a) \
({ \
- union { poly8x16x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { poly8x16x3_t __i; __builtin_neon_v16qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v16qi (__a); \
__rv.__i; \
})
#define vld3q_p16(__a) \
({ \
- union { poly16x8x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { poly16x8x3_t __i; __builtin_neon_v8hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3v8hi (__a); \
__rv.__i; \
})
#define vld3_lane_s8(__a, __b, __c) \
({ \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_s16(__a, __b, __c) \
({ \
- union { int16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { int16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
+ union { int16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_s32(__a, __b, __c) \
({ \
- union { int32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { int32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int32x2x3_t __i; __builtin_neon_v2si3 __o; } __bu = { __b }; \
+ union { int32x2x3_t __i; __builtin_neon_v2si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev2si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_f32(__a, __b, __c) \
({ \
- union { float32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { float32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { float32x2x3_t __i; __builtin_neon_v2sf3 __o; } __bu = { __b }; \
+ union { float32x2x3_t __i; __builtin_neon_v2sf3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev2sf (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_u8(__a, __b, __c) \
({ \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_u16(__a, __b, __c) \
({ \
- union { uint16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { uint16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
+ union { uint16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_u32(__a, __b, __c) \
({ \
- union { uint32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { uint32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint32x2x3_t __i; __builtin_neon_v2si3 __o; } __bu = { __b }; \
+ union { uint32x2x3_t __i; __builtin_neon_v2si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev2si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_p8(__a, __b, __c) \
({ \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_lane_p16(__a, __b, __c) \
({ \
- union { poly16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
- union { poly16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { poly16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
+ union { poly16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3q_lane_s16(__a, __b, __c) \
({ \
- union { int16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
- union { int16x8x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { int16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
+ union { int16x8x3_t __i; __builtin_neon_v8hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3q_lane_s32(__a, __b, __c) \
({ \
- union { int32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
- union { int32x4x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { int32x4x3_t __i; __builtin_neon_v4si3 __o; } __bu = { __b }; \
+ union { int32x4x3_t __i; __builtin_neon_v4si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev4si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3q_lane_f32(__a, __b, __c) \
({ \
- union { float32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
- union { float32x4x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { float32x4x3_t __i; __builtin_neon_v4sf3 __o; } __bu = { __b }; \
+ union { float32x4x3_t __i; __builtin_neon_v4sf3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev4sf (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3q_lane_u16(__a, __b, __c) \
({ \
- union { uint16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
- union { uint16x8x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { uint16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
+ union { uint16x8x3_t __i; __builtin_neon_v8hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3q_lane_u32(__a, __b, __c) \
({ \
- union { uint32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
- union { uint32x4x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { uint32x4x3_t __i; __builtin_neon_v4si3 __o; } __bu = { __b }; \
+ union { uint32x4x3_t __i; __builtin_neon_v4si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev4si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3q_lane_p16(__a, __b, __c) \
({ \
- union { poly16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
- union { poly16x8x3_t __i; __builtin_neon_ci __o; } __rv; \
+ union { poly16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
+ union { poly16x8x3_t __i; __builtin_neon_v8hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld3_dup_s8(__a) \
({ \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv8qi (__a); \
__rv.__i; \
})
#define vld3_dup_s16(__a) \
({ \
- union { int16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv4hi (__a); \
__rv.__i; \
})
#define vld3_dup_s32(__a) \
({ \
- union { int32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int32x2x3_t __i; __builtin_neon_v2si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv2si (__a); \
__rv.__i; \
})
#define vld3_dup_f32(__a) \
({ \
- union { float32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { float32x2x3_t __i; __builtin_neon_v2sf3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv2sf (__a); \
__rv.__i; \
})
#define vld3_dup_u8(__a) \
({ \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv8qi (__a); \
__rv.__i; \
})
#define vld3_dup_u16(__a) \
({ \
- union { uint16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv4hi (__a); \
__rv.__i; \
})
#define vld3_dup_u32(__a) \
({ \
- union { uint32x2x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint32x2x3_t __i; __builtin_neon_v2si3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv2si (__a); \
__rv.__i; \
})
#define vld3_dup_p8(__a) \
({ \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv8qi (__a); \
__rv.__i; \
})
#define vld3_dup_p16(__a) \
({ \
- union { poly16x4x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { poly16x4x3_t __i; __builtin_neon_v4hi3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupv4hi (__a); \
__rv.__i; \
})
#define vld3_dup_s64(__a) \
({ \
- union { int64x1x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { int64x1x3_t __i; __builtin_neon_di3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupdi (__a); \
__rv.__i; \
})
#define vld3_dup_u64(__a) \
({ \
- union { uint64x1x3_t __i; __builtin_neon_ei __o; } __rv; \
+ union { uint64x1x3_t __i; __builtin_neon_di3 __o; } __rv; \
__rv.__o = __builtin_neon_vld3_dupdi (__a); \
__rv.__i; \
})
#define vst3_s8(__a, __b) \
({ \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v8qi (__a, __bu.__o); \
})
#define vst3_s16(__a, __b) \
({ \
- union { int16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v4hi (__a, __bu.__o); \
})
#define vst3_s32(__a, __b) \
({ \
- union { int32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int32x2x3_t __i; __builtin_neon_v2si3 __o; } __bu = { __b }; \
__builtin_neon_vst3v2si (__a, __bu.__o); \
})
#define vst3_f32(__a, __b) \
({ \
- union { float32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { float32x2x3_t __i; __builtin_neon_v2sf3 __o; } __bu = { __b }; \
__builtin_neon_vst3v2sf (__a, __bu.__o); \
})
#define vst3_u8(__a, __b) \
({ \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v8qi (__a, __bu.__o); \
})
#define vst3_u16(__a, __b) \
({ \
- union { uint16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v4hi (__a, __bu.__o); \
})
#define vst3_u32(__a, __b) \
({ \
- union { uint32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint32x2x3_t __i; __builtin_neon_v2si3 __o; } __bu = { __b }; \
__builtin_neon_vst3v2si (__a, __bu.__o); \
})
#define vst3_p8(__a, __b) \
({ \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v8qi (__a, __bu.__o); \
})
#define vst3_p16(__a, __b) \
({ \
- union { poly16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { poly16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v4hi (__a, __bu.__o); \
})
#define vst3_s64(__a, __b) \
({ \
- union { int64x1x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int64x1x3_t __i; __builtin_neon_di3 __o; } __bu = { __b }; \
__builtin_neon_vst3di (__a, __bu.__o); \
})
#define vst3_u64(__a, __b) \
({ \
- union { uint64x1x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint64x1x3_t __i; __builtin_neon_di3 __o; } __bu = { __b }; \
__builtin_neon_vst3di (__a, __bu.__o); \
})
#define vst3q_s8(__a, __b) \
({ \
- union { int8x16x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { int8x16x3_t __i; __builtin_neon_v16qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v16qi (__a, __bu.__o); \
})
#define vst3q_s16(__a, __b) \
({ \
- union { int16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { int16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v8hi (__a, __bu.__o); \
})
#define vst3q_s32(__a, __b) \
({ \
- union { int32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { int32x4x3_t __i; __builtin_neon_v4si3 __o; } __bu = { __b }; \
__builtin_neon_vst3v4si (__a, __bu.__o); \
})
#define vst3q_f32(__a, __b) \
({ \
- union { float32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { float32x4x3_t __i; __builtin_neon_v4sf3 __o; } __bu = { __b }; \
__builtin_neon_vst3v4sf (__a, __bu.__o); \
})
#define vst3q_u8(__a, __b) \
({ \
- union { uint8x16x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { uint8x16x3_t __i; __builtin_neon_v16qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v16qi (__a, __bu.__o); \
})
#define vst3q_u16(__a, __b) \
({ \
- union { uint16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { uint16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v8hi (__a, __bu.__o); \
})
#define vst3q_u32(__a, __b) \
({ \
- union { uint32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { uint32x4x3_t __i; __builtin_neon_v4si3 __o; } __bu = { __b }; \
__builtin_neon_vst3v4si (__a, __bu.__o); \
})
#define vst3q_p8(__a, __b) \
({ \
- union { poly8x16x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { poly8x16x3_t __i; __builtin_neon_v16qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v16qi (__a, __bu.__o); \
})
#define vst3q_p16(__a, __b) \
({ \
- union { poly16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { poly16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3v8hi (__a, __bu.__o); \
})
#define vst3_lane_s8(__a, __b, __c) \
({ \
- union { int8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev8qi (__a, __bu.__o, __c); \
})
#define vst3_lane_s16(__a, __b, __c) \
({ \
- union { int16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev4hi (__a, __bu.__o, __c); \
})
#define vst3_lane_s32(__a, __b, __c) \
({ \
- union { int32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { int32x2x3_t __i; __builtin_neon_v2si3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev2si (__a, __bu.__o, __c); \
})
#define vst3_lane_f32(__a, __b, __c) \
({ \
- union { float32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { float32x2x3_t __i; __builtin_neon_v2sf3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev2sf (__a, __bu.__o, __c); \
})
#define vst3_lane_u8(__a, __b, __c) \
({ \
- union { uint8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev8qi (__a, __bu.__o, __c); \
})
#define vst3_lane_u16(__a, __b, __c) \
({ \
- union { uint16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev4hi (__a, __bu.__o, __c); \
})
#define vst3_lane_u32(__a, __b, __c) \
({ \
- union { uint32x2x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { uint32x2x3_t __i; __builtin_neon_v2si3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev2si (__a, __bu.__o, __c); \
})
#define vst3_lane_p8(__a, __b, __c) \
({ \
- union { poly8x8x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { poly8x8x3_t __i; __builtin_neon_v8qi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev8qi (__a, __bu.__o, __c); \
})
#define vst3_lane_p16(__a, __b, __c) \
({ \
- union { poly16x4x3_t __i; __builtin_neon_ei __o; } __bu = { __b }; \
+ union { poly16x4x3_t __i; __builtin_neon_v4hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev4hi (__a, __bu.__o, __c); \
})
#define vst3q_lane_s16(__a, __b, __c) \
({ \
- union { int16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { int16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev8hi (__a, __bu.__o, __c); \
})
#define vst3q_lane_s32(__a, __b, __c) \
({ \
- union { int32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { int32x4x3_t __i; __builtin_neon_v4si3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev4si (__a, __bu.__o, __c); \
})
#define vst3q_lane_f32(__a, __b, __c) \
({ \
- union { float32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { float32x4x3_t __i; __builtin_neon_v4sf3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev4sf (__a, __bu.__o, __c); \
})
#define vst3q_lane_u16(__a, __b, __c) \
({ \
- union { uint16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { uint16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev8hi (__a, __bu.__o, __c); \
})
#define vst3q_lane_u32(__a, __b, __c) \
({ \
- union { uint32x4x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { uint32x4x3_t __i; __builtin_neon_v4si3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev4si (__a, __bu.__o, __c); \
})
#define vst3q_lane_p16(__a, __b, __c) \
({ \
- union { poly16x8x3_t __i; __builtin_neon_ci __o; } __bu = { __b }; \
+ union { poly16x8x3_t __i; __builtin_neon_v8hi3 __o; } __bu = { __b }; \
__builtin_neon_vst3_lanev8hi (__a, __bu.__o, __c); \
})
#define vld4_s8(__a) \
({ \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v8qi (__a); \
__rv.__i; \
})
#define vld4_s16(__a) \
({ \
- union { int16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v4hi (__a); \
__rv.__i; \
})
#define vld4_s32(__a) \
({ \
- union { int32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int32x2x4_t __i; __builtin_neon_v2si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v2si (__a); \
__rv.__i; \
})
#define vld4_f32(__a) \
({ \
- union { float32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { float32x2x4_t __i; __builtin_neon_v2sf4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v2sf (__a); \
__rv.__i; \
})
#define vld4_u8(__a) \
({ \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v8qi (__a); \
__rv.__i; \
})
#define vld4_u16(__a) \
({ \
- union { uint16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v4hi (__a); \
__rv.__i; \
})
#define vld4_u32(__a) \
({ \
- union { uint32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint32x2x4_t __i; __builtin_neon_v2si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v2si (__a); \
__rv.__i; \
})
#define vld4_p8(__a) \
({ \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v8qi (__a); \
__rv.__i; \
})
#define vld4_p16(__a) \
({ \
- union { poly16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v4hi (__a); \
__rv.__i; \
})
#define vld4_s64(__a) \
({ \
- union { int64x1x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int64x1x4_t __i; __builtin_neon_di4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4di (__a); \
__rv.__i; \
})
#define vld4_u64(__a) \
({ \
- union { uint64x1x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint64x1x4_t __i; __builtin_neon_di4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4di (__a); \
__rv.__i; \
})
#define vld4q_s8(__a) \
({ \
- union { int8x16x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { int8x16x4_t __i; __builtin_neon_v16qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v16qi (__a); \
__rv.__i; \
})
#define vld4q_s16(__a) \
({ \
- union { int16x8x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { int16x8x4_t __i; __builtin_neon_v8hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v8hi (__a); \
__rv.__i; \
})
#define vld4q_s32(__a) \
({ \
- union { int32x4x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { int32x4x4_t __i; __builtin_neon_v4si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v4si (__a); \
__rv.__i; \
})
#define vld4q_f32(__a) \
({ \
- union { float32x4x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { float32x4x4_t __i; __builtin_neon_v4sf4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v4sf (__a); \
__rv.__i; \
})
#define vld4q_u8(__a) \
({ \
- union { uint8x16x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { uint8x16x4_t __i; __builtin_neon_v16qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v16qi (__a); \
__rv.__i; \
})
#define vld4q_u16(__a) \
({ \
- union { uint16x8x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { uint16x8x4_t __i; __builtin_neon_v8hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v8hi (__a); \
__rv.__i; \
})
#define vld4q_u32(__a) \
({ \
- union { uint32x4x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { uint32x4x4_t __i; __builtin_neon_v4si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v4si (__a); \
__rv.__i; \
})
#define vld4q_p8(__a) \
({ \
- union { poly8x16x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { poly8x16x4_t __i; __builtin_neon_v16qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v16qi (__a); \
__rv.__i; \
})
#define vld4q_p16(__a) \
({ \
- union { poly16x8x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { poly16x8x4_t __i; __builtin_neon_v8hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4v8hi (__a); \
__rv.__i; \
})
#define vld4_lane_s8(__a, __b, __c) \
({ \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_s16(__a, __b, __c) \
({ \
- union { int16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { int16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
+ union { int16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_s32(__a, __b, __c) \
({ \
- union { int32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { int32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int32x2x4_t __i; __builtin_neon_v2si4 __o; } __bu = { __b }; \
+ union { int32x2x4_t __i; __builtin_neon_v2si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev2si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_f32(__a, __b, __c) \
({ \
- union { float32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { float32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { float32x2x4_t __i; __builtin_neon_v2sf4 __o; } __bu = { __b }; \
+ union { float32x2x4_t __i; __builtin_neon_v2sf4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev2sf (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_u8(__a, __b, __c) \
({ \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_u16(__a, __b, __c) \
({ \
- union { uint16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { uint16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
+ union { uint16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_u32(__a, __b, __c) \
({ \
- union { uint32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { uint32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint32x2x4_t __i; __builtin_neon_v2si4 __o; } __bu = { __b }; \
+ union { uint32x2x4_t __i; __builtin_neon_v2si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev2si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_p8(__a, __b, __c) \
({ \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev8qi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_lane_p16(__a, __b, __c) \
({ \
- union { poly16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
- union { poly16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
+ union { poly16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev4hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4q_lane_s16(__a, __b, __c) \
({ \
- union { int16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
- union { int16x8x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { int16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
+ union { int16x8x4_t __i; __builtin_neon_v8hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4q_lane_s32(__a, __b, __c) \
({ \
- union { int32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
- union { int32x4x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { int32x4x4_t __i; __builtin_neon_v4si4 __o; } __bu = { __b }; \
+ union { int32x4x4_t __i; __builtin_neon_v4si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev4si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4q_lane_f32(__a, __b, __c) \
({ \
- union { float32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
- union { float32x4x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { float32x4x4_t __i; __builtin_neon_v4sf4 __o; } __bu = { __b }; \
+ union { float32x4x4_t __i; __builtin_neon_v4sf4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev4sf (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4q_lane_u16(__a, __b, __c) \
({ \
- union { uint16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
- union { uint16x8x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { uint16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
+ union { uint16x8x4_t __i; __builtin_neon_v8hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4q_lane_u32(__a, __b, __c) \
({ \
- union { uint32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
- union { uint32x4x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { uint32x4x4_t __i; __builtin_neon_v4si4 __o; } __bu = { __b }; \
+ union { uint32x4x4_t __i; __builtin_neon_v4si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev4si (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4q_lane_p16(__a, __b, __c) \
({ \
- union { poly16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
- union { poly16x8x4_t __i; __builtin_neon_xi __o; } __rv; \
+ union { poly16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
+ union { poly16x8x4_t __i; __builtin_neon_v8hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_lanev8hi (__a, __bu.__o, __c); \
__rv.__i; \
})
#define vld4_dup_s8(__a) \
({ \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv8qi (__a); \
__rv.__i; \
})
#define vld4_dup_s16(__a) \
({ \
- union { int16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv4hi (__a); \
__rv.__i; \
})
#define vld4_dup_s32(__a) \
({ \
- union { int32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int32x2x4_t __i; __builtin_neon_v2si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv2si (__a); \
__rv.__i; \
})
#define vld4_dup_f32(__a) \
({ \
- union { float32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { float32x2x4_t __i; __builtin_neon_v2sf4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv2sf (__a); \
__rv.__i; \
})
#define vld4_dup_u8(__a) \
({ \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv8qi (__a); \
__rv.__i; \
})
#define vld4_dup_u16(__a) \
({ \
- union { uint16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv4hi (__a); \
__rv.__i; \
})
#define vld4_dup_u32(__a) \
({ \
- union { uint32x2x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint32x2x4_t __i; __builtin_neon_v2si4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv2si (__a); \
__rv.__i; \
})
#define vld4_dup_p8(__a) \
({ \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv8qi (__a); \
__rv.__i; \
})
#define vld4_dup_p16(__a) \
({ \
- union { poly16x4x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { poly16x4x4_t __i; __builtin_neon_v4hi4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupv4hi (__a); \
__rv.__i; \
})
#define vld4_dup_s64(__a) \
({ \
- union { int64x1x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { int64x1x4_t __i; __builtin_neon_di4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupdi (__a); \
__rv.__i; \
})
#define vld4_dup_u64(__a) \
({ \
- union { uint64x1x4_t __i; __builtin_neon_oi __o; } __rv; \
+ union { uint64x1x4_t __i; __builtin_neon_di4 __o; } __rv; \
__rv.__o = __builtin_neon_vld4_dupdi (__a); \
__rv.__i; \
})
#define vst4_s8(__a, __b) \
({ \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v8qi (__a, __bu.__o); \
})
#define vst4_s16(__a, __b) \
({ \
- union { int16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v4hi (__a, __bu.__o); \
})
#define vst4_s32(__a, __b) \
({ \
- union { int32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int32x2x4_t __i; __builtin_neon_v2si4 __o; } __bu = { __b }; \
__builtin_neon_vst4v2si (__a, __bu.__o); \
})
#define vst4_f32(__a, __b) \
({ \
- union { float32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { float32x2x4_t __i; __builtin_neon_v2sf4 __o; } __bu = { __b }; \
__builtin_neon_vst4v2sf (__a, __bu.__o); \
})
#define vst4_u8(__a, __b) \
({ \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v8qi (__a, __bu.__o); \
})
#define vst4_u16(__a, __b) \
({ \
- union { uint16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v4hi (__a, __bu.__o); \
})
#define vst4_u32(__a, __b) \
({ \
- union { uint32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint32x2x4_t __i; __builtin_neon_v2si4 __o; } __bu = { __b }; \
__builtin_neon_vst4v2si (__a, __bu.__o); \
})
#define vst4_p8(__a, __b) \
({ \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v8qi (__a, __bu.__o); \
})
#define vst4_p16(__a, __b) \
({ \
- union { poly16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v4hi (__a, __bu.__o); \
})
#define vst4_s64(__a, __b) \
({ \
- union { int64x1x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int64x1x4_t __i; __builtin_neon_di4 __o; } __bu = { __b }; \
__builtin_neon_vst4di (__a, __bu.__o); \
})
#define vst4_u64(__a, __b) \
({ \
- union { uint64x1x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint64x1x4_t __i; __builtin_neon_di4 __o; } __bu = { __b }; \
__builtin_neon_vst4di (__a, __bu.__o); \
})
#define vst4q_s8(__a, __b) \
({ \
- union { int8x16x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { int8x16x4_t __i; __builtin_neon_v16qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v16qi (__a, __bu.__o); \
})
#define vst4q_s16(__a, __b) \
({ \
- union { int16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { int16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v8hi (__a, __bu.__o); \
})
#define vst4q_s32(__a, __b) \
({ \
- union { int32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { int32x4x4_t __i; __builtin_neon_v4si4 __o; } __bu = { __b }; \
__builtin_neon_vst4v4si (__a, __bu.__o); \
})
#define vst4q_f32(__a, __b) \
({ \
- union { float32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { float32x4x4_t __i; __builtin_neon_v4sf4 __o; } __bu = { __b }; \
__builtin_neon_vst4v4sf (__a, __bu.__o); \
})
#define vst4q_u8(__a, __b) \
({ \
- union { uint8x16x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { uint8x16x4_t __i; __builtin_neon_v16qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v16qi (__a, __bu.__o); \
})
#define vst4q_u16(__a, __b) \
({ \
- union { uint16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { uint16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v8hi (__a, __bu.__o); \
})
#define vst4q_u32(__a, __b) \
({ \
- union { uint32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { uint32x4x4_t __i; __builtin_neon_v4si4 __o; } __bu = { __b }; \
__builtin_neon_vst4v4si (__a, __bu.__o); \
})
#define vst4q_p8(__a, __b) \
({ \
- union { poly8x16x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { poly8x16x4_t __i; __builtin_neon_v16qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v16qi (__a, __bu.__o); \
})
#define vst4q_p16(__a, __b) \
({ \
- union { poly16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { poly16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4v8hi (__a, __bu.__o); \
})
#define vst4_lane_s8(__a, __b, __c) \
({ \
- union { int8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev8qi (__a, __bu.__o, __c); \
})
#define vst4_lane_s16(__a, __b, __c) \
({ \
- union { int16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev4hi (__a, __bu.__o, __c); \
})
#define vst4_lane_s32(__a, __b, __c) \
({ \
- union { int32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { int32x2x4_t __i; __builtin_neon_v2si4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev2si (__a, __bu.__o, __c); \
})
#define vst4_lane_f32(__a, __b, __c) \
({ \
- union { float32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { float32x2x4_t __i; __builtin_neon_v2sf4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev2sf (__a, __bu.__o, __c); \
})
#define vst4_lane_u8(__a, __b, __c) \
({ \
- union { uint8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev8qi (__a, __bu.__o, __c); \
})
#define vst4_lane_u16(__a, __b, __c) \
({ \
- union { uint16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev4hi (__a, __bu.__o, __c); \
})
#define vst4_lane_u32(__a, __b, __c) \
({ \
- union { uint32x2x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { uint32x2x4_t __i; __builtin_neon_v2si4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev2si (__a, __bu.__o, __c); \
})
#define vst4_lane_p8(__a, __b, __c) \
({ \
- union { poly8x8x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly8x8x4_t __i; __builtin_neon_v8qi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev8qi (__a, __bu.__o, __c); \
})
#define vst4_lane_p16(__a, __b, __c) \
({ \
- union { poly16x4x4_t __i; __builtin_neon_oi __o; } __bu = { __b }; \
+ union { poly16x4x4_t __i; __builtin_neon_v4hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev4hi (__a, __bu.__o, __c); \
})
#define vst4q_lane_s16(__a, __b, __c) \
({ \
- union { int16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { int16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev8hi (__a, __bu.__o, __c); \
})
#define vst4q_lane_s32(__a, __b, __c) \
({ \
- union { int32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { int32x4x4_t __i; __builtin_neon_v4si4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev4si (__a, __bu.__o, __c); \
})
#define vst4q_lane_f32(__a, __b, __c) \
({ \
- union { float32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { float32x4x4_t __i; __builtin_neon_v4sf4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev4sf (__a, __bu.__o, __c); \
})
#define vst4q_lane_u16(__a, __b, __c) \
({ \
- union { uint16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { uint16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev8hi (__a, __bu.__o, __c); \
})
#define vst4q_lane_u32(__a, __b, __c) \
({ \
- union { uint32x4x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { uint32x4x4_t __i; __builtin_neon_v4si4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev4si (__a, __bu.__o, __c); \
})
#define vst4q_lane_p16(__a, __b, __c) \
({ \
- union { poly16x8x4_t __i; __builtin_neon_xi __o; } __bu = { __b }; \
+ union { poly16x8x4_t __i; __builtin_neon_v8hi4 __o; } __bu = { __b }; \
__builtin_neon_vst4_lanev8hi (__a, __bu.__o, __c); \
})
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=77283&r1=77282&r2=77283&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Mon Jul 27 19:32:28 2009
@@ -1988,7 +1988,9 @@
Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
Result = Builder.CreateCall2(intFn, BitCastToType(Ops[0], VPTy),
ConstantInt::get(Type::Int32Ty, N));
- Result = BitCastToType(Result, ResultType);
+ Type *PtrToWideVec = Context.getPointerTypeUnqual(Result->getType());
+ Builder.CreateStore(Result, BitCastToType(DestLoc->Ptr, PtrToWideVec));
+ Result = 0;
break;
}
@@ -2018,7 +2020,9 @@
LaneVal + (n * NUnits));
Result = Builder.CreateInsertElement(Result, Elt, Ndx);
}
- Result = BitCastToType(Result, ResultType);
+ Type *PtrToWideVec = Context.getPointerTypeUnqual(VTy);
+ Builder.CreateStore(Result, BitCastToType(DestLoc->Ptr, PtrToWideVec));
+ Result = 0;
break;
}
@@ -2056,7 +2060,9 @@
Result = Builder.CreateShuffleVector(Result, Context.getUndef(VTy),
Context.getConstantVector(Idxs));
}
- Result = BitCastToType(Result, ResultType);
+ Type *PtrToWideVec = Context.getPointerTypeUnqual(VTy);
+ Builder.CreateStore(Result, BitCastToType(DestLoc->Ptr, PtrToWideVec));
+ Result = 0;
break;
}
@@ -2082,7 +2088,10 @@
}
Type *VPTy = Context.getPointerTypeUnqual(Type::Int8Ty);
- Value *Vec = BitCastToType(Ops[1], VTy);
+ Value *Tmp = CreateTemporary(VTy);
+ Type *PtrToStruct = Context.getPointerTypeUnqual(Ops[1]->getType());
+ Builder.CreateStore(Ops[1], BitCastToType(Tmp, PtrToStruct));
+ Value *Vec = Builder.CreateLoad(Tmp);
Builder.CreateCall3(intFn, BitCastToType(Ops[0], VPTy), Vec,
ConstantInt::get(Type::Int32Ty, N));
Result = 0;
@@ -2106,7 +2115,10 @@
unsigned NUnits = VTy->getNumElements() / NumVecs;
if (!isValidLane(Ops[2], NUnits, &LaneVal))
return UnexpectedError("%Hinvalid lane number", exp, Result);
- Value *Vec = BitCastToType(Ops[1], VTy);
+ Value *Tmp = CreateTemporary(VTy);
+ Type *PtrToStruct = Context.getPointerTypeUnqual(Ops[1]->getType());
+ Builder.CreateStore(Ops[1], BitCastToType(Tmp, PtrToStruct));
+ Value *Vec = Builder.CreateLoad(Tmp);
for (unsigned n = 0; n != NumVecs; ++n) {
Value *Addr = (n == 0) ? Ops[0] :
Builder.CreateGEP(Ops[0], ConstantInt::get(Type::Int32Ty, n));
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/neon.ml
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/neon.ml?rev=77283&r1=77282&r2=77283&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/neon.ml (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/neon.ml Mon Jul 27 19:32:28 2009
@@ -62,7 +62,18 @@
XImode : "heXadeca", eight registers (sixteen words).
*)
-type inttype = B_TImode | B_EImode | B_OImode | B_CImode | B_XImode
+(* LLVM LOCAL begin Use a different type for each vector type. *)
+type inttype = B_TId8mode | B_EId8mode | B_OId8mode
+ | B_TId16mode | B_EId16mode | B_OId16mode
+ | B_TId32mode | B_EId32mode | B_OId32mode
+ | B_TId64mode | B_EId64mode | B_OId64mode
+ | B_TIdSFmode | B_EIdSFmode | B_OIdSFmode
+ | B_OIq8mode | B_CIq8mode | B_XIq8mode
+ | B_OIq16mode | B_CIq16mode | B_XIq16mode
+ | B_OIq32mode | B_CIq32mode | B_XIq32mode
+ | B_OIq64mode | B_CIq64mode | B_XIq64mode
+ | B_OIqSFmode | B_CIqSFmode | B_XIqSFmode
+(* LLVM LOCAL end Use a different type for each vector type. *)
type shape_elt = Dreg | Qreg | Corereg | Immed | VecArray of int * shape_elt
| PtrTo of shape_elt | CstPtrTo of shape_elt
@@ -461,17 +472,60 @@
| T_uint8x16 | T_uint16x8 | T_uint32x4 | T_uint64x2
| T_float32x4 | T_poly8x16 | T_poly16x8 -> 128
| _ -> raise Not_found
+
+(* LLVM LOCAL begin Map vector types to modes. *)
+let vectype_mode = function
+ T_int8x8 | T_uint8x8 | T_poly8x8 -> V8QI
+ | T_int8x16 | T_uint8x16 | T_poly8x16 -> V16QI
+ | T_int16x4 | T_uint16x4 | T_poly16x4 -> V4HI
+ | T_int16x8 | T_uint16x8 | T_poly16x8 -> V8HI
+ | T_int32x2 | T_uint32x2 -> V2SI
+ | T_int32x4 | T_uint32x4 -> V4SI
+ | T_int64x1 | T_uint64x1 -> DI
+ | T_int64x2 | T_uint64x2 -> V2DI
+ | T_float32x2 -> V2SF
+ | T_float32x4 -> V4SF
+ | _ -> raise Not_found
+(* LLVM LOCAL end Map vector types to modes. *)
let inttype_for_array num elttype =
let eltsize = vectype_size elttype in
let numwords = (num * eltsize) / 32 in
- match numwords with
- 4 -> B_TImode
- | 6 -> B_EImode
- | 8 -> B_OImode
- | 12 -> B_CImode
- | 16 -> B_XImode
+ (* LLVM LOCAL begin Match vector type, too. *)
+ let vecmode = vectype_mode elttype in
+ match numwords, vecmode with
+ 4, V8QI -> B_TId8mode
+ | 4, V4HI -> B_TId16mode
+ | 4, V2SI -> B_TId32mode
+ | 4, DI -> B_TId64mode
+ | 4, V2SF -> B_TIdSFmode
+ | 6, V8QI -> B_EId8mode
+ | 6, V4HI -> B_EId16mode
+ | 6, V2SI -> B_EId32mode
+ | 6, DI -> B_EId64mode
+ | 6, V2SF -> B_EIdSFmode
+ | 8, V8QI -> B_OId8mode
+ | 8, V4HI -> B_OId16mode
+ | 8, V2SI -> B_OId32mode
+ | 8, DI -> B_OId64mode
+ | 8, V2SF -> B_OIdSFmode
+ | 8, V16QI -> B_OIq8mode
+ | 8, V8HI -> B_OIq16mode
+ | 8, V4SI -> B_OIq32mode
+ | 8, V2DI -> B_OIq64mode
+ | 8, V4SF -> B_OIqSFmode
+ | 12, V16QI -> B_CIq8mode
+ | 12, V8HI -> B_CIq16mode
+ | 12, V4SI -> B_CIq32mode
+ | 12, V2DI -> B_CIq64mode
+ | 12, V4SF -> B_CIqSFmode
+ | 16, V16QI -> B_XIq8mode
+ | 16, V8HI -> B_XIq16mode
+ | 16, V4SI -> B_XIq32mode
+ | 16, V2DI -> B_XIq64mode
+ | 16, V4SF -> B_XIqSFmode
| _ -> failwith ("no int type for size " ^ string_of_int numwords)
+ (* LLVM LOCAL end Match vector type, too. *)
(* These functions return pairs of (internal, external) types, where "internal"
types are those seen by GCC, and "external" are those seen by the assembler.
@@ -1707,12 +1761,39 @@
in
name (fun x -> x ^ "_t") vt
+(* LLVM LOCAL begin Print builtin type names that include the vector type. *)
let string_of_inttype = function
- B_TImode -> "__builtin_neon_ti"
- | B_EImode -> "__builtin_neon_ei"
- | B_OImode -> "__builtin_neon_oi"
- | B_CImode -> "__builtin_neon_ci"
- | B_XImode -> "__builtin_neon_xi"
+ B_TId8mode -> "__builtin_neon_v8qi2"
+ | B_TId16mode -> "__builtin_neon_v4hi2"
+ | B_TId32mode -> "__builtin_neon_v2si2"
+ | B_TId64mode -> "__builtin_neon_di2"
+ | B_TIdSFmode -> "__builtin_neon_v2sf2"
+ | B_EId8mode -> "__builtin_neon_v8qi3"
+ | B_EId16mode -> "__builtin_neon_v4hi3"
+ | B_EId32mode -> "__builtin_neon_v2si3"
+ | B_EId64mode -> "__builtin_neon_di3"
+ | B_EIdSFmode -> "__builtin_neon_v2sf3"
+ | B_OId8mode -> "__builtin_neon_v8qi4"
+ | B_OId16mode -> "__builtin_neon_v4hi4"
+ | B_OId32mode -> "__builtin_neon_v2si4"
+ | B_OId64mode -> "__builtin_neon_di4"
+ | B_OIdSFmode -> "__builtin_neon_v2sf4"
+ | B_OIq8mode -> "__builtin_neon_v16qi2"
+ | B_OIq16mode -> "__builtin_neon_v8hi2"
+ | B_OIq32mode -> "__builtin_neon_v4si2"
+ | B_OIq64mode -> "__builtin_neon_v2di2"
+ | B_OIqSFmode -> "__builtin_neon_v4sf2"
+ | B_CIq8mode -> "__builtin_neon_v16qi3"
+ | B_CIq16mode -> "__builtin_neon_v8hi3"
+ | B_CIq32mode -> "__builtin_neon_v4si3"
+ | B_CIq64mode -> "__builtin_neon_v2di3"
+ | B_CIqSFmode -> "__builtin_neon_v4sf3"
+ | B_XIq8mode -> "__builtin_neon_v16qi4"
+ | B_XIq16mode -> "__builtin_neon_v8hi4"
+ | B_XIq32mode -> "__builtin_neon_v4si4"
+ | B_XIq64mode -> "__builtin_neon_v2di4"
+ | B_XIqSFmode -> "__builtin_neon_v4sf4"
+(* LLVM LOCAL end Print builtin type names that include the vector type. *)
let string_of_mode = function
V8QI -> "v8qi" | V4HI -> "v4hi" | V2SI -> "v2si" | V2SF -> "v2sf"
From gohman at apple.com Mon Jul 27 19:37:06 2009
From: gohman at apple.com (Dan Gohman)
Date: Tue, 28 Jul 2009 00:37:06 -0000
Subject: [llvm-commits] [llvm] r77285 -
/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Message-ID: <200907280037.n6S0b6gu027963@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 19:37:06 2009
New Revision: 77285
URL: http://llvm.org/viewvc/llvm-project?rev=77285&view=rev
Log:
Grab the LLVMContext and parent Module of SI ahead of the
point where SI can get deleted. This fixes a use of free'd memory.
This fixes Externals/Povray.
Modified:
llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=77285&r1=77284&r2=77285&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Mon Jul 27 19:37:06 2009
@@ -352,6 +352,8 @@
TargetData &TD = getAnalysis();
AliasAnalysis &AA = getAnalysis();
+ LLVMContext &Context = SI->getContext();
+ Module *M = SI->getParent()->getParent()->getParent();
// Okay, so we now have a single store that can be splatable. Scan to find
// all subsequent stores of the same value to offset from the same pointer.
@@ -431,8 +433,7 @@
if (MemSetF == 0) {
const Type *Tys[] = {Type::Int64Ty};
- MemSetF = Intrinsic::getDeclaration(SI->getParent()->getParent()
- ->getParent(), Intrinsic::memset,
+ MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset,
Tys, 1);
}
@@ -440,7 +441,7 @@
StartPtr = Range.StartPtr;
// Cast the start ptr to be i8* as memset requires.
- const Type *i8Ptr = SI->getContext().getPointerTypeUnqual(Type::Int8Ty);
+ const Type *i8Ptr = Context.getPointerTypeUnqual(Type::Int8Ty);
if (StartPtr->getType() != i8Ptr)
StartPtr = new BitCastInst(StartPtr, i8Ptr, StartPtr->getName(),
InsertPt);
From gohman at apple.com Mon Jul 27 19:37:50 2009
From: gohman at apple.com (Dan Gohman)
Date: Tue, 28 Jul 2009 00:37:50 -0000
Subject: [llvm-commits] [llvm] r77286 -
/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Message-ID: <200907280037.n6S0boOF028001@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 19:37:50 2009
New Revision: 77286
URL: http://llvm.org/viewvc/llvm-project?rev=77286&view=rev
Log:
Replace dyn_castGetElementPtr with dyn_cast.
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=77286&r1=77285&r2=77286&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jul 27 19:37:50 2009
@@ -628,16 +628,6 @@
return 0;
}
-/// dyn_castGetElementPtr - If this is a getelementptr instruction or constant
-/// expression, return it.
-static User *dyn_castGetElementPtr(Value *V) {
- if (isa(V)) return cast(V);
- if (ConstantExpr *CE = dyn_cast(V))
- if (CE->getOpcode() == Instruction::GetElementPtr)
- return cast(V);
- return false;
-}
-
/// AddOne - Add one to a ConstantInt
static Constant *AddOne(Constant *C, LLVMContext *Context) {
return Context->getConstantExprAdd(C,
@@ -5572,7 +5562,7 @@
Instruction *InstCombiner::FoldGEPICmp(User *GEPLHS, Value *RHS,
ICmpInst::Predicate Cond,
Instruction &I) {
- assert(dyn_castGetElementPtr(GEPLHS) && "LHS is not a getelementptr!");
+ assert(isa(GEPLHS) && "LHS is not a getelementptr!");
// Look through bitcasts.
if (BitCastInst *BCI = dyn_cast(RHS))
@@ -5590,7 +5580,7 @@
Offset = EmitGEPOffset(GEPLHS, I, *this);
return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), Offset,
Context->getNullValue(Offset->getType()));
- } else if (User *GEPRHS = dyn_castGetElementPtr(RHS)) {
+ } else if (User *GEPRHS = dyn_cast(RHS)) {
// If the base pointers are different, but the indices are the same, just
// compare the base pointer.
if (PtrBase != GEPRHS->getOperand(0)) {
@@ -6355,10 +6345,10 @@
}
// If we can optimize a 'icmp GEP, P' or 'icmp P, GEP', do so now.
- if (User *GEP = dyn_castGetElementPtr(Op0))
+ if (User *GEP = dyn_cast(Op0))
if (Instruction *NI = FoldGEPICmp(GEP, Op1, I.getPredicate(), I))
return NI;
- if (User *GEP = dyn_castGetElementPtr(Op1))
+ if (User *GEP = dyn_cast(Op1))
if (Instruction *NI = FoldGEPICmp(GEP, Op0,
ICmpInst::getSwappedPredicate(I.getPredicate()), I))
return NI;
@@ -11065,7 +11055,7 @@
// getelementptr instructions into a single instruction.
//
SmallVector SrcGEPOperands;
- if (User *Src = dyn_castGetElementPtr(PtrOp))
+ if (User *Src = dyn_cast(PtrOp))
SrcGEPOperands.append(Src->op_begin(), Src->op_end());
if (!SrcGEPOperands.empty()) {
From daniel at zuster.org Mon Jul 27 19:58:51 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 28 Jul 2009 00:58:51 -0000
Subject: [llvm-commits] [llvm] r77287 - in /llvm/trunk/tools/llvm-mc:
AsmLexer.cpp AsmLexer.h
Message-ID: <200907280058.n6S0wpGO028830@zion.cs.uiuc.edu>
Author: ddunbar
Date: Mon Jul 27 19:58:50 2009
New Revision: 77287
URL: http://llvm.org/viewvc/llvm-project?rev=77287&view=rev
Log:
llvm-mc: Stop uniqueing string tokens, nothing actually uses this.
Modified:
llvm/trunk/tools/llvm-mc/AsmLexer.cpp
llvm/trunk/tools/llvm-mc/AsmLexer.h
Modified: llvm/trunk/tools/llvm-mc/AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmLexer.cpp?rev=77287&r1=77286&r2=77287&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmLexer.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmLexer.cpp Mon Jul 27 19:58:50 2009
@@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//
#include "AsmLexer.h"
-#include "llvm/ADT/StringSet.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Config/config.h" // for strtoull.
@@ -21,21 +20,14 @@
#include
using namespace llvm;
-static StringSet<> &getSS(void *TheSS) {
- return *(StringSet<>*)TheSS;
-}
-
AsmLexer::AsmLexer(SourceMgr &SM) : SrcMgr(SM) {
CurBuffer = 0;
CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
CurPtr = CurBuf->getBufferStart();
TokStart = 0;
-
- TheStringSet = new StringSet<>();
}
AsmLexer::~AsmLexer() {
- delete &getSS(TheStringSet);
}
SMLoc AsmLexer::getLoc() const {
@@ -107,9 +99,7 @@
*CurPtr == '.' || *CurPtr == '@')
++CurPtr;
// Unique string.
- CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
- CurPtr - TokStart),
- 0).getKeyData();
+ CurStrVal = StringRef(TokStart, CurPtr - TokStart);
return asmtok::Identifier;
}
@@ -122,9 +112,7 @@
++CurPtr;
// Unique string.
- CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
- CurPtr - TokStart),
- 0).getKeyData();
+ CurStrVal = StringRef(TokStart, CurPtr - TokStart);
return asmtok::Register;
}
@@ -251,9 +239,7 @@
}
// Unique string, include quotes for now.
- CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
- CurPtr - TokStart),
- 0).getKeyData();
+ CurStrVal = StringRef(TokStart, CurPtr - TokStart);
return asmtok::String;
}
Modified: llvm/trunk/tools/llvm-mc/AsmLexer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmLexer.h?rev=77287&r1=77286&r2=77287&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmLexer.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmLexer.h Mon Jul 27 19:58:50 2009
@@ -59,13 +59,11 @@
const char *CurPtr;
const MemoryBuffer *CurBuf;
- // A llvm::StringSet<>, which provides uniqued and null-terminated strings.
- void *TheStringSet;
// Information about the current token.
const char *TokStart;
asmtok::TokKind CurKind;
- const char *CurStrVal; // This is valid for Identifier.
+ StringRef CurStrVal; // This is valid for Identifier.
int64_t CurIntVal;
/// CurBuffer - This is the current buffer index we're lexing from as managed
From howard0su at gmail.com Mon Jul 27 20:06:54 2009
From: howard0su at gmail.com (Howard Su)
Date: Tue, 28 Jul 2009 09:06:54 +0800
Subject: [llvm-commits] [llvm] r77274 -
/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
In-Reply-To: <200907272333.n6RNXZkU026103@zion.cs.uiuc.edu>
References: <200907272333.n6RNXZkU026103@zion.cs.uiuc.edu>
Message-ID:
this option is a gcc extension. it cause compile error under VC.
On Tue, Jul 28, 2009 at 7:33 AM, Mike Stump wrote:
> Author: mrs
> Date: Mon Jul 27 18:33:34 2009
> New Revision: 77274
>
> URL: http://llvm.org/viewvc/llvm-project?rev=77274&view=rev
> Log:
> Fix a release-asserts warning. Debug functions should be marked used,
> if there are no other uses. If people don't need this routine
> anymore, if should be deleted.
>
> Modified:
> llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
>
> Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=77274&r1=77273&r2=77274&view=diff
>
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon Jul 27 18:33:34
> 2009
> @@ -110,6 +110,8 @@
> // operator<< - Used for debugging purposes.
> //
> static raw_ostream& operator<<(raw_ostream &O,
> + const LowerSwitch::CaseVector &C)
> __attribute((used));
> +static raw_ostream& operator<<(raw_ostream &O,
> const LowerSwitch::CaseVector &C) {
> O << "[";
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
--
-Howard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090728/248782ab/attachment.html
From howard0su at gmail.com Mon Jul 27 20:26:08 2009
From: howard0su at gmail.com (Howard Su)
Date: Tue, 28 Jul 2009 09:26:08 +0800
Subject: [llvm-commits] [llvm] r77204 - in /llvm/trunk:
include/llvm/Target/COFFTargetAsmInfo.h
include/llvm/Target/ELFTargetAsmInfo.h
lib/Target/COFFTargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.h
In-Reply-To: <200907271646.n6RGk16h012710@zion.cs.uiuc.edu>
References: <200907271646.n6RGk16h012710@zion.cs.uiuc.edu>
Message-ID:
PIC16 is also using COFF as its target.
On Tue, Jul 28, 2009 at 12:46 AM, Chris Lattner wrote:
> Author: lattner
> Date: Mon Jul 27 11:45:59 2009
> New Revision: 77204
>
> URL: http://llvm.org/viewvc/llvm-project?rev=77204&view=rev
> Log:
> make COFF work like ELF and macho, by splitting out into its own
> header even though there is only one COFF target.
>
> Added:
> llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
> llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
> Modified:
> llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
> llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
> llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
>
> Added: llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h?rev=77204&view=auto
>
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h (added)
> +++ llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h Mon Jul 27 11:45:59
> 2009
> @@ -0,0 +1,30 @@
> +//===-- COFFTargetAsmInfo.h - COFF asm properties ---------------*- C++
> -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
>
> +//===----------------------------------------------------------------------===//
> +
> +#ifndef LLVM_COFF_TARGET_ASM_INFO_H
> +#define LLVM_COFF_TARGET_ASM_INFO_H
> +
> +#include "llvm/Target/TargetAsmInfo.h"
> +
> +namespace llvm {
> + class COFFTargetAsmInfo : public TargetAsmInfo {
> + protected:
> + explicit COFFTargetAsmInfo(const TargetMachine &TM);
> + public:
> +
> + virtual const char *
> + getSectionPrefixForUniqueGlobal(SectionKind kind) const;
> +
> + virtual void getSectionFlagsAsString(SectionKind Kind,
> + SmallVectorImpl &Str)
> const;
> + };
> +}
> +
> +
> +#endif // LLVM_ELF_TARGET_ASM_INFO_H
>
> Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=77204&r1=77203&r2=77204&view=diff
>
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
> +++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Mon Jul 27 11:45:59
> 2009
> @@ -18,7 +18,6 @@
> #include "llvm/Target/TargetAsmInfo.h"
>
> namespace llvm {
> - class GlobalValue;
>
> struct ELFTargetAsmInfo : public TargetAsmInfo {
> ELFTargetAsmInfo(const TargetMachine &TM);
>
> Added: llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp?rev=77204&view=auto
>
>
> ==============================================================================
> --- llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp (added)
> +++ llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp Mon Jul 27 11:45:59 2009
> @@ -0,0 +1,76 @@
> +//===-- COFFTargetAsmInfo.cpp - COFF asm properties -------------*- C++
> -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
>
> +//===----------------------------------------------------------------------===//
> +//
> +// This file defines target asm properties related what form asm
> statements
> +// should take in general on COFF-based targets
> +//
>
> +//===----------------------------------------------------------------------===//
> +
> +#include "llvm/Target/COFFTargetAsmInfo.h"
> +#include "llvm/ADT/SmallVector.h"
> +using namespace llvm;
> +
> +COFFTargetAsmInfo::COFFTargetAsmInfo(const TargetMachine &TM)
> + : TargetAsmInfo(TM) {
> +
> + TextSection = getOrCreateSection("_text", true, SectionKind::Text);
> + DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
> +
> + GlobalPrefix = "_";
> + LCOMMDirective = "\t.lcomm\t";
> + COMMDirectiveTakesAlignment = false;
> + HasDotTypeDotSizeDirective = false;
> + HasSingleParameterDotFile = false;
> + StaticCtorsSection = "\t.section .ctors,\"aw\"";
> + StaticDtorsSection = "\t.section .dtors,\"aw\"";
> + HiddenDirective = NULL;
> + PrivateGlobalPrefix = "L"; // Prefix for private global symbols
> + WeakRefDirective = "\t.weak\t";
> + SetDirective = "\t.set\t";
> +
> + // Set up DWARF directives
> + HasLEB128 = true; // Target asm supports leb128 directives
> (little-endian)
> + AbsoluteDebugSectionOffsets = true;
> + AbsoluteEHSectionOffsets = false;
> + SupportsDebugInformation = true;
> + DwarfSectionOffsetDirective = "\t.secrel32\t";
> + DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\"";
> + DwarfInfoSection = "\t.section\t.debug_info,\"dr\"";
> + DwarfLineSection = "\t.section\t.debug_line,\"dr\"";
> + DwarfFrameSection = "\t.section\t.debug_frame,\"dr\"";
> + DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\"";
> + DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\"";
> + DwarfStrSection = "\t.section\t.debug_str,\"dr\"";
> + DwarfLocSection = "\t.section\t.debug_loc,\"dr\"";
> + DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\"";
> + DwarfRangesSection = "\t.section\t.debug_ranges,\"dr\"";
> + DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
> +}
> +
> +const char *COFFTargetAsmInfo::
> +getSectionPrefixForUniqueGlobal(SectionKind Kind) const {
> + if (Kind.isText())
> + return ".text$linkonce";
> + if (Kind.isWriteable())
> + return ".data$linkonce";
> + return ".rdata$linkonce";
> +}
> +
> +void COFFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
> + SmallVectorImpl &Str)
> const {
> + // FIXME: Inefficient.
> + std::string Res = ",\"";
> + if (Kind.isText())
> + Res += 'x';
> + if (Kind.isWriteable())
> + Res += 'w';
> + Res += "\"";
> +
> + Str.append(Res.begin(), Res.end());
> +}
>
> Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=77204&r1=77203&r2=77204&view=diff
>
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Jul 27 11:45:59 2009
> @@ -188,42 +188,6 @@
> }
> }
>
> -X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM):
> - X86GenericTargetAsmInfo(TM) {
> -
> - TextSection = getOrCreateSection("_text", true, SectionKind::Text);
> - DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
> -
> - GlobalPrefix = "_";
> - LCOMMDirective = "\t.lcomm\t";
> - COMMDirectiveTakesAlignment = false;
> - HasDotTypeDotSizeDirective = false;
> - HasSingleParameterDotFile = false;
> - StaticCtorsSection = "\t.section .ctors,\"aw\"";
> - StaticDtorsSection = "\t.section .dtors,\"aw\"";
> - HiddenDirective = NULL;
> - PrivateGlobalPrefix = "L"; // Prefix for private global symbols
> - WeakRefDirective = "\t.weak\t";
> - SetDirective = "\t.set\t";
> -
> - // Set up DWARF directives
> - HasLEB128 = true; // Target asm supports leb128 directives
> (little-endian)
> - AbsoluteDebugSectionOffsets = true;
> - AbsoluteEHSectionOffsets = false;
> - SupportsDebugInformation = true;
> - DwarfSectionOffsetDirective = "\t.secrel32\t";
> - DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\"";
> - DwarfInfoSection = "\t.section\t.debug_info,\"dr\"";
> - DwarfLineSection = "\t.section\t.debug_line,\"dr\"";
> - DwarfFrameSection = "\t.section\t.debug_frame,\"dr\"";
> - DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\"";
> - DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\"";
> - DwarfStrSection = "\t.section\t.debug_str,\"dr\"";
> - DwarfLocSection = "\t.section\t.debug_loc,\"dr\"";
> - DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\"";
> - DwarfRangesSection = "\t.section\t.debug_ranges,\"dr\"";
> - DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
> -}
>
> unsigned
> X86COFFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
> @@ -263,32 +227,10 @@
> return DW_EH_PE_absptr;
> }
>
> -const char *X86COFFTargetAsmInfo::
> -getSectionPrefixForUniqueGlobal(SectionKind Kind) const {
> - if (Kind.isText())
> - return ".text$linkonce";
> - if (Kind.isWriteable())
> - return ".data$linkonce";
> - return ".rdata$linkonce";
> -}
> -
>
>
> -void X86COFFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
> - SmallVectorImpl &Str)
> const {
> - // FIXME: Inefficient.
> - std::string Res = ",\"";
> - if (Kind.isText())
> - Res += 'x';
> - if (Kind.isWriteable())
> - Res += 'w';
> - Res += "\"";
> -
> - Str.append(Res.begin(), Res.end());
> -}
> -
> X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM):
> - X86GenericTargetAsmInfo(TM) {
> + X86TargetAsmInfo(TM) {
> GlobalPrefix = "_";
> CommentString = ";";
>
>
> Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h?rev=77204&r1=77203&r2=77204&view=diff
>
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h (original)
> +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Mon Jul 27 11:45:59 2009
> @@ -16,8 +16,9 @@
>
> #include "X86TargetMachine.h"
> #include "llvm/Target/TargetAsmInfo.h"
> -#include "llvm/Target/ELFTargetAsmInfo.h"
> +#include "llvm/Target/COFFTargetAsmInfo.h"
> #include "llvm/Target/DarwinTargetAsmInfo.h"
> +#include "llvm/Target/ELFTargetAsmInfo.h"
> #include "llvm/Support/Compiler.h"
>
> namespace llvm {
> @@ -49,16 +50,13 @@
> bool Global) const;
> };
>
> - struct X86COFFTargetAsmInfo : public X86GenericTargetAsmInfo {
> - explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM);
> + struct X86COFFTargetAsmInfo : public X86TargetAsmInfo
> {
> + explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM) :
> + X86TargetAsmInfo(TM) {}
> virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
> bool Global) const;
> - virtual const char *
> - getSectionPrefixForUniqueGlobal(SectionKind kind) const;
> -
> - virtual void getSectionFlagsAsString(SectionKind Kind,
> - SmallVectorImpl &Str)
> const;
> };
> +
>
> struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo {
> explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
--
-Howard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090728/ea8fea75/attachment.html
From mrs at apple.com Mon Jul 27 20:35:35 2009
From: mrs at apple.com (Mike Stump)
Date: Tue, 28 Jul 2009 01:35:35 -0000
Subject: [llvm-commits] [llvm] r77289 -
/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
Message-ID: <200907280135.n6S1ZZKR029983@zion.cs.uiuc.edu>
Author: mrs
Date: Mon Jul 27 20:35:34 2009
New Revision: 77289
URL: http://llvm.org/viewvc/llvm-project?rev=77289&view=rev
Log:
Fix a small little typo.
Modified:
llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=77289&r1=77288&r2=77289&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon Jul 27 20:35:34 2009
@@ -110,7 +110,7 @@
// operator<< - Used for debugging purposes.
//
static raw_ostream& operator<<(raw_ostream &O,
- const LowerSwitch::CaseVector &C) __attribute((used));
+ const LowerSwitch::CaseVector &C) ATTRIBUTE_USED;
static raw_ostream& operator<<(raw_ostream &O,
const LowerSwitch::CaseVector &C) {
O << "[";
From mrs at apple.com Mon Jul 27 20:36:09 2009
From: mrs at apple.com (Mike Stump)
Date: Mon, 27 Jul 2009 18:36:09 -0700
Subject: [llvm-commits] [llvm] r77274 -
/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
In-Reply-To:
References: <200907272333.n6RNXZkU026103@zion.cs.uiuc.edu>
Message-ID: <31B3D2D4-AF91-4615-B4BC-4C3603F6FCA4@apple.com>
On Jul 27, 2009, at 6:06 PM, Howard Su wrote:
> this option is a gcc extension. it cause compile error under VC.
Oops, fixed in r77289.
From gohman at apple.com Mon Jul 27 20:40:03 2009
From: gohman at apple.com (Dan Gohman)
Date: Tue, 28 Jul 2009 01:40:03 -0000
Subject: [llvm-commits] [llvm] r77290 - in /llvm/trunk:
lib/Analysis/ScalarEvolutionExpander.cpp
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
test/Transforms/InstCombine/getelementptr-setcc.ll
test/Transforms/InstCombine/getelementptr-seteq.ll
Message-ID: <200907280140.n6S1e44w030129@zion.cs.uiuc.edu>
Author: djg
Date: Mon Jul 27 20:40:03 2009
New Revision: 77290
URL: http://llvm.org/viewvc/llvm-project?rev=77290&view=rev
Log:
Teach instcombine to respect and preserve inbounds. Add inbounds
to a few tests where it is required for the expected transformation.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
llvm/trunk/test/Transforms/InstCombine/getelementptr-setcc.ll
llvm/trunk/test/Transforms/InstCombine/getelementptr-seteq.ll
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=77290&r1=77289&r2=77290&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Mon Jul 27 20:40:03 2009
@@ -349,7 +349,9 @@
return GEP;
}
- // Insert a pretty getelementptr.
+ // Insert a pretty getelementptr. Note that this GEP is not marked inbounds,
+ // because ScalarEvolution may have changed the address arithmetic to
+ // compute a value which is beyond the end of the allocated object.
Value *GEP = Builder.CreateGEP(V,
GepIndices.begin(),
GepIndices.end(),
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=77290&r1=77289&r2=77290&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jul 27 20:40:03 2009
@@ -213,7 +213,7 @@
Instruction *FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
ConstantInt *DivRHS);
- Instruction *FoldGEPICmp(User *GEPLHS, Value *RHS,
+ Instruction *FoldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
ICmpInst::Predicate Cond, Instruction &I);
Instruction *FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
BinaryOperator &I);
@@ -5559,20 +5559,19 @@
/// FoldGEPICmp - Fold comparisons between a GEP instruction and something
/// else. At this point we know that the GEP is on the LHS of the comparison.
-Instruction *InstCombiner::FoldGEPICmp(User *GEPLHS, Value *RHS,
+Instruction *InstCombiner::FoldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
ICmpInst::Predicate Cond,
Instruction &I) {
- assert(isa(GEPLHS) && "LHS is not a getelementptr!");
-
// Look through bitcasts.
if (BitCastInst *BCI = dyn_cast(RHS))
RHS = BCI->getOperand(0);
Value *PtrBase = GEPLHS->getOperand(0);
- if (TD && PtrBase == RHS) {
+ if (TD && PtrBase == RHS && GEPLHS->isInBounds()) {
// ((gep Ptr, OFFSET) cmp Ptr) ---> (OFFSET cmp 0).
// This transformation (ignoring the base and scales) is valid because we
- // know pointers can't overflow. See if we can output an optimized form.
+ // know pointers can't overflow since the gep is inbounds. See if we can
+ // output an optimized form.
Value *Offset = EvaluateGEPOffsetExpression(GEPLHS, I, *this);
// If not, synthesize the offset the hard way.
@@ -5580,7 +5579,7 @@
Offset = EmitGEPOffset(GEPLHS, I, *this);
return new ICmpInst(*Context, ICmpInst::getSignedPredicate(Cond), Offset,
Context->getNullValue(Offset->getType()));
- } else if (User *GEPRHS = dyn_cast(RHS)) {
+ } else if (GEPOperator *GEPRHS = dyn_cast(RHS)) {
// If the base pointers are different, but the indices are the same, just
// compare the base pointer.
if (PtrBase != GEPRHS->getOperand(0)) {
@@ -6345,10 +6344,10 @@
}
// If we can optimize a 'icmp GEP, P' or 'icmp P, GEP', do so now.
- if (User *GEP = dyn_cast(Op0))
+ if (GEPOperator *GEP = dyn_cast(Op0))
if (Instruction *NI = FoldGEPICmp(GEP, Op1, I.getPredicate(), I))
return NI;
- if (User *GEP = dyn_cast(Op1))
+ if (GEPOperator *GEP = dyn_cast(Op1))
if (Instruction *NI = FoldGEPICmp(GEP, Op0,
ICmpInst::getSwappedPredicate(I.getPredicate()), I))
return NI;
@@ -8252,6 +8251,8 @@
NewIndices.end(), "");
InsertNewInstBefore(NGEP, CI);
NGEP->takeName(GEP);
+ if (cast(GEP)->isInBounds())
+ cast(NGEP)->setIsInBounds(true);
if (isa(CI))
return new BitCastInst(NGEP, CI.getType());
@@ -8981,8 +8982,11 @@
// If we found a path from the src to dest, create the getelementptr now.
if (SrcElTy == DstElTy) {
SmallVector Idxs(NumZeros+1, ZeroUInt);
- return GetElementPtrInst::Create(Src, Idxs.begin(), Idxs.end(), "",
- ((Instruction*) NULL));
+ Instruction *GEP = GetElementPtrInst::Create(Src,
+ Idxs.begin(), Idxs.end(), "",
+ ((Instruction*) NULL));
+ cast(GEP)->setIsInBounds(true);
+ return GEP;
}
}
@@ -10663,8 +10667,12 @@
}
Value *Base = FixedOperands[0];
- return GetElementPtrInst::Create(Base, FixedOperands.begin()+1,
- FixedOperands.end());
+ GetElementPtrInst *GEP =
+ GetElementPtrInst::Create(Base, FixedOperands.begin()+1,
+ FixedOperands.end());
+ if (cast(FirstInst)->isInBounds())
+ cast(GEP)->setIsInBounds(true);
+ return GEP;
}
@@ -11055,8 +11063,12 @@
// getelementptr instructions into a single instruction.
//
SmallVector SrcGEPOperands;
- if (User *Src = dyn_cast(PtrOp))
+ bool BothInBounds = cast(&GEP)->isInBounds();
+ if (GEPOperator *Src = dyn_cast(PtrOp)) {
SrcGEPOperands.append(Src->op_begin(), Src->op_end());
+ if (!Src->isInBounds())
+ BothInBounds = false;
+ }
if (!SrcGEPOperands.empty()) {
// Note that if our source is a gep chain itself that we wait for that
@@ -11140,9 +11152,15 @@
Indices.insert(Indices.end(), GEP.idx_begin()+1, GEP.idx_end());
}
- if (!Indices.empty())
- return GetElementPtrInst::Create(SrcGEPOperands[0], Indices.begin(),
- Indices.end(), GEP.getName());
+ if (!Indices.empty()) {
+ GetElementPtrInst *NewGEP = GetElementPtrInst::Create(SrcGEPOperands[0],
+ Indices.begin(),
+ Indices.end(),
+ GEP.getName());
+ if (BothInBounds)
+ cast(NewGEP)->setIsInBounds(true);
+ return NewGEP;
+ }
} else if (GlobalValue *GV = dyn_cast(PtrOp)) {
// GEP of global variable. If all of the indices for this GEP are
@@ -11180,8 +11198,12 @@
if (CATy->getElementType() == XTy->getElementType()) {
// -> GEP i8* X, ...
SmallVector Indices(GEP.idx_begin()+1, GEP.idx_end());
- return GetElementPtrInst::Create(X, Indices.begin(), Indices.end(),
- GEP.getName());
+ GetElementPtrInst *NewGEP =
+ GetElementPtrInst::Create(X, Indices.begin(), Indices.end(),
+ GEP.getName());
+ if (cast(&GEP)->isInBounds())
+ cast(NewGEP)->setIsInBounds(true);
+ return NewGEP;
} else if (const ArrayType *XATy =
dyn_cast(XTy->getElementType())) {
// GEP (bitcast [10 x i8]* X to [0 x i8]*), i32 0, ... ?
@@ -11208,8 +11230,11 @@
Value *Idx[2];
Idx[0] = Context->getNullValue(Type::Int32Ty);
Idx[1] = GEP.getOperand(1);
- Value *V = InsertNewInstBefore(
- GetElementPtrInst::Create(X, Idx, Idx + 2, GEP.getName()), GEP);
+ GetElementPtrInst *NewGEP =
+ GetElementPtrInst::Create(X, Idx, Idx + 2, GEP.getName());
+ if (cast(&GEP)->isInBounds())
+ cast(NewGEP)->setIsInBounds(true);
+ Value *V = InsertNewInstBefore(NewGEP, GEP);
// V and GEP are both pointer types --> BitCast
return new BitCastInst(V, GEP.getType());
}
@@ -11271,6 +11296,8 @@
Idx[1] = NewIdx;
Instruction *NewGEP =
GetElementPtrInst::Create(X, Idx, Idx + 2, GEP.getName());
+ if (cast(&GEP)->isInBounds())
+ cast(NewGEP)->setIsInBounds(true);
NewGEP = InsertNewInstBefore(NewGEP, GEP);
// The NewGEP must be pointer typed, so must the old one -> BitCast
return new BitCastInst(NewGEP, GEP.getType());
@@ -11323,6 +11350,8 @@
GetElementPtrInst::Create(BCI->getOperand(0), NewIndices.begin(),
NewIndices.end());
if (NGEP->getType() == GEP.getType()) return NGEP;
+ if (cast(&GEP)->isInBounds())
+ cast(NGEP)->setIsInBounds(true);
InsertNewInstBefore(NGEP, GEP);
NGEP->takeName(&GEP);
return new BitCastInst(NGEP, GEP.getType());
@@ -11366,6 +11395,7 @@
Idx[1] = NullIdx;
Value *V = GetElementPtrInst::Create(New, Idx, Idx + 2,
New->getName()+".sub", It);
+ cast(V)->setIsInBounds(true);
// Now make everything use the getelementptr instead of the original
// allocation.
@@ -11745,6 +11775,7 @@
CastOp = IC.InsertNewInstBefore(
GetElementPtrInst::Create(CastOp, NewGEPIndices.begin(),
NewGEPIndices.end()), SI);
+ cast(CastOp)->setIsInBounds(true);
}
if (Constant *C = dyn_cast(SIOp0))
@@ -12428,6 +12459,7 @@
Context->getPointerType(EI.getType(), AS),EI);
GetElementPtrInst *GEP =
GetElementPtrInst::Create(Ptr, EI.getOperand(1), I->getName()+".gep");
+ cast(GEP)->setIsInBounds(true);
InsertNewInstBefore(GEP, EI);
return new LoadInst(GEP);
}
Modified: llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll?rev=77290&r1=77289&r2=77290&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll Mon Jul 27 20:40:03 2009
@@ -10,7 +10,7 @@
entry:
%orientations = alloca [1 x [1 x %struct.x]] ; <[1 x [1 x %struct.x]]*> [#uses=2]
%tmp3 = call i32 @puts( i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0) ) nounwind ; [#uses=0]
- %tmp45 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 1, i32 0, i32 0 ; <%struct.x*> [#uses=1]
+ %tmp45 = getelementptr inbounds [1 x [1 x %struct.x]]* %orientations, i32 1, i32 0, i32 0 ; <%struct.x*> [#uses=1]
%orientations62 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 0, i32 0, i32 0 ; <%struct.x*> [#uses=1]
br label %bb10
@@ -18,7 +18,7 @@
%indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb10 ] ; [#uses=2]
%tmp.0.reg2mem.0.rec = mul i32 %indvar, -1 ; [#uses=1]
%tmp12.rec = add i32 %tmp.0.reg2mem.0.rec, -1 ; [#uses=1]
- %tmp12 = getelementptr %struct.x* %tmp45, i32 %tmp12.rec ; <%struct.x*> [#uses=2]
+ %tmp12 = getelementptr inbounds %struct.x* %tmp45, i32 %tmp12.rec ; <%struct.x*> [#uses=2]
%tmp16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind ; [#uses=0]
%tmp84 = icmp eq %struct.x* %tmp12, %orientations62 ; [#uses=1]
%indvar.next = add i32 %indvar, 1 ; [#uses=1]
Modified: llvm/trunk/test/Transforms/InstCombine/getelementptr-setcc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/getelementptr-setcc.ll?rev=77290&r1=77289&r2=77290&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/getelementptr-setcc.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/getelementptr-setcc.ll Mon Jul 27 20:40:03 2009
@@ -2,28 +2,28 @@
; RUN: not grep getelementptr
define i1 @test1(i16* %P, i32 %I, i32 %J) {
- %X = getelementptr i16* %P, i32 %I ; [#uses=1]
- %Y = getelementptr i16* %P, i32 %J ; [#uses=1]
+ %X = getelementptr inbounds i16* %P, i32 %I ; [#uses=1]
+ %Y = getelementptr inbounds i16* %P, i32 %J ; [#uses=1]
%C = icmp ult i16* %X, %Y ; [#uses=1]
ret i1 %C
}
define i1 @test2(i16* %P, i32 %I) {
- %X = getelementptr i16* %P, i32 %I ; [#uses=1]
+ %X = getelementptr inbounds i16* %P, i32 %I ; [#uses=1]
%C = icmp ult i16* %X, %P ; [#uses=1]
ret i1 %C
}
define i32 @test3(i32* %P, i32 %A, i32 %B) {
- %tmp.4 = getelementptr i32* %P, i32 %A ; [#uses=1]
- %tmp.9 = getelementptr i32* %P, i32 %B ; [#uses=1]
+ %tmp.4 = getelementptr inbounds i32* %P, i32 %A ; [#uses=1]
+ %tmp.9 = getelementptr inbounds i32* %P, i32 %B ; [#uses=1]
%tmp.10 = icmp eq i32* %tmp.4, %tmp.9 ; [#uses=1]
%tmp.11 = zext i1 %tmp.10 to i32 ; [#uses=1]
ret i32 %tmp.11
}
define i32 @test4(i32* %P, i32 %A, i32 %B) {
- %tmp.4 = getelementptr i32* %P, i32 %A ; [#uses=1]
+ %tmp.4 = getelementptr inbounds i32* %P, i32 %A ; [#uses=1]
%tmp.6 = icmp eq i32* %tmp.4, %P ; [#uses=1]
%tmp.7 = zext i1 %tmp.6 to i32 ; [#uses=1]
ret i32 %tmp.7
Modified: llvm/trunk/test/Transforms/InstCombine/getelementptr-seteq.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/getelementptr-seteq.ll?rev=77290&r1=77289&r2=77290&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/getelementptr-seteq.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/getelementptr-seteq.ll Mon Jul 27 20:40:03 2009
@@ -5,8 +5,8 @@
%S = type { i32, [ 100 x i32] }
define i1 @test(i64 %X, %S* %P) {
- %A = getelementptr %S* %P, i32 0, i32 1, i64 %X
- %B = getelementptr %S* %P, i32 0, i32 0
+ %A = getelementptr inbounds %S* %P, i32 0, i32 1, i64 %X
+ %B = getelementptr inbounds %S* %P, i32 0, i32 0
%C = icmp eq i32* %A, %B
ret i1 %C
}
From daniel at zuster.org Mon Jul 27 22:00:54 2009
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 28 Jul 2009 03:00:54 -0000
Subject: [llvm-commits] [llvm] r77292 - in /llvm/trunk/tools/llvm-mc:
AsmLexer.cpp AsmLexer.h
Message-ID: <200907280300.n6S30sGv032343@zion.cs.uiuc.edu>
Author: ddunbar
Date: Mon Jul 27 22:00:54 2009
New Revision: 77292
URL: http://llvm.org/viewvc/llvm-project?rev=77292&view=rev
Log:
llvm-mc: Factor AsmToken class out of AsmLexer.
Modified:
llvm/trunk/tools/llvm-mc/AsmLexer.cpp
llvm/trunk/tools/llvm-mc/AsmLexer.h
Modified: llvm/trunk/tools/llvm-mc/AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmLexer.cpp?rev=77292&r1=77291&r2=77292&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmLexer.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmLexer.cpp Mon Jul 27 22:00:54 2009
@@ -20,10 +20,11 @@
#include
using namespace llvm;
-AsmLexer::AsmLexer(SourceMgr &SM) : SrcMgr(SM) {
+AsmLexer::AsmLexer(SourceMgr &SM) : SrcMgr(SM) {
CurBuffer = 0;
CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
CurPtr = CurBuf->getBufferStart();
+ CurTok = AsmToken(asmtok::Error, StringRef(CurPtr, 0));
TokStart = 0;
}
@@ -41,9 +42,9 @@
/// ReturnError - Set the error to the specified string at the specified
/// location. This is defined to always return asmtok::Error.
-asmtok::TokKind AsmLexer::ReturnError(const char *Loc, const std::string &Msg) {
+AsmToken AsmLexer::ReturnError(const char *Loc, const std::string &Msg) {
SrcMgr.PrintMessage(SMLoc::getFromPointer(Loc), Msg, "error");
- return asmtok::Error;
+ return AsmToken(asmtok::Error, StringRef(Loc, 0));
}
/// EnterIncludeFile - Enter the specified file. This prints an error and
@@ -94,35 +95,31 @@
}
/// LexIdentifier: [a-zA-Z_.][a-zA-Z0-9_$.@]*
-asmtok::TokKind AsmLexer::LexIdentifier() {
+AsmToken AsmLexer::LexIdentifier() {
while (isalnum(*CurPtr) || *CurPtr == '_' || *CurPtr == '$' ||
*CurPtr == '.' || *CurPtr == '@')
++CurPtr;
- // Unique string.
- CurStrVal = StringRef(TokStart, CurPtr - TokStart);
- return asmtok::Identifier;
+ return AsmToken(asmtok::Identifier, StringRef(TokStart, CurPtr - TokStart));
}
/// LexPercent: Register: %[a-zA-Z0-9]+
-asmtok::TokKind AsmLexer::LexPercent() {
+AsmToken AsmLexer::LexPercent() {
if (!isalnum(*CurPtr))
- return asmtok::Percent; // Single %.
+ return AsmToken(asmtok::Percent, StringRef(CurPtr, 1)); // Single %.
while (isalnum(*CurPtr))
++CurPtr;
- // Unique string.
- CurStrVal = StringRef(TokStart, CurPtr - TokStart);
- return asmtok::Register;
+ return AsmToken(asmtok::Register, StringRef(TokStart, CurPtr - TokStart));
}
/// LexSlash: Slash: /
/// C-Style Comment: /* ... */
-asmtok::TokKind AsmLexer::LexSlash() {
+AsmToken AsmLexer::LexSlash() {
switch (*CurPtr) {
case '*': break; // C style comment.
case '/': return ++CurPtr, LexLineComment();
- default: return asmtok::Slash;
+ default: return AsmToken(asmtok::Slash, StringRef(CurPtr, 1));
}
// C Style comment.
@@ -144,14 +141,16 @@
/// LexLineComment: Comment: #[^\n]*
/// : //[^\n]*
-asmtok::TokKind AsmLexer::LexLineComment() {
+AsmToken AsmLexer::LexLineComment() {
+ // FIXME: This is broken if we happen to a comment at the end of a file, which
+ // was .included, and which doesn't end with a newline.
int CurChar = getNextChar();
while (CurChar != '\n' && CurChar != '\n' && CurChar != EOF)
CurChar = getNextChar();
if (CurChar == EOF)
- return asmtok::Eof;
- return asmtok::EndOfStatement;
+ return AsmToken(asmtok::Eof, StringRef(CurPtr, 0));
+ return AsmToken(asmtok::EndOfStatement, StringRef(CurPtr, 0));
}
@@ -163,7 +162,7 @@
/// Hex integer: 0x[0-9a-fA-F]+
/// Decimal integer: [1-9][0-9]*
/// TODO: FP literal.
-asmtok::TokKind AsmLexer::LexDigit() {
+AsmToken AsmLexer::LexDigit() {
if (*CurPtr == ':')
return ReturnError(TokStart, "FIXME: local label not implemented");
if (*CurPtr == 'f' || *CurPtr == 'b')
@@ -173,8 +172,8 @@
if (CurPtr[-1] != '0') {
while (isdigit(*CurPtr))
++CurPtr;
- CurIntVal = strtoll(TokStart, 0, 10);
- return asmtok::IntVal;
+ return AsmToken(asmtok::IntVal, StringRef(TokStart, CurPtr - TokStart),
+ strtoll(TokStart, 0, 10));
}
if (*CurPtr == 'b') {
@@ -186,8 +185,8 @@
// Requires at least one binary digit.
if (CurPtr == NumStart)
return ReturnError(CurPtr-2, "Invalid binary number");
- CurIntVal = strtoll(NumStart, 0, 2);
- return asmtok::IntVal;
+ return AsmToken(asmtok::IntVal, StringRef(TokStart, CurPtr - TokStart),
+ strtoll(NumStart, 0, 2));
}
if (*CurPtr == 'x') {
@@ -201,29 +200,28 @@
return ReturnError(CurPtr-2, "Invalid hexadecimal number");
errno = 0;
- CurIntVal = strtoll(NumStart, 0, 16);
if (errno == EINVAL)
return ReturnError(CurPtr-2, "Invalid hexadecimal number");
if (errno == ERANGE) {
errno = 0;
- CurIntVal = (int64_t)strtoull(NumStart, 0, 16);
if (errno == EINVAL)
return ReturnError(CurPtr-2, "Invalid hexadecimal number");
if (errno == ERANGE)
return ReturnError(CurPtr-2, "Hexadecimal number out of range");
}
- return asmtok::IntVal;
+ return AsmToken(asmtok::IntVal, StringRef(TokStart, CurPtr - TokStart),
+ (int64_t) strtoull(NumStart, 0, 16));
}
// Must be an octal number, it starts with 0.
while (*CurPtr >= '0' && *CurPtr <= '7')
++CurPtr;
- CurIntVal = strtoll(TokStart, 0, 8);
- return asmtok::IntVal;
+ return AsmToken(asmtok::IntVal, StringRef(TokStart, CurPtr - TokStart),
+ strtoll(TokStart, 0, 8));
}
/// LexQuote: String: "..."
-asmtok::TokKind AsmLexer::LexQuote() {
+AsmToken AsmLexer::LexQuote() {
int CurChar = getNextChar();
// TODO: does gas allow multiline string constants?
while (CurChar != '"') {
@@ -238,13 +236,11 @@
CurChar = getNextChar();
}
- // Unique string, include quotes for now.
- CurStrVal = StringRef(TokStart, CurPtr - TokStart);
- return asmtok::String;
+ return AsmToken(asmtok::String, StringRef(TokStart, CurPtr - TokStart));
}
-asmtok::TokKind AsmLexer::LexToken() {
+AsmToken AsmLexer::LexToken() {
TokStart = CurPtr;
// This always consumes at least one character.
int CurChar = getNextChar();
@@ -257,7 +253,7 @@
// Unknown character, emit an error.
return ReturnError(TokStart, "invalid character in input");
- case EOF: return asmtok::Eof;
+ case EOF: return AsmToken(asmtok::Eof, StringRef(TokStart, 0));
case 0:
case ' ':
case '\t':
@@ -265,33 +261,33 @@
return LexToken();
case '\n': // FALL THROUGH.
case '\r': // FALL THROUGH.
- case ';': return asmtok::EndOfStatement;
- case ':': return asmtok::Colon;
- case '+': return asmtok::Plus;
- case '-': return asmtok::Minus;
- case '~': return asmtok::Tilde;
- case '(': return asmtok::LParen;
- case ')': return asmtok::RParen;
- case '*': return asmtok::Star;
- case ',': return asmtok::Comma;
- case '$': return asmtok::Dollar;
+ case ';': return AsmToken(asmtok::EndOfStatement, StringRef(TokStart, 1));
+ case ':': return AsmToken(asmtok::Colon, StringRef(TokStart, 1));
+ case '+': return AsmToken(asmtok::Plus, StringRef(TokStart, 1));
+ case '-': return AsmToken(asmtok::Minus, StringRef(TokStart, 1));
+ case '~': return AsmToken(asmtok::Tilde, StringRef(TokStart, 1));
+ case '(': return AsmToken(asmtok::LParen, StringRef(TokStart, 1));
+ case ')': return AsmToken(asmtok::RParen, StringRef(TokStart, 1));
+ case '*': return AsmToken(asmtok::Star, StringRef(TokStart, 1));
+ case ',': return AsmToken(asmtok::Comma, StringRef(TokStart, 1));
+ case '$': return AsmToken(asmtok::Dollar, StringRef(TokStart, 1));
case '=':
if (*CurPtr == '=')
- return ++CurPtr, asmtok::EqualEqual;
- return asmtok::Equal;
+ return ++CurPtr, AsmToken(asmtok::EqualEqual, StringRef(TokStart, 2));
+ return AsmToken(asmtok::Equal, StringRef(TokStart, 1));
case '|':
if (*CurPtr == '|')
- return ++CurPtr, asmtok::PipePipe;
- return asmtok::Pipe;
- case '^': return asmtok::Caret;
+ return ++CurPtr, AsmToken(asmtok::PipePipe, StringRef(TokStart, 2));
+ return AsmToken(asmtok::Pipe, StringRef(TokStart, 1));
+ case '^': return AsmToken(asmtok::Caret, StringRef(TokStart, 1));
case '&':
if (*CurPtr == '&')
- return ++CurPtr, asmtok::AmpAmp;
- return asmtok::Amp;
+ return ++CurPtr, AsmToken(asmtok::AmpAmp, StringRef(TokStart, 2));
+ return AsmToken(asmtok::Amp, StringRef(TokStart, 1));
case '!':
if (*CurPtr == '=')
- return ++CurPtr, asmtok::ExclaimEqual;
- return asmtok::Exclaim;
+ return ++CurPtr, AsmToken(asmtok::ExclaimEqual, StringRef(TokStart, 2));
+ return AsmToken(asmtok::Exclaim, StringRef(TokStart, 1));
case '%': return LexPercent();
case '/': return LexSlash();
case '#': return LexLineComment();
@@ -301,16 +297,21 @@
return LexDigit();
case '<':
switch (*CurPtr) {
- case '<': return ++CurPtr, asmtok::LessLess;
- case '=': return ++CurPtr, asmtok::LessEqual;
- case '>': return ++CurPtr, asmtok::LessGreater;
- default: return asmtok::Less;
+ case '<': return ++CurPtr, AsmToken(asmtok::LessLess,
+ StringRef(TokStart, 2));
+ case '=': return ++CurPtr, AsmToken(asmtok::LessEqual,
+ StringRef(TokStart, 2));
+ case '>': return ++CurPtr, AsmToken(asmtok::LessGreater,
+ StringRef(TokStart, 2));
+ default: return AsmToken(asmtok::Less, StringRef(TokStart, 1));
}
case '>':
switch (*CurPtr) {
- case '>': return ++CurPtr, asmtok::GreaterGreater;
- case '=': return ++CurPtr, asmtok::GreaterEqual;
- default: return asmtok::Greater;
+ case '>': return ++CurPtr, AsmToken(asmtok::GreaterGreater,
+ StringRef(TokStart, 2));
+ case '=': return ++CurPtr, AsmToken(asmtok::GreaterEqual,
+ StringRef(TokStart, 2));
+ default: return AsmToken(asmtok::Greater, StringRef(TokStart, 1));
}
// TODO: Quoted identifiers (objc methods etc)
Modified: llvm/trunk/tools/llvm-mc/AsmLexer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmLexer.h?rev=77292&r1=77291&r2=77292&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmLexer.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmLexer.h Mon Jul 27 22:00:54 2009
@@ -53,6 +53,35 @@
};
}
+/// AsmToken - Target independent representation for an assembler token.
+struct AsmToken {
+ asmtok::TokKind Kind;
+
+ /// A reference to the entire token contents; this is always a pointer into
+ /// a memory buffer owned by the source manager.
+ StringRef Str;
+
+ int64_t IntVal;
+
+public:
+ AsmToken() {}
+ AsmToken(asmtok::TokKind _Kind, const StringRef &_Str, int64_t _IntVal = 0)
+ : Kind(_Kind), Str(_Str), IntVal(_IntVal) {}
+
+ asmtok::TokKind getKind() const { return Kind; }
+ bool is(asmtok::TokKind K) const { return Kind == K; }
+ bool isNot(asmtok::TokKind K) const { return Kind != K; }
+
+ SMLoc getLoc() const;
+
+ StringRef getString() const { return Str; }
+
+ int64_t getIntVal() const {
+ assert(Kind == asmtok::IntVal && "This token isn't an integer");
+ return IntVal;
+ }
+};
+
/// AsmLexer - Lexer class for assembly files.
class AsmLexer : public MCAsmLexer {
SourceMgr &SrcMgr;
@@ -60,14 +89,13 @@
const char *CurPtr;
const MemoryBuffer *CurBuf;
- // Information about the current token.
const char *TokStart;
- asmtok::TokKind CurKind;
- StringRef CurStrVal; // This is valid for Identifier.
- int64_t CurIntVal;
+
+ /// The current token.
+ AsmToken CurTok;
- /// CurBuffer - This is the current buffer index we're lexing from as managed
- /// by the SourceMgr object.
+ /// This is the current buffer index we're lexing from as managed by the
+ /// SourceMgr object.
int CurBuffer;
void operator=(const AsmLexer&); // DO NOT IMPLEMENT
@@ -77,12 +105,12 @@
~AsmLexer();
asmtok::TokKind Lex() {
- return CurKind = LexToken();
+ return CurTok = LexToken(), getKind();
}
- asmtok::TokKind getKind() const { return CurKind; }
- bool is(asmtok::TokKind K) const { return CurKind == K; }
- bool isNot(asmtok::TokKind K) const { return CurKind != K; }
+ asmtok::TokKind getKind() const { return CurTok.getKind(); }
+ bool is(asmtok::TokKind K) const { return CurTok.is(K); }
+ bool isNot(asmtok::TokKind K) const { return CurTok.isNot(K); }
/// getCurStrVal - Get the string for the current token, this includes all
/// characters (for example, the quotes on strings) in the token.
@@ -90,14 +118,10 @@
/// The returned StringRef points into the source manager's memory buffer, and
/// is safe to store across calls to Lex().
StringRef getCurStrVal() const {
- assert((CurKind == asmtok::Identifier || CurKind == asmtok::Register ||
- CurKind == asmtok::String) &&
- "This token doesn't have a string value");
- return CurStrVal;
+ return CurTok.getString();
}
int64_t getCurIntVal() const {
- assert(CurKind == asmtok::IntVal && "This token isn't an integer");
- return CurIntVal;
+ return CurTok.getIntVal();
}
SMLoc getLoc() const;
@@ -109,16 +133,16 @@
private:
int getNextChar();
- asmtok::TokKind ReturnError(const char *Loc, const std::string &Msg);
+ AsmToken ReturnError(const char *Loc, const std::string &Msg);
/// LexToken - Read the next token and return its code.
- asmtok::TokKind LexToken();
- asmtok::TokKind LexIdentifier();
- asmtok::TokKind LexPercent();
- asmtok::TokKind LexSlash();
- asmtok::TokKind LexLineComment();
- asmtok::TokKind LexDigit();
- asmtok::TokKind LexQuote();
+ AsmToken LexToken();
+ AsmToken LexIdentifier();
+ AsmToken LexPercent();
+ AsmToken LexSlash();
+ AsmToken LexLineComment();
+ AsmToken LexDigit();
+ AsmToken LexQuote();
};
} // end namespace llvm
From sabre at nondot.org Mon Jul 27 22:05:41 2009
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 28 Jul 2009 03:05:41 -0000
Subject: [llvm-commits] [llvm] r77293 -
/llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h
Message-ID: <200907280305.n6S35gb6032471@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 22:05:40 2009
New Revision: 77293
URL: http://llvm.org/viewvc/llvm-project?rev=77293&view=rev
Log:
don't copy TargetLowering.
Modified:
llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h
Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h?rev=77293&r1=77292&r2=77293&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h Mon Jul 27 22:05:40 2009
@@ -31,7 +31,7 @@
/// PIC16Lowering - This object fully describes how to lower LLVM code to an
/// PIC16-specific SelectionDAG.
- PIC16TargetLowering PIC16Lowering;
+ PIC16TargetLowering &PIC16Lowering;
public:
explicit PIC16DAGToDAGISel(PIC16TargetMachine &tm) :
From sabre at nondot.org Mon Jul 27 22:13:25 2009
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 28 Jul 2009 03:13:25 -0000
Subject: [llvm-commits] [llvm] r77294 - in /llvm/trunk:
include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/
lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/
lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/
lib/Target/Alpha/AsmPrinter/ lib/Target/CellSPU/
lib/Target/CellSPU/AsmPrinter/ lib/Target/MSP430/ lib/Target/Mips/
lib/Target/Mips/AsmPrinter/ lib/Target/PIC16/ lib/Target/PowerPC/
lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/
lib/Target/Sparc/AsmPrinter/ lib/Target/SystemZ/ lib/Target/SystemZ...
Message-ID: <200907280313.n6S3DT9k000302@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Jul 27 22:13:23 2009
New Revision: 77294
URL: http://llvm.org/viewvc/llvm-project?rev=77294&view=rev
Log:
Rip all of the global variable lowering logic out of TargetAsmInfo. Since
it is highly specific to the object file that will be generated in the end,
this introduces a new TargetLoweringObjectFile interface that is implemented
for each of ELF/MachO/COFF/Alpha/PIC16 and XCore.
Though still is still a brutal and ugly refactoring, this is a major step
towards goodness.
This patch also:
1. fixes a bunch of dangling pointer problems in the PIC16 backend.
2. disables the TargetLowering copy ctor which PIC16 was accidentally using.
3. gets us closer to xcore having its own crazy target section flags and
pic16 not having to shadow sections with its own objects.
4. fixes wierdness where ELF targets would set CStringSection but not
CStringSection_. Factor the code better.
5. fixes some bugs in string lowering on ELF targets.
Added:
llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp
llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.h
llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp
llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.h
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/include/llvm/Target/TargetLowering.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp
llvm/trunk/lib/CodeGen/ELFWriter.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
llvm/trunk/lib/Target/CMakeLists.txt
llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp
llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp
llvm/trunk/lib/Target/MSP430/MSP430TargetAsmInfo.cpp
llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
llvm/trunk/lib/Target/PIC16/CMakeLists.txt
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h
llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h
llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.cpp
llvm/trunk/lib/Target/Sparc/SparcTargetAsmInfo.h
llvm/trunk/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/trunk/lib/Target/SystemZ/SystemZTargetAsmInfo.cpp
llvm/trunk/lib/Target/TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
llvm/trunk/lib/Target/XCore/CMakeLists.txt
llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.h
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Mon Jul 27 22:13:23 2009
@@ -39,6 +39,7 @@
class Mangler;
class Section;
class TargetAsmInfo;
+ class TargetLoweringObjectFile;
class Type;
class formatted_raw_ostream;
@@ -75,6 +76,9 @@
///
TargetMachine &TM;
+ /// getObjFileLowering - Return information about object file lowering.
+ const TargetLoweringObjectFile &getObjFileLowering() const;
+
/// Target Asm Printer information.
///
const TargetAsmInfo *TAI;
Modified: llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/COFFTargetAsmInfo.h Mon Jul 27 22:13:23 2009
@@ -16,15 +16,9 @@
class COFFTargetAsmInfo : public TargetAsmInfo {
protected:
explicit COFFTargetAsmInfo(const TargetMachine &TM);
- public:
- virtual void getSectionFlagsAsString(SectionKind Kind,
- SmallVectorImpl &Str) const;
-
- virtual const Section *
- SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind) const;
};
}
-#endif // LLVM_ELF_TARGET_ASM_INFO_H
+#endif // LLVM_COFF_TARGET_ASM_INFO_H
Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Mon Jul 27 22:13:23 2009
@@ -24,27 +24,9 @@
class Mangler;
struct DarwinTargetAsmInfo : public TargetAsmInfo {
- const Section* TextCoalSection;
- const Section* ConstTextCoalSection;
- const Section* ConstDataCoalSection;
- const Section* ConstDataSection;
- const Section* DataCoalSection;
- const Section* FourByteConstantSection;
- const Section* EightByteConstantSection;
- const Section* SixteenByteConstantSection;
-
explicit DarwinTargetAsmInfo(const TargetMachine &TM);
- virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind) const;
virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
Mangler *Mang) const;
-
-
- virtual const Section *
- getSectionForMergeableConstant(SectionKind Kind) const;
-
- private:
- const Section* MergeableStringSection(const GlobalVariable *GV) const;
};
}
Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Mon Jul 27 22:13:23 2009
@@ -21,29 +21,6 @@
struct ELFTargetAsmInfo : public TargetAsmInfo {
ELFTargetAsmInfo(const TargetMachine &TM);
-
- /// getSectionForMergeableConstant - Given a mergeable constant with the
- /// specified size and relocation information, return a section that it
- /// should be placed in.
- virtual const Section *
- getSectionForMergeableConstant(SectionKind Kind) const;
-
- virtual SectionKind::Kind getKindForNamedSection(const char *Section,
- SectionKind::Kind K) const;
- void getSectionFlagsAsString(SectionKind Kind,
- SmallVectorImpl &Str) const;
-
- virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind) const;
-
- const Section *DataRelSection;
- const Section *DataRelLocalSection;
- const Section *DataRelROSection;
- const Section *DataRelROLocalSection;
-
- const Section *MergeableConst4Section;
- const Section *MergeableConst8Section;
- const Section *MergeableConst16Section;
};
}
Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Jul 27 22:13:23 2009
@@ -214,15 +214,12 @@
};
class Section {
- friend class TargetAsmInfo;
- friend class StringMapEntry;
- friend class StringMap;
+ public:
std::string Name;
SectionKind Kind;
- explicit Section() { }
- public:
+ explicit Section() { }
const std::string &getName() const { return Name; }
SectionKind getKind() const { return Kind; }
};
@@ -230,8 +227,6 @@
/// TargetAsmInfo - This class is intended to be used as a base class for asm
/// properties and features specific to the target.
class TargetAsmInfo {
- private:
- mutable StringMap Sections;
protected:
/// TM - The current TargetMachine.
const TargetMachine &TM;
@@ -240,33 +235,11 @@
// Properties to be set by the target writer, used to configure asm printer.
//
- /// TextSection - Section directive for standard text.
- ///
- const Section *TextSection; // Defaults to ".text".
-
- /// DataSection - Section directive for standard data.
- ///
- const Section *DataSection; // Defaults to ".data".
-
/// BSSSection - Section directive for uninitialized data. Null if this
/// target doesn't support a BSS section.
///
+/// FIXME: REMOVE.
const char *BSSSection; // Default to ".bss".
- const Section *BSSSection_;
-
- /// ReadOnlySection - This is the directive that is emitted to switch to a
- /// read-only section for constant data (e.g. data declared const,
- /// jump tables).
- const Section *ReadOnlySection; // Defaults to NULL
-
- /// TLSDataSection - Section directive for Thread Local data.
- ///
- const Section *TLSDataSection; // Defaults to ".tdata".
-
- /// TLSBSSSection - Section directive for Thread Local uninitialized data.
- /// Null if this target doesn't support a BSS section.
- ///
- const Section *TLSBSSSection; // Defaults to ".tbss".
/// ZeroFillDirective - Directive for emitting a global to the ZeroFill
/// section on this target. Null if this target doesn't support zerofill.
@@ -456,8 +429,8 @@
/// cstring constants (null terminated string that does not contain any
/// other null bytes) on this target. This is commonly supported as
/// ".cstring".
+/// FIXME: REMOVE.
const char *CStringSection; // Defaults to NULL
- const Section *CStringSection_;
/// StaticCtorsSection - This is the directive that is emitted to switch to
/// a section to emit the static constructor list.
@@ -642,10 +615,6 @@
explicit TargetAsmInfo(const TargetMachine &TM);
virtual ~TargetAsmInfo();
- const Section *getOrCreateSection(const char *Name,
- bool isDirective,
- SectionKind::Kind K) const;
-
/// Measure the specified inline asm to determine an approximation of its
/// length.
virtual unsigned getInlineAsmLength(const char *Str) const;
@@ -665,48 +634,6 @@
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const;
-
- /// getSectionForMergeableConstant - Given a Mergeable constant with the
- /// specified size and relocation information, return a section that it
- /// should be placed in.
- virtual const Section *getSectionForMergeableConstant(SectionKind Kind)const;
-
-
- /// getKindForNamedSection - If this target wants to be able to override
- /// section flags based on the name of the section specified for a global
- /// variable, it can implement this. This is used on ELF systems so that
- /// ".tbss" gets the TLS bit set etc.
- virtual SectionKind::Kind getKindForNamedSection(const char *Section,
- SectionKind::Kind K) const{
- return K;
- }
-
- /// SectionForGlobal - This method computes the appropriate section to emit
- /// the specified global variable or function definition. This should not
- /// be passed external (or available externally) globals.
- // FIXME: MOVE TO ASMPRINTER.
- const Section* SectionForGlobal(const GlobalValue *GV) const;
-
- /// getSpecialCasedSectionGlobals - Allow the target to completely override
- /// section assignment of a global.
- /// FIXME: ELIMINATE this by making PIC16 implement ADDRESS with
- /// getFlagsForNamedSection.
- virtual const Section *
- getSpecialCasedSectionGlobals(const GlobalValue *GV,
- SectionKind Kind) const {
- return 0;
- }
-
- /// getSectionFlagsAsString - Turn the flags in the specified SectionKind
- /// into a string that can be printed to the assembly file after the
- /// ".section foo" part of a section directive.
- virtual void getSectionFlagsAsString(SectionKind Kind,
- SmallVectorImpl &Str) const {
- }
-
-// FIXME: Eliminate this.
- virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind) const;
/// getSLEB128Size - Compute the number of bytes required for a signed
/// leb128 value.
@@ -734,27 +661,9 @@
// Accessors.
//
- const Section *getTextSection() const {
- return TextSection;
- }
- const Section *getDataSection() const {
- return DataSection;
- }
const char *getBSSSection() const {
return BSSSection;
}
- const Section *getBSSSection_() const {
- return BSSSection_;
- }
- const Section *getReadOnlySection() const {
- return ReadOnlySection;
- }
- const Section *getTLSDataSection() const {
- return TLSDataSection;
- }
- const Section *getTLSBSSSection() const {
- return TLSBSSSection;
- }
const char *getZeroFillDirective() const {
return ZeroFillDirective;
}
@@ -869,9 +778,6 @@
const char *getCStringSection() const {
return CStringSection;
}
- const Section *getCStringSection_() const {
- return CStringSection_;
- }
const char *getStaticCtorsSection() const {
return StaticCtorsSection;
}
Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Jul 27 22:13:23 2009
@@ -54,6 +54,7 @@
class TargetMachine;
class TargetRegisterClass;
class TargetSubtarget;
+ class TargetLoweringObjectFile;
class Value;
// FIXME: should this be here?
@@ -77,6 +78,8 @@
/// target-specific constructs to SelectionDAG operators.
///
class TargetLowering {
+ TargetLowering(const TargetLowering&); // DO NOT IMPLEMENT
+ void operator=(const TargetLowering&); // DO NOT IMPLEMENT
public:
/// LegalizeAction - This enum indicates whether operations are valid for a
/// target, and if not, what action should be used to make them valid.
@@ -98,11 +101,13 @@
SchedulingForRegPressure // Scheduling for lowest register pressure.
};
- explicit TargetLowering(TargetMachine &TM);
+ /// NOTE: The constructor takes ownership of TLOF.
+ explicit TargetLowering(TargetMachine &TM, TargetLoweringObjectFile *TLOF);
virtual ~TargetLowering();
TargetMachine &getTargetMachine() const { return TM; }
const TargetData *getTargetData() const { return TD; }
+ const TargetLoweringObjectFile &getObjFileLowering() const { return TLOF; }
bool isBigEndian() const { return !IsLittleEndian; }
bool isLittleEndian() const { return IsLittleEndian; }
@@ -1475,6 +1480,7 @@
private:
TargetMachine &TM;
const TargetData *TD;
+ TargetLoweringObjectFile &TLOF;
/// PointerTy - The type to use for pointers, usually i32 or i64.
///
Added: llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h?rev=77294&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h (added)
+++ llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h Mon Jul 27 22:13:23 2009
@@ -0,0 +1,187 @@
+//===-- llvm/Target/TargetLoweringObjectFile.h - Object Info ----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements classes used to handle lowerings specific to common
+// object file formats.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H
+#define LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H
+
+// FIXME: Switch to MC.
+#include "llvm/Target/TargetAsmInfo.h"
+
+namespace llvm {
+
+class TargetLoweringObjectFile {
+private:
+ mutable StringMap Sections;
+protected:
+
+ TargetLoweringObjectFile();
+
+ /// TextSection - Section directive for standard text.
+ ///
+ const Section *TextSection; // Defaults to ".text".
+
+ /// DataSection - Section directive for standard data.
+ ///
+ const Section *DataSection; // Defaults to ".data".
+
+
+
+ // FIXME: SINK THESE.
+ const Section *BSSSection_;
+
+ /// ReadOnlySection - This is the directive that is emitted to switch to a
+ /// read-only section for constant data (e.g. data declared const,
+ /// jump tables).
+ const Section *ReadOnlySection; // Defaults to NULL
+
+ /// TLSDataSection - Section directive for Thread Local data.
+ ///
+ const Section *TLSDataSection; // Defaults to ".tdata".
+
+ /// TLSBSSSection - Section directive for Thread Local uninitialized data.
+ /// Null if this target doesn't support a BSS section.
+ ///
+ const Section *TLSBSSSection; // Defaults to ".tbss".
+
+ const Section *CStringSection_;
+
+public:
+ // FIXME: NONPUB.
+ const Section *getOrCreateSection(const char *Name,
+ bool isDirective,
+ SectionKind::Kind K) const;
+public:
+
+ virtual ~TargetLoweringObjectFile();
+
+ const Section *getTextSection() const { return TextSection; }
+ const Section *getDataSection() const { return DataSection; }
+
+
+ /// getSectionForMergeableConstant - Given a mergeable constant with the
+ /// specified size and relocation information, return a section that it
+ /// should be placed in.
+ virtual const Section *
+ getSectionForMergeableConstant(SectionKind Kind) const;
+
+ /// getKindForNamedSection - If this target wants to be able to override
+ /// section flags based on the name of the section specified for a global
+ /// variable, it can implement this. This is used on ELF systems so that
+ /// ".tbss" gets the TLS bit set etc.
+ virtual SectionKind::Kind getKindForNamedSection(const char *Section,
+ SectionKind::Kind K) const{
+ return K;
+ }
+
+ /// SectionForGlobal - This method computes the appropriate section to emit
+ /// the specified global variable or function definition. This should not
+ /// be passed external (or available externally) globals.
+ const Section *SectionForGlobal(const GlobalValue *GV,
+ const TargetMachine &TM) const;
+
+ /// getSpecialCasedSectionGlobals - Allow the target to completely override
+ /// section assignment of a global.
+ /// FIXME: ELIMINATE this by making PIC16 implement ADDRESS with
+ /// getFlagsForNamedSection.
+ virtual const Section *
+ getSpecialCasedSectionGlobals(const GlobalValue *GV,
+ SectionKind Kind) const {
+ return 0;
+ }
+
+ /// getSectionFlagsAsString - Turn the flags in the specified SectionKind
+ /// into a string that can be printed to the assembly file after the
+ /// ".section foo" part of a section directive.
+ virtual void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const {
+ }
+
+protected:
+ virtual const Section *SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind Kind,
+ const TargetMachine &TM) const;
+};
+
+
+
+
+class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
+ bool AtIsCommentChar; // True if @ is the comment character on this target.
+public:
+ /// ELF Constructor - AtIsCommentChar is true if the CommentCharacter from TAI
+ /// is "@".
+ TargetLoweringObjectFileELF(bool AtIsCommentChar = false,
+ // FIXME: REMOVE AFTER UNIQUING IS FIXED.
+ bool HasCrazyBSS = false);
+
+ /// getSectionForMergeableConstant - Given a mergeable constant with the
+ /// specified size and relocation information, return a section that it
+ /// should be placed in.
+ virtual const Section *
+ getSectionForMergeableConstant(SectionKind Kind) const;
+
+ virtual SectionKind::Kind getKindForNamedSection(const char *Section,
+ SectionKind::Kind K) const;
+ void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const;
+
+ virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind Kind,
+ const TargetMachine &TM) const;
+protected:
+ const Section *DataRelSection;
+ const Section *DataRelLocalSection;
+ const Section *DataRelROSection;
+ const Section *DataRelROLocalSection;
+
+ const Section *MergeableConst4Section;
+ const Section *MergeableConst8Section;
+ const Section *MergeableConst16Section;
+};
+
+class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
+ const Section *TextCoalSection;
+ const Section *ConstTextCoalSection;
+ const Section *ConstDataCoalSection;
+ const Section *ConstDataSection;
+ const Section *DataCoalSection;
+ const Section *FourByteConstantSection;
+ const Section *EightByteConstantSection;
+ const Section *SixteenByteConstantSection;
+public:
+ TargetLoweringObjectFileMachO();
+ virtual const Section *SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind Kind,
+ const TargetMachine &TM) const;
+
+ virtual const Section *
+ getSectionForMergeableConstant(SectionKind Kind) const;
+};
+
+
+
+class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
+public:
+ TargetLoweringObjectFileCOFF();
+ virtual void getSectionFlagsAsString(SectionKind Kind,
+ SmallVectorImpl &Str) const;
+
+ virtual const Section *
+ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
+ const TargetMachine &TM) const;
+};
+
+} // end namespace llvm
+
+#endif
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Jul 27 22:13:23 2009
@@ -32,6 +32,7 @@
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/ADT/SmallPtrSet.h"
@@ -72,6 +73,11 @@
delete &OutContext;
}
+const TargetLoweringObjectFile &AsmPrinter::getObjFileLowering() const {
+ return TM.getTargetLowering()->getObjFileLowering();
+}
+
+
/// SwitchToTextSection - Switch to the specified text section of the executable
/// if we are not already in it!
///
@@ -146,7 +152,8 @@
// some magic assembler directive.
if (NS->getKind().hasExplicitSection()) {
SmallString<32> FlagsStr;
- TAI->getSectionFlagsAsString(NS->getKind(), FlagsStr);
+
+ getObjFileLowering().getSectionFlagsAsString(NS->getKind(), FlagsStr);
O << TAI->getSwitchToSectionDirective()
<< CurrentSection
@@ -240,9 +247,6 @@
}
if (TAI->getSetDirective()) {
- if (!M.alias_empty())
- SwitchToSection(TAI->getTextSection());
-
O << '\n';
for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
I != E; ++I) {
@@ -339,7 +343,7 @@
}
}
- const Section *S = TAI->getSectionForMergeableConstant(Kind);
+ const Section *S =getObjFileLowering().getSectionForMergeableConstant(Kind);
// The number of sections are small, just do a linear search from the
// last section to the first.
@@ -410,8 +414,9 @@
const char* JumpTableDataSection = TAI->getJumpTableDataSection();
const Function *F = MF.getFunction();
- const Section *FuncSection = TAI->SectionForGlobal(F);
+ const Section *FuncSection = getObjFileLowering().SectionForGlobal(F, TM);
+
bool JTInDiffSection = false;
if ((IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) ||
!JumpTableDataSection ||
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jul 27 22:13:23 2009
@@ -17,9 +17,10 @@
#include "llvm/Support/Timer.h"
#include "llvm/System/Path.h"
#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
+#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
static TimerGroup &getDwarfTimerGroup() {
@@ -1328,7 +1329,7 @@
MMI->setDebugInfoAvailability(true);
// Prime section data.
- SectionMap.insert(TAI->getTextSection());
+ SectionMap.insert(Asm->getObjFileLowering().getTextSection());
// Print out .file directives to specify files for .loc directives. These are
// printed out early so that they precede any .loc directives.
@@ -1363,9 +1364,9 @@
DebugTimer->startTimer();
// Standard sections final addresses.
- Asm->SwitchToSection(TAI->getTextSection());
+ Asm->SwitchToSection(Asm->getObjFileLowering().getTextSection());
EmitLabel("text_end", 0);
- Asm->SwitchToSection(TAI->getDataSection());
+ Asm->SwitchToSection(Asm->getObjFileLowering().getDataSection());
EmitLabel("data_end", 0);
// End text sections.
@@ -1893,9 +1894,9 @@
Asm->SwitchToDataSection(TAI->getDwarfRangesSection());
EmitLabel("section_ranges", 0);
- Asm->SwitchToSection(TAI->getTextSection());
+ Asm->SwitchToSection(Asm->getObjFileLowering().getTextSection());
EmitLabel("text_begin", 0);
- Asm->SwitchToSection(TAI->getDataSection());
+ Asm->SwitchToSection(Asm->getObjFileLowering().getDataSection());
EmitLabel("data_begin", 0);
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp Mon Jul 27 22:13:23 2009
@@ -20,8 +20,8 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
-
using namespace llvm;
namespace {
@@ -64,10 +64,10 @@
void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI) {
- AP.SwitchToSection(TAI.getTextSection());
+ AP.SwitchToSection(AP.getObjFileLowering().getTextSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin");
- AP.SwitchToSection(TAI.getDataSection());
+ AP.SwitchToSection(AP.getObjFileLowering().getDataSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "data_begin");
}
@@ -99,16 +99,16 @@
AddressAlignLog = 3;
}
- AP.SwitchToSection(TAI.getTextSection());
+ AP.SwitchToSection(AP.getObjFileLowering().getTextSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "code_end");
- AP.SwitchToSection(TAI.getDataSection());
+ AP.SwitchToSection(AP.getObjFileLowering().getDataSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "data_end");
OS << AddressDirective << 0; // FIXME: Why does ocaml emit this??
AP.EOL();
- AP.SwitchToSection(TAI.getDataSection());
+ AP.SwitchToSection(AP.getObjFileLowering().getDataSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "frametable");
for (iterator I = begin(), IE = end(); I != IE; ++I) {
Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Mon Jul 27 22:13:23 2009
@@ -45,6 +45,8 @@
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetELFWriterInfo.h"
+#include "llvm/Target/TargetLowering.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/Streams.h"
@@ -185,7 +187,10 @@
}
}
- return getSection(TAI->getSectionForMergeableConstant(Kind)->getName(),
+ const TargetLoweringObjectFile &TLOF =
+ TM.getTargetLowering()->getObjFileLowering();
+
+ return getSection(TLOF.getSectionForMergeableConstant(Kind)->getName(),
ELFSection::SHT_PROGBITS,
ELFSection::SHF_MERGE | ELFSection::SHF_ALLOC,
CPE.getAlignment());
@@ -312,8 +317,11 @@
assert(isa(GV) && "GV not a global variable!");
const GlobalVariable *GVar = dyn_cast(GV);
+ const TargetLoweringObjectFile &TLOF =
+ TM.getTargetLowering()->getObjFileLowering();
+
// Get ELF section from TAI
- const Section *S = TAI->SectionForGlobal(GV);
+ const Section *S = TLOF.SectionForGlobal(GV, TM);
unsigned SectionFlags = getElfSectionFlags(S->getKind());
// The symbol align should update the section alignment if needed
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Jul 27 22:13:23 2009
@@ -11,12 +11,13 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetLowering.h"
-#include "llvm/Target/TargetSubtarget.h"
+#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Target/TargetSubtarget.h"
#include "llvm/GlobalVariable.h"
#include "llvm/DerivedTypes.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
@@ -440,8 +441,9 @@
CCs[RTLIB::O_F64] = ISD::SETEQ;
}
-TargetLowering::TargetLowering(TargetMachine &tm)
- : TM(tm), TD(TM.getTargetData()) {
+/// NOTE: The constructor takes ownership of TLOF.
+TargetLowering::TargetLowering(TargetMachine &tm,TargetLoweringObjectFile *tlof)
+ : TM(tm), TD(TM.getTargetData()), TLOF(*tlof) {
// All operations default to being supported.
memset(OpActions, 0, sizeof(OpActions));
memset(LoadExtActions, 0, sizeof(LoadExtActions));
@@ -522,7 +524,9 @@
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
}
-TargetLowering::~TargetLowering() {}
+TargetLowering::~TargetLowering() {
+ delete &TLOF;
+}
/// computeRegisterProperties - Once all of the register classes are added,
/// this allows us to compute derived properties we expose.
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Jul 27 22:13:23 2009
@@ -34,6 +34,7 @@
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/ADT/VectorExtras.h"
#include "llvm/Support/ErrorHandling.h"
@@ -103,8 +104,14 @@
addTypeForNEON(VT, MVT::v2f64, MVT::v4i32);
}
+static TargetLoweringObjectFile *createTLOF(TargetMachine &TM) {
+ if (TM.getSubtarget().isTargetDarwin())
+ return new TargetLoweringObjectFileMachO();
+ return new TargetLoweringObjectFileELF(true);
+}
+
ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
- : TargetLowering(TM), ARMPCLabelIndex(0) {
+ : TargetLowering(TM, createTLOF(TM)), ARMPCLabelIndex(0) {
Subtarget = &TM.getSubtarget();
if (Subtarget->isTargetDarwin()) {
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Mon Jul 27 22:13:23 2009
@@ -59,8 +59,6 @@
ARMTargetAsmInfo(TM) {
Subtarget = &TM.getSubtarget();
- BSSSection_ = getOrCreateSection("\t.bss", true, SectionKind::BSS);
-
NeedsSet = false;
HasLEB128 = true;
AbsoluteDebugSectionOffsets = true;
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Jul 27 22:13:23 2009
@@ -29,6 +29,7 @@
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h"
@@ -1127,7 +1128,7 @@
if (Subtarget->isTargetELF())
O << "\t.type " << name << ",%object\n";
- const Section *TheSection = TAI->SectionForGlobal(GVar);
+ const Section *TheSection = getObjFileLowering().SectionForGlobal(GVar, TM);
SwitchToSection(TheSection);
// FIXME: get this stuff from section kind flags.
@@ -1154,7 +1155,7 @@
O << TAI->getCOMMDirective() << name << "," << Size
<< ',' << Align;
} else {
- SwitchToSection(TAI->SectionForGlobal(GVar));
+ SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, TM));
O << "\t.globl " << name << '\n'
<< TAI->getWeakDefDirective() << name << '\n';
EmitAlignment(Align, GVar);
@@ -1285,7 +1286,7 @@
}
if (!HiddenGVNonLazyPtrs.empty()) {
- SwitchToSection(TAI->getDataSection());
+ SwitchToSection(getObjFileLowering().getDataSection());
for (StringMap::iterator I = HiddenGVNonLazyPtrs.begin(),
E = HiddenGVNonLazyPtrs.end(); I != E; ++I) {
EmitAlignment(2);
Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Mon Jul 27 22:13:23 2009
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Constants.h"
#include "llvm/Function.h"
#include "llvm/Module.h"
@@ -30,6 +31,17 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+
+class TargetLoweringObjectFileAlpha : public TargetLoweringObjectFile {
+public:
+ TargetLoweringObjectFileAlpha() {
+ TextSection = getOrCreateSection("_text", true, SectionKind::Text);
+ DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
+ }
+};
+
+
+
/// AddLiveIn - This helper function adds the specified physical register to the
/// MachineFunction as a live in value. It also creates a corresponding virtual
/// register for it.
@@ -41,7 +53,8 @@
return VReg;
}
-AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM) {
+AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM)
+ : TargetLowering(TM, new TargetLoweringObjectFileAlpha()) {
// Set up the TargetLowering object.
//I am having problems with shr n i8 1
setShiftAmountType(MVT::i64);
Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp Mon Jul 27 22:13:23 2009
@@ -23,7 +23,4 @@
JumpTableDirective = ".gprel32";
JumpTableDataSection = "\t.section .rodata\n";
WeakRefDirective = "\t.weak\t";
-
- TextSection = getOrCreateSection("_text", true, SectionKind::Text);
- DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
}
Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Mon Jul 27 22:13:23 2009
@@ -23,6 +23,7 @@
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/Compiler.h"
@@ -138,7 +139,7 @@
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToSection(TAI->SectionForGlobal(F));
+ SwitchToSection(getObjFileLowering().SectionForGlobal(F, TM));
EmitAlignment(MF.getAlignment(), F);
switch (F->getLinkage()) {
@@ -214,7 +215,7 @@
unsigned Align = TD->getPreferredAlignmentLog(GVar);
// 0: Switch to section
- SwitchToSection(TAI->SectionForGlobal(GVar));
+ SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, TM));
// 1: Check visibility
printVisibility(name, GVar->getVisibility());
Modified: llvm/trunk/lib/Target/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CMakeLists.txt?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/CMakeLists.txt Mon Jul 27 22:13:23 2009
@@ -10,6 +10,7 @@
TargetFrameInfo.cpp
TargetInstrInfo.cpp
TargetIntrinsicInfo.cpp
+ TargetLoweringObjectFile.cpp
TargetMachOWriterInfo.cpp
TargetMachine.cpp
TargetRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/COFFTargetAsmInfo.cpp Mon Jul 27 22:13:23 2009
@@ -19,9 +19,6 @@
COFFTargetAsmInfo::COFFTargetAsmInfo(const TargetMachine &TM)
: TargetAsmInfo(TM) {
- TextSection = getOrCreateSection("_text", true, SectionKind::Text);
- DataSection = getOrCreateSection("_data", true, SectionKind::DataRel);
-
GlobalPrefix = "_";
LCOMMDirective = "\t.lcomm\t";
COMMDirectiveTakesAlignment = false;
@@ -53,57 +50,3 @@
DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
}
-void COFFTargetAsmInfo::getSectionFlagsAsString(SectionKind Kind,
- SmallVectorImpl &Str) const {
- // FIXME: Inefficient.
- std::string Res = ",\"";
- if (Kind.isText())
- Res += 'x';
- if (Kind.isWriteable())
- Res += 'w';
- Res += "\"";
-
- Str.append(Res.begin(), Res.end());
-}
-
-//===----------------------------------------------------------------------===//
-// Move to AsmPrinter (mangler access).
-//===----------------------------------------------------------------------===//
-
-#include "llvm/GlobalVariable.h"
-
-static const char *getSectionPrefixForUniqueGlobal(SectionKind Kind) {
- if (Kind.isText())
- return ".text$linkonce";
- if (Kind.isWriteable())
- return ".data$linkonce";
- return ".rdata$linkonce";
-}
-
-const Section *
-COFFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind) const {
- assert(!Kind.isThreadLocal() && "Doesn't support TLS");
-
- // If this global is linkonce/weak and the target handles this by emitting it
- // into a 'uniqued' section name, create and return the section now.
- if (Kind.isWeak()) {
- const char *Prefix = getSectionPrefixForUniqueGlobal(Kind);
- // FIXME: Use mangler interface (PR4584).
- std::string Name = Prefix+GV->getNameStr();
- return getOrCreateSection(Name.c_str(), false, Kind.getKind());
- }
-
- if (Kind.isText())
- return getTextSection();
-
- if (Kind.isBSS())
- if (const Section *S = getBSSSection_())
- return S;
-
- if (Kind.isReadOnly())
- if (const Section *S = getReadOnlySection())
- return S;
-
- return getDataSection();
-}
Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Mon Jul 27 22:13:23 2009
@@ -34,9 +34,10 @@
#include "llvm/Support/Compiler.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetOptions.h"
+#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
@@ -427,7 +428,7 @@
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToSection(TAI->SectionForGlobal(F));
+ SwitchToSection(getObjFileLowering().SectionForGlobal(F, TM));
EmitAlignment(MF.getAlignment(), F);
switch (F->getLinkage()) {
@@ -525,7 +526,7 @@
unsigned Size = TD->getTypeAllocSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
- SwitchToSection(TAI->SectionForGlobal(GVar));
+ SwitchToSection(getObjFileLowering().SectionForGlobal(GVar, TM));
if (C->isNullValue() && /* FIXME: Verify correct */
!GVar->hasSection() &&
Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=77294&r1=77293&r2=77294&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jul 27 22:13:23 2009
@@ -15,8 +15,9 @@
#include "SPUISelLowering.h"
#include "SPUTargetMachine.h"
#include "SPUFrameInfo.h"
-#include "llvm/ADT/APInt.h"
-#include "llvm/ADT/VectorExtras.h"
+#include "llvm/Constants.h"
+#include "llvm/Function.h"
+#include "llvm/Intrinsics.h"
#include "llvm/CallingConv.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
@@ -24,15 +25,13 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Intrinsics.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
+#include "llvm/Target/TargetOptions.h"
+#include "llvm/ADT/VectorExtras.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Target/TargetOptions.h"
-
#include