From sabre at nondot.org Mon Apr 13 00:38:24 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 13 Apr 2009 05:38:24 -0000
Subject: [llvm-commits] [llvm] r68939 -
/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
Message-ID: <200904130538.n3D5cOG4032734@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Apr 13 00:38:23 2009
New Revision: 68939
URL: http://llvm.org/viewvc/llvm-project?rev=68939&view=rev
Log:
eliminate unneeded parens.
Modified:
llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=68939&r1=68938&r2=68939&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Mon Apr 13 00:38:23 2009
@@ -63,7 +63,7 @@
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
Changed |= RemoveUnusedGlobalValue(*I);
// Functions with external linkage are needed if they have a body
- if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) &&
+ if (!I->hasLocalLinkage() && !I->hasLinkOnceLinkage() &&
!I->isDeclaration())
GlobalIsNeeded(I);
}
@@ -73,7 +73,7 @@
Changed |= RemoveUnusedGlobalValue(*I);
// Externally visible & appending globals are needed, if they have an
// initializer.
- if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) &&
+ if (!I->hasLocalLinkage() && !I->hasLinkOnceLinkage() &&
!I->isDeclaration())
GlobalIsNeeded(I);
}
From sabre at nondot.org Mon Apr 13 00:44:35 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 13 Apr 2009 05:44:35 -0000
Subject: [llvm-commits] [llvm] r68940 - in /llvm/trunk: docs/ include/llvm/
include/llvm/CodeGen/ lib/AsmParser/ lib/Bitcode/Reader/
lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/Linker/
lib/Target/CppBackend/ lib/VMCore/ test/CodeGen/Generic/
test/Transforms/GlobalDCE/ test/Transforms/Inline/
test/Transforms/InstCombine/ tools/llvm-nm/
Message-ID: <200904130544.n3D5iate000497@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Apr 13 00:44:34 2009
New Revision: 68940
URL: http://llvm.org/viewvc/llvm-project?rev=68940&view=rev
Log:
Add a new "available_externally" linkage type. This is intended
to support C99 inline, GNU extern inline, etc. Related bugzilla's
include PR3517, PR3100, & PR2933. Nothing uses this yet, but it
appears to work.
Added:
llvm/trunk/test/CodeGen/Generic/externally_available.ll
llvm/trunk/test/Transforms/GlobalDCE/externally_available.ll
llvm/trunk/test/Transforms/Inline/externally_available.ll
llvm/trunk/test/Transforms/InstCombine/odr-linkage.ll
Modified:
llvm/trunk/docs/LangRef.html
llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h
llvm/trunk/include/llvm/GlobalValue.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/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
llvm/trunk/lib/CodeGen/MachineFunction.cpp
llvm/trunk/lib/Linker/LinkModules.cpp
llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Mon Apr 13 00:44:34 2009
@@ -509,6 +509,17 @@
'static' keyword in C.
+
available_externally:
+
+
+ Globals with "available_externally" linkage are never emitted
+ into the object file corresponding to the LLVM module. They exist to
+ allow inlining and other optimizations to take place given knowledge of the
+ definition of the global, which is known to be somewhere outside the module.
+ Globals with available_externally linkage are allowed to be discarded
+ at will, and are otherwise the same as linkonce_odr. This linkage
+ type is only allowed on definitions, not declarations.
+
linkonce:
Globals with "linkonce" linkage are merged with other globals of
@@ -554,10 +565,10 @@
linkonce_odr:
weak_odr:
- Some languages allow inequivalent globals to be merged, such as two
+ Some languages allow differing globals to be merged, such as two
functions with different semantics. Other languages, such as C++,
ensure that only equivalent globals are ever merged (the "one definition
- rule" - odr). Such languages can use the linkonce_odr
+ rule" - "ODR"). Such languages can use the linkonce_odr
and weak_odr linkage types to indicate that the global will only
be merged with equivalent globals. These linkage types are otherwise the
same as their non-odr versions.
Modified: llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h Mon Apr 13 00:44:34 2009
@@ -24,8 +24,9 @@
namespace llvm {
+ // FIXME: This pass should declare that the pass does not invalidate any LLVM
+ // passes.
struct MachineFunctionPass : public FunctionPass {
-
explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {}
@@ -36,14 +37,7 @@
virtual bool runOnMachineFunction(MachineFunction &MF) = 0;
public:
- // FIXME: This pass should declare that the pass does not invalidate any LLVM
- // passes.
- bool runOnFunction(Function &F) {
- return runOnMachineFunction(MachineFunction::get(&F));
- }
-
-private:
- virtual void virtfn(); // out of line virtual fn to give class a home.
+ bool runOnFunction(Function &F);
};
} // End llvm namespace
Modified: llvm/trunk/include/llvm/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/include/llvm/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/GlobalValue.h Mon Apr 13 00:44:34 2009
@@ -31,6 +31,7 @@
/// @brief An enumeration for the kinds of linkage for global values.
enum LinkageTypes {
ExternalLinkage = 0,///< Externally visible function
+ AvailableExternallyLinkage, ///< Available for inspection, not emission.
LinkOnceAnyLinkage, ///< Keep one copy of function when linking (inline)
LinkOnceODRLinkage, ///< Same, but only replaced by something equivalent.
WeakAnyLinkage, ///< Keep one copy of named function when linking (weak)
@@ -109,6 +110,9 @@
}
bool hasExternalLinkage() const { return Linkage == ExternalLinkage; }
+ bool hasAvailableExternallyLinkage() const {
+ return Linkage == AvailableExternallyLinkage;
+ }
bool hasLinkOnceLinkage() const {
return Linkage == LinkOnceAnyLinkage || Linkage == LinkOnceODRLinkage;
}
@@ -119,7 +123,8 @@
bool hasInternalLinkage() const { return Linkage == InternalLinkage; }
bool hasPrivateLinkage() const { return Linkage == PrivateLinkage; }
bool hasLocalLinkage() const {
- return Linkage == InternalLinkage || Linkage == PrivateLinkage;
+ return Linkage == InternalLinkage || Linkage == PrivateLinkage ||
+ Linkage == AvailableExternallyLinkage;
}
bool hasDLLImportLinkage() const { return Linkage == DLLImportLinkage; }
bool hasDLLExportLinkage() const { return Linkage == DLLExportLinkage; }
@@ -141,9 +146,10 @@
}
/// isWeakForLinker - Whether the definition of this global may be replaced at
- /// link time, whether the replacement is equivalent to the original or not.
+ /// link time.
bool isWeakForLinker() const {
- return (Linkage == WeakAnyLinkage ||
+ return (Linkage == AvailableExternallyLinkage ||
+ Linkage == WeakAnyLinkage ||
Linkage == WeakODRLinkage ||
Linkage == LinkOnceAnyLinkage ||
Linkage == LinkOnceODRLinkage ||
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Mon Apr 13 00:44:34 2009
@@ -487,6 +487,7 @@
KEYWORD(private);
KEYWORD(internal);
+ KEYWORD(available_externally);
KEYWORD(linkonce);
KEYWORD(linkonce_odr);
KEYWORD(weak);
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Apr 13 00:44:34 2009
@@ -764,6 +764,9 @@
case lltok::kw_weak_odr: Res = GlobalValue::WeakODRLinkage; break;
case lltok::kw_linkonce: Res = GlobalValue::LinkOnceAnyLinkage; break;
case lltok::kw_linkonce_odr: Res = GlobalValue::LinkOnceODRLinkage; break;
+ case lltok::kw_available_externally:
+ Res = GlobalValue::AvailableExternallyLinkage;
+ break;
case lltok::kw_appending: Res = GlobalValue::AppendingLinkage; break;
case lltok::kw_dllexport: Res = GlobalValue::DLLExportLinkage; break;
case lltok::kw_common: Res = GlobalValue::CommonLinkage; break;
Modified: llvm/trunk/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLToken.h (original)
+++ llvm/trunk/lib/AsmParser/LLToken.h Mon Apr 13 00:44:34 2009
@@ -37,7 +37,7 @@
kw_global, kw_constant,
kw_private, kw_internal, kw_linkonce, kw_linkonce_odr, kw_weak, kw_weak_odr,
- kw_appending, kw_dllimport, kw_dllexport, kw_common,
+ kw_appending, kw_dllimport, kw_dllexport, kw_common,kw_available_externally,
kw_default, kw_hidden, kw_protected,
kw_extern_weak,
kw_external, kw_thread_local,
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Apr 13 00:44:34 2009
@@ -70,6 +70,7 @@
case 9: return GlobalValue::PrivateLinkage;
case 10: return GlobalValue::WeakODRLinkage;
case 11: return GlobalValue::LinkOnceODRLinkage;
+ case 12: return GlobalValue::AvailableExternallyLinkage;
}
}
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Apr 13 00:44:34 2009
@@ -287,6 +287,7 @@
case GlobalValue::PrivateLinkage: return 9;
case GlobalValue::WeakODRLinkage: return 10;
case GlobalValue::LinkOnceODRLinkage: return 11;
+ case GlobalValue::AvailableExternallyLinkage: return 12;
}
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Apr 13 00:44:34 2009
@@ -443,7 +443,9 @@
}
// Ignore debug and non-emitted data.
- if (GV->getSection() == "llvm.metadata") return true;
+ if (GV->getSection() == "llvm.metadata" ||
+ GV->hasAvailableExternallyLinkage())
+ return true;
if (!GV->hasAppendingLinkage()) return false;
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Apr 13 00:44:34 2009
@@ -3519,6 +3519,9 @@
///
void EmitEHFrame(const FunctionEHFrameInfo &EHFrameInfo) {
Function::LinkageTypes linkage = EHFrameInfo.function->getLinkage();
+
+ assert(!EHFrameInfo.function->hasAvailableExternallyLinkage() &&
+ "Should not emit 'available externally' functions at all");
Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Mon Apr 13 00:44:34 2009
@@ -38,8 +38,14 @@
static AnnotationID MF_AID(
AnnotationManager::getID("CodeGen::MachineCodeForFunction"));
-// Out of line virtual function to home classes.
-void MachineFunctionPass::virtfn() {}
+bool MachineFunctionPass::runOnFunction(Function &F) {
+ // Do not codegen any 'available_externally' functions at all, they have
+ // definitions outside the translation unit.
+ if (F.hasAvailableExternallyLinkage())
+ return false;
+
+ return runOnMachineFunction(MachineFunction::get(&F));
+}
namespace {
struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Apr 13 00:44:34 2009
@@ -480,9 +480,10 @@
} else if (Src->isWeakForLinker()) {
// At this point we know that Dest has LinkOnce, External*, Weak, Common,
// or DLL* linkage.
- if ((Dest->hasLinkOnceLinkage() &&
- (Src->hasWeakLinkage() || Src->hasCommonLinkage())) ||
- Dest->hasExternalWeakLinkage()) {
+ if (Dest->hasExternalWeakLinkage() ||
+ Dest->hasAvailableExternallyLinkage() ||
+ (Dest->hasLinkOnceLinkage() &&
+ (Src->hasWeakLinkage() || Src->hasCommonLinkage()))) {
LinkFromSrc = true;
LT = Src->getLinkage();
} else {
Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon Apr 13 00:44:34 2009
@@ -294,6 +294,8 @@
Out << "GlobalValue::InternalLinkage"; break;
case GlobalValue::PrivateLinkage:
Out << "GlobalValue::PrivateLinkage"; break;
+ case GlobalValue::AvailableExternallyLinkage:
+ Out << "GlobalValue::AvailableExternallyLinkage "; break;
case GlobalValue::LinkOnceAnyLinkage:
Out << "GlobalValue::LinkOnceAnyLinkage "; break;
case GlobalValue::LinkOnceODRLinkage:
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Apr 13 00:44:34 2009
@@ -1225,6 +1225,9 @@
switch (LT) {
case GlobalValue::PrivateLinkage: Out << "private "; break;
case GlobalValue::InternalLinkage: Out << "internal "; break;
+ case GlobalValue::AvailableExternallyLinkage:
+ Out << "available_externally ";
+ break;
case GlobalValue::LinkOnceAnyLinkage: Out << "linkonce "; break;
case GlobalValue::LinkOnceODRLinkage: Out << "linkonce_odr "; break;
case GlobalValue::WeakAnyLinkage: Out << "weak "; break;
Added: llvm/trunk/test/CodeGen/Generic/externally_available.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/externally_available.ll?rev=68940&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/externally_available.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/externally_available.ll Mon Apr 13 00:44:34 2009
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc | not grep test_
+
+; test_function should not be emitted to the .s file.
+define available_externally i32 @test_function() {
+ ret i32 4
+}
+
+; test_global should not be emitted to the .s file.
+ at test_global = available_externally global i32 4
+
Added: llvm/trunk/test/Transforms/GlobalDCE/externally_available.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalDCE/externally_available.ll?rev=68940&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GlobalDCE/externally_available.ll (added)
+++ llvm/trunk/test/Transforms/GlobalDCE/externally_available.ll Mon Apr 13 00:44:34 2009
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep test_
+
+; test_function should not be emitted to the .s file.
+define available_externally i32 @test_function() {
+ ret i32 4
+}
+
+; test_global should not be emitted to the .s file.
+ at test_global = available_externally global i32 4
+
Added: llvm/trunk/test/Transforms/Inline/externally_available.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/externally_available.ll?rev=68940&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/Inline/externally_available.ll (added)
+++ llvm/trunk/test/Transforms/Inline/externally_available.ll Mon Apr 13 00:44:34 2009
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -inline -constprop | llvm-dis > %t
+; RUN: not grep test_function %t
+; RUN: grep {ret i32 5} %t
+
+
+; test_function should not be emitted to the .s file.
+define available_externally i32 @test_function() {
+ ret i32 4
+}
+
+
+define i32 @result() {
+ %A = call i32 @test_function()
+ %B = add i32 %A, 1
+ ret i32 %B
+}
\ No newline at end of file
Added: llvm/trunk/test/Transforms/InstCombine/odr-linkage.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/odr-linkage.ll?rev=68940&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/odr-linkage.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/odr-linkage.ll Mon Apr 13 00:44:34 2009
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 10}
+
+ at g1 = available_externally constant i32 1
+ at g2 = linkonce_odr constant i32 2
+ at g3 = weak_odr constant i32 3
+ at g4 = internal constant i32 4
+
+define i32 @test() {
+ %A = load i32* @g1
+ %B = load i32* @g2
+ %C = load i32* @g3
+ %D = load i32* @g4
+
+ %a = add i32 %A, %B
+ %b = add i32 %a, %C
+ %c = add i32 %b, %D
+ ret i32 %c
+}
+
\ No newline at end of file
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=68940&r1=68939&r2=68940&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Mon Apr 13 00:44:34 2009
@@ -69,7 +69,6 @@
}
static char TypeCharForSymbol(GlobalValue &GV) {
- /* FIXME: what to do with private linkage? */
if (GV.isDeclaration()) return 'U';
if (GV.hasLinkOnceLinkage()) return 'C';
if (GV.hasCommonLinkage()) return 'C';
@@ -87,8 +86,11 @@
}
static void DumpSymbolNameForGlobalValue(GlobalValue &GV) {
+ // Private linkage and available_externally linkage don't exist in symtab.
+ if (GV.hasPrivateLinkage() || GV.hasAvailableExternallyLinkage()) return;
+
const std::string SymbolAddrStr = " "; // Not used yet...
- char TypeChar = TypeCharForSymbol (GV);
+ char TypeChar = TypeCharForSymbol(GV);
if ((TypeChar != 'U') && UndefinedOnly)
return;
if ((TypeChar == 'U') && DefinedOnly)
@@ -96,17 +98,17 @@
if (GV.hasLocalLinkage () && ExternalOnly)
return;
if (OutputFormat == posix) {
- std::cout << GV.getName () << " " << TypeCharForSymbol (GV) << " "
+ std::cout << GV.getName () << " " << TypeCharForSymbol(GV) << " "
<< SymbolAddrStr << "\n";
} else if (OutputFormat == bsd) {
- std::cout << SymbolAddrStr << " " << TypeCharForSymbol (GV) << " "
+ std::cout << SymbolAddrStr << " " << TypeCharForSymbol(GV) << " "
<< GV.getName () << "\n";
} else if (OutputFormat == sysv) {
std::string PaddedName (GV.getName ());
while (PaddedName.length () < 20)
PaddedName += " ";
std::cout << PaddedName << "|" << SymbolAddrStr << "| "
- << TypeCharForSymbol (GV)
+ << TypeCharForSymbol(GV)
<< " | | | |\n";
}
}
@@ -122,10 +124,10 @@
<< "Name Value Class Type"
<< " Size Line Section\n";
}
- std::for_each (M->begin (), M->end (), DumpSymbolNameForGlobalValue);
- std::for_each (M->global_begin (), M->global_end (),
+ std::for_each (M->begin(), M->end(), DumpSymbolNameForGlobalValue);
+ std::for_each (M->global_begin(), M->global_end(),
DumpSymbolNameForGlobalValue);
- std::for_each (M->alias_begin (), M->alias_end (),
+ std::for_each (M->alias_begin(), M->alias_end(),
DumpSymbolNameForGlobalValue);
}
From sabre at nondot.org Mon Apr 13 01:25:37 2009
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 13 Apr 2009 06:25:37 -0000
Subject: [llvm-commits] [llvm] r68942 - /llvm/trunk/include/llvm-c/Core.h
Message-ID: <200904130625.n3D6PbjK002201@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Apr 13 01:25:37 2009
New Revision: 68942
URL: http://llvm.org/viewvc/llvm-project?rev=68942&view=rev
Log:
add AvailableExternally linkage to C bindings.
Modified:
llvm/trunk/include/llvm-c/Core.h
Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=68942&r1=68941&r2=68942&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Mon Apr 13 01:25:37 2009
@@ -115,6 +115,7 @@
typedef enum {
LLVMExternalLinkage, /**< Externally visible function */
+ LLVMAvailableExternallyLinkage,
LLVMLinkOnceAnyLinkage, /**< Keep one copy of function when linking (inline)*/
LLVMLinkOnceODRLinkage, /**< Same, but only replaced by something
equivalent. */
From nicholas at mxc.ca Mon Apr 13 02:02:04 2009
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 13 Apr 2009 07:02:04 -0000
Subject: [llvm-commits] [llvm] r68944 -
/llvm/trunk/lib/AsmParser/LLParser.cpp
Message-ID: <200904130702.n3D724Ji003466@zion.cs.uiuc.edu>
Author: nicholas
Date: Mon Apr 13 02:02:02 2009
New Revision: 68944
URL: http://llvm.org/viewvc/llvm-project?rev=68944&view=rev
Log:
Fix warning in .ll parser, detect and reject available_externally on function
declarations.
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=68944&r1=68943&r2=68944&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Apr 13 02:02:02 2009
@@ -2131,6 +2131,7 @@
break;
case GlobalValue::PrivateLinkage:
case GlobalValue::InternalLinkage:
+ case GlobalValue::AvailableExternallyLinkage:
case GlobalValue::LinkOnceAnyLinkage:
case GlobalValue::LinkOnceODRLinkage:
case GlobalValue::WeakAnyLinkage:
From nicholas at mxc.ca Mon Apr 13 02:02:33 2009
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 13 Apr 2009 07:02:33 -0000
Subject: [llvm-commits] [llvm] r68945 - in /llvm/trunk/bindings/ocaml/llvm:
llvm.ml llvm.mli
Message-ID: <200904130702.n3D72Xfa003493@zion.cs.uiuc.edu>
Author: nicholas
Date: Mon Apr 13 02:02:32 2009
New Revision: 68945
URL: http://llvm.org/viewvc/llvm-project?rev=68945&view=rev
Log:
Fix ocaml bindings; add "available_externally" linkage type.
Modified:
llvm/trunk/bindings/ocaml/llvm/llvm.ml
llvm/trunk/bindings/ocaml/llvm/llvm.mli
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.ml?rev=68945&r1=68944&r2=68945&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml Mon Apr 13 02:02:32 2009
@@ -38,6 +38,7 @@
module Linkage = struct
type t =
| External
+ | Available_externally
| Link_once
| Weak
| Appending
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=68945&r1=68944&r2=68945&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Mon Apr 13 02:02:32 2009
@@ -75,6 +75,7 @@
module Linkage : sig
type t =
External
+ | Available_externally
| Link_once
| Weak
| Appending
From eli.friedman at gmail.com Mon Apr 13 02:38:23 2009
From: eli.friedman at gmail.com (Eli Friedman)
Date: Mon, 13 Apr 2009 00:38:23 -0700
Subject: [llvm-commits] [llvm] r68940 - in /llvm/trunk: docs/
include/llvm/ include/llvm/CodeGen/ lib/AsmParser/
lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/
lib/CodeGen/AsmPrinter/ lib/Linker/ lib/Target/CppBackend/
lib/VMCore/ test/CodeGen/Gener
Message-ID:
On Sun, Apr 12, 2009 at 10:44 PM, Chris Lattner wrote:
> Author: lattner
> Date: Mon Apr 13 00:44:34 2009
> New Revision: 68940
>
> URL: http://llvm.org/viewvc/llvm-project?rev=68940&view=rev
> Log:
> Add a new "available_externally" linkage type. ?This is intended
> to support C99 inline, GNU extern inline, etc. ?Related bugzilla's
> include PR3517, PR3100, & PR2933. ?Nothing uses this yet, but it
> appears to work.
Interesting. One serious issue from looking over it: the C99 rules
require that only calls from within the same translation unit are
allowed to use an inline definition.
-Eli
From sanjiv.gupta at microchip.com Mon Apr 13 04:38:41 2009
From: sanjiv.gupta at microchip.com (Sanjiv Gupta)
Date: Mon, 13 Apr 2009 09:38:41 -0000
Subject: [llvm-commits] [llvm] r68946 -
/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
Message-ID: <200904130938.n3D9cf5S020463@zion.cs.uiuc.edu>
Author: sgupta
Date: Mon Apr 13 04:38:38 2009
New Revision: 68946
URL: http://llvm.org/viewvc/llvm-project?rev=68946&view=rev
Log:
While passing arg of types larger than char only one byte at lower end was getting passed. We couldn't catch this as we did not have tests that were passing an int value larger than 256.
Modified:
llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=68946&r1=68945&r2=68946&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Mon Apr 13 04:38:38 2009
@@ -939,7 +939,7 @@
Ops.clear();
Ops.push_back(Chain);
- Ops.push_back(Arg.getValue(0));
+ Ops.push_back(Arg);
Ops.push_back(PtrLo);
Ops.push_back(PtrHi);
Ops.push_back(DAG.getConstant(StoreOffset, MVT::i8));
From rafael.espindola at gmail.com Mon Apr 13 08:02:51 2009
From: rafael.espindola at gmail.com (Rafael Espindola)
Date: Mon, 13 Apr 2009 13:02:51 -0000
Subject: [llvm-commits] [llvm] r68947 - in /llvm/trunk: lib/Target/X86/
lib/Target/X86/AsmPrinter/ test/CodeGen/X86/
Message-ID: <200904131302.n3DD2puA027276@zion.cs.uiuc.edu>
Author: rafael
Date: Mon Apr 13 08:02:49 2009
New Revision: 68947
URL: http://llvm.org/viewvc/llvm-project?rev=68947&view=rev
Log:
X86-64 TLS support for local exec and initial exec.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/tls1.ll
llvm/trunk/test/CodeGen/X86/tls10.ll
llvm/trunk/test/CodeGen/X86/tls11.ll
llvm/trunk/test/CodeGen/X86/tls12.ll
llvm/trunk/test/CodeGen/X86/tls13.ll
llvm/trunk/test/CodeGen/X86/tls14.ll
llvm/trunk/test/CodeGen/X86/tls15.ll
llvm/trunk/test/CodeGen/X86/tls2.ll
llvm/trunk/test/CodeGen/X86/tls3.ll
llvm/trunk/test/CodeGen/X86/tls4.ll
llvm/trunk/test/CodeGen/X86/tls5.ll
llvm/trunk/test/CodeGen/X86/tls6.ll
llvm/trunk/test/CodeGen/X86/tls7.ll
llvm/trunk/test/CodeGen/X86/tls8.ll
llvm/trunk/test/CodeGen/X86/tls9.ll
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Apr 13 08:02:49 2009
@@ -454,14 +454,16 @@
O << "@TLSGD";
break;
case TLSModel::InitialExec:
- if (Subtarget->is64Bit())
- O << "@TLSGD"; // 64 bit intial exec not implemented
- else
+ if (Subtarget->is64Bit()) {
+ assert (!NotRIPRel);
+ O << "@GOTTPOFF(%rip)";
+ } else {
O << "@INDNTPOFF";
+ }
break;
case TLSModel::LocalExec:
if (Subtarget->is64Bit())
- O << "@TLSGD"; // 64 bit local exec not implemented
+ O << "@TPOFF";
else
O << "@NTPOFF";
break;
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Apr 13 08:02:49 2009
@@ -808,9 +808,16 @@
uint64_t Offset = G->getOffset();
if (!is64Bit || isInt32(AM.Disp + Offset)) {
GlobalValue *GV = G->getGlobal();
+ bool isRIPRel = TM.symbolicAddressesAreRIPRel();
+ if (N0.getOpcode() == llvm::ISD::TargetGlobalTLSAddress) {
+ TLSModel::Model model =
+ getTLSModel (GV, TM.getRelocationModel());
+ if (is64Bit && model == TLSModel::InitialExec)
+ isRIPRel = true;
+ }
AM.GV = GV;
AM.Disp += Offset;
- AM.isRIPRel = TM.symbolicAddressesAreRIPRel();
+ AM.isRIPRel = isRIPRel;
return false;
}
} else if (ConstantPoolSDNode *CP = dyn_cast(N0)) {
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Apr 13 08:02:49 2009
@@ -4831,12 +4831,14 @@
// Lower ISD::GlobalTLSAddress using the "initial exec" (for no-pic) or
// "local exec" model.
static SDValue LowerToTLSExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG,
- const MVT PtrVT, TLSModel::Model model) {
+ const MVT PtrVT, TLSModel::Model model,
+ bool is64Bit) {
DebugLoc dl = GA->getDebugLoc();
// Get the Thread Pointer
SDValue Base = DAG.getNode(X86ISD::SegmentBaseAddress,
DebugLoc::getUnknownLoc(), PtrVT,
- DAG.getRegister(X86::GS, MVT::i32));
+ DAG.getRegister(is64Bit? X86::FS : X86::GS,
+ MVT::i32));
SDValue ThreadPointer = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Base,
NULL, 0);
@@ -4871,9 +4873,11 @@
switch (model) {
case TLSModel::GeneralDynamic:
case TLSModel::LocalDynamic: // not implemented
- case TLSModel::InitialExec: // not implemented
- case TLSModel::LocalExec: // not implemented
return LowerToTLSGeneralDynamicModel64(GA, DAG, getPointerTy());
+
+ case TLSModel::InitialExec:
+ case TLSModel::LocalExec:
+ return LowerToTLSExecModel(GA, DAG, getPointerTy(), model, true);
}
} else {
switch (model) {
@@ -4883,7 +4887,7 @@
case TLSModel::InitialExec:
case TLSModel::LocalExec:
- return LowerToTLSExecModel(GA, DAG, getPointerTy(), model);
+ return LowerToTLSExecModel(GA, DAG, getPointerTy(), model, false);
}
}
assert(0 && "Unreachable");
Modified: llvm/trunk/test/CodeGen/X86/tls1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls1.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls1.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls1.ll Mon Apr 13 08:02:49 2009
@@ -1,5 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:i at NTPOFF, %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movl %fs:i at TPOFF, %eax} %t2
@i = thread_local global i32 15
Modified: llvm/trunk/test/CodeGen/X86/tls10.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls10.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls10.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls10.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:0, %eax} %t
; RUN: grep {leal i at NTPOFF(%eax), %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movq %fs:0, %rax} %t2
+; RUN: grep {leaq i at TPOFF(%rax), %rax} %t2
@i = external hidden thread_local global i32
Modified: llvm/trunk/test/CodeGen/X86/tls11.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls11.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls11.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls11.ll Mon Apr 13 08:02:49 2009
@@ -1,5 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movw %gs:i at NTPOFF, %ax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movw %fs:i at TPOFF, %ax} %t2
@i = thread_local global i16 15
Modified: llvm/trunk/test/CodeGen/X86/tls12.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls12.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls12.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls12.ll Mon Apr 13 08:02:49 2009
@@ -1,5 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movb %gs:i at NTPOFF, %al} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movb %fs:i at TPOFF, %al} %t2
@i = thread_local global i8 15
Modified: llvm/trunk/test/CodeGen/X86/tls13.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls13.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls13.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls13.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movswl %gs:i at NTPOFF, %eax} %t
; RUN: grep {movzwl %gs:j at NTPOFF, %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movswl %fs:i at TPOFF, %edi} %t2
+; RUN: grep {movzwl %fs:j at TPOFF, %edi} %t2
@i = thread_local global i16 0
@j = thread_local global i16 0
Modified: llvm/trunk/test/CodeGen/X86/tls14.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls14.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls14.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls14.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movsbl %gs:i at NTPOFF, %eax} %t
; RUN: grep {movzbl %gs:j at NTPOFF, %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movsbl %fs:i at TPOFF, %edi} %t2
+; RUN: grep {movzbl %fs:j at TPOFF, %edi} %t2
@i = thread_local global i8 0
@j = thread_local global i8 0
Modified: llvm/trunk/test/CodeGen/X86/tls15.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls15.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls15.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls15.ll Mon Apr 13 08:02:49 2009
@@ -2,6 +2,10 @@
; RUN: grep {movl %gs:0, %eax} %t | count 1
; RUN: grep {leal i at NTPOFF(%eax), %ecx} %t
; RUN: grep {leal j at NTPOFF(%eax), %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movq %fs:0, %rax} %t2 | count 1
+; RUN: grep {leaq i at TPOFF(%rax), %rcx} %t2
+; RUN: grep {leaq j at TPOFF(%rax), %rax} %t2
@i = thread_local global i32 0
@j = thread_local global i32 0
Modified: llvm/trunk/test/CodeGen/X86/tls2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls2.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls2.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls2.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:0, %eax} %t
; RUN: grep {leal i at NTPOFF(%eax), %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movq %fs:0, %rax} %t2
+; RUN: grep {leaq i at TPOFF(%rax), %rax} %t2
@i = thread_local global i32 15
Modified: llvm/trunk/test/CodeGen/X86/tls3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls3.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls3.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls3.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl i at INDNTPOFF, %eax} %t
; RUN: grep {movl %gs:(%eax), %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movq i at GOTTPOFF(%rip), %rax} %t2
+; RUN: grep {movl %fs:(%rax), %eax} %t2
@i = external thread_local global i32 ; [#uses=2]
Modified: llvm/trunk/test/CodeGen/X86/tls4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls4.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls4.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls4.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:0, %eax} %t
; RUN: grep {addl i at INDNTPOFF, %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movq %fs:0, %rax} %t2
+; RUN: grep {addq i at GOTTPOFF(%rip), %rax} %t2
@i = external thread_local global i32 ; [#uses=2]
Modified: llvm/trunk/test/CodeGen/X86/tls5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls5.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls5.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls5.ll Mon Apr 13 08:02:49 2009
@@ -1,5 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:i at NTPOFF, %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movl %fs:i at TPOFF, %eax} %t2
@i = internal thread_local global i32 15
Modified: llvm/trunk/test/CodeGen/X86/tls6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls6.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls6.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls6.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:0, %eax} %t
; RUN: grep {leal i at NTPOFF(%eax), %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movq %fs:0, %rax} %t2
+; RUN: grep {leaq i at TPOFF(%rax), %rax} %t2
@i = internal thread_local global i32 15
Modified: llvm/trunk/test/CodeGen/X86/tls7.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls7.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls7.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls7.ll Mon Apr 13 08:02:49 2009
@@ -1,5 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:i at NTPOFF, %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movl %fs:i at TPOFF, %eax} %t2
@i = hidden thread_local global i32 15
Modified: llvm/trunk/test/CodeGen/X86/tls8.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls8.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls8.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls8.ll Mon Apr 13 08:02:49 2009
@@ -1,6 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:0, %eax} %t
; RUN: grep {leal i at NTPOFF(%eax), %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movq %fs:0, %rax} %t2
+; RUN: grep {leaq i at TPOFF(%rax), %rax} %t2
@i = hidden thread_local global i32 15
Modified: llvm/trunk/test/CodeGen/X86/tls9.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls9.ll?rev=68947&r1=68946&r2=68947&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls9.ll (original)
+++ llvm/trunk/test/CodeGen/X86/tls9.ll Mon Apr 13 08:02:49 2009
@@ -1,5 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
; RUN: grep {movl %gs:i at NTPOFF, %eax} %t
+; RUN: llvm-as < %s | llc -march=x86-64 -mtriple=x86_64-linux-gnu > %t2
+; RUN: grep {movl %fs:i at TPOFF, %eax} %t2
@i = external hidden thread_local global i32
From gohman at apple.com Mon Apr 13 10:04:32 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:04:32 -0000
Subject: [llvm-commits] [llvm] r68948 -
/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Message-ID: <200904131504.n3DF4XZT031282@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:04:25 2009
New Revision: 68948
URL: http://llvm.org/viewvc/llvm-project?rev=68948&view=rev
Log:
Fix another hard-coded constant to use X86AddrNumOperands.
This unbreaks the JIT on x86-64.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=68948&r1=68947&r2=68948&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Apr 13 10:04:25 2009
@@ -2602,7 +2602,7 @@
case X86II::MRM4m: case X86II::MRM5m:
case X86II::MRM6m: case X86II::MRM7m:
case X86II::MRMDestMem: {
- unsigned e = isTwoAddr ? 5 : 4;
+ unsigned e = (isTwoAddr ? X86AddrNumOperands+1 : X86AddrNumOperands);
i = isTwoAddr ? 1 : 0;
if (NumOps > e && isX86_64ExtendedReg(MI.getOperand(e)))
REX |= 1 << 2;
From gohman at apple.com Mon Apr 13 10:12:29 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:12:29 -0000
Subject: [llvm-commits] [llvm] r68949 -
/llvm/trunk/include/llvm/Target/TargetInstrInfo.h
Message-ID: <200904131512.n3DFCTRW031555@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:12:29 2009
New Revision: 68949
URL: http://llvm.org/viewvc/llvm-project?rev=68949&view=rev
Log:
Add comments to INSERT_SUBREG, EXTRACT_SURBEG, SUBREG_TO_REG,
and IMPLICIT_DEF.
Modified:
llvm/trunk/include/llvm/Target/TargetInstrInfo.h
Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=68949&r1=68948&r2=68949&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Apr 13 10:12:29 2009
@@ -50,9 +50,29 @@
EH_LABEL = 3,
GC_LABEL = 4,
DECLARE = 5,
+
+ /// EXTRACT_SUBREG - This instruction takes two operands: a register
+ /// that has subregisters, and a subregister index. It returns the
+ /// extracted subregister value. This is commonly used to implement
+ /// truncation operations on target architectures which support it.
EXTRACT_SUBREG = 6,
+
+ /// INSERT_SUBREG - This instruction takes three operands: a register
+ /// that has subregisters, a register providing an insert value, and a
+ /// subregister index. It returns the value of the first register with
+ /// the value of the second register inserted. The first register is
+ /// often defined by an IMPLICIT_DEF, as is commonly used to implement
+ /// anyext operations on target architectures which support it.
INSERT_SUBREG = 7,
+
+ /// IMPLICIT_DEF - This is the MachineInstr-level equivalent of undef.
IMPLICIT_DEF = 8,
+
+ /// SUBREG_TO_REG - This instruction is similar to INSERT_SUBREG except
+ /// that the first operand is an immediate integer constant. This constant
+ /// is often zero, as is commonly used to implement zext operations on
+ /// target architectures which support it, such as with x86-64 (with
+ /// zext from i32 to i64 via implicit zero-extension).
SUBREG_TO_REG = 9
};
From gohman at apple.com Mon Apr 13 10:13:28 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:13:28 -0000
Subject: [llvm-commits] [llvm] r68950 -
/llvm/trunk/lib/Target/X86/X86Instr64bit.td
Message-ID: <200904131513.n3DFDSiq031598@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:13:28 2009
New Revision: 68950
URL: http://llvm.org/viewvc/llvm-project?rev=68950&view=rev
Log:
Add a comment about MOVSX64rr8.
Modified:
llvm/trunk/lib/Target/X86/X86Instr64bit.td
Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=68950&r1=68949&r2=68950&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original)
+++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Apr 13 10:13:28 2009
@@ -255,6 +255,10 @@
// Sign/Zero extenders
+// MOVSX64rr8 always has a REX prefix and it has an 8-bit register
+// operand, which makes it a rare instruction with an 8-bit register
+// operand that can never access an h register. If support for h registers
+// were generalized, this would require a special register class.
def MOVSX64rr8 : RI<0xBE, MRMSrcReg, (outs GR64:$dst), (ins GR8 :$src),
"movs{bq|x}\t{$src, $dst|$dst, $src}",
[(set GR64:$dst, (sext GR8:$src))]>, TB;
From gohman at apple.com Mon Apr 13 10:14:04 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:14:04 -0000
Subject: [llvm-commits] [llvm] r68951 -
/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Message-ID: <200904131514.n3DFE4gP031625@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:14:03 2009
New Revision: 68951
URL: http://llvm.org/viewvc/llvm-project?rev=68951&view=rev
Log:
Use X86::SUBREG_8BIT instead of hard-coding the equivalent constant.
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=68951&r1=68950&r2=68951&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Apr 13 10:14:03 2009
@@ -1298,7 +1298,7 @@
SDNode *X86DAGToDAGISel::getTruncateTo8Bit(SDValue N0) {
assert(!Subtarget->is64Bit() &&
"getTruncateTo8Bit is only needed on x86-32!");
- SDValue SRIdx = CurDAG->getTargetConstant(1, MVT::i32); // SubRegSet 1
+ SDValue SRIdx = CurDAG->getTargetConstant(X86::SUBREG_8BIT, MVT::i32);
DebugLoc dl = N0.getDebugLoc();
// Ensure that the source register has an 8-bit subreg on 32-bit targets
@@ -1463,7 +1463,7 @@
Result,
CurDAG->getTargetConstant(8, MVT::i8)), 0);
// Then truncate it down to i8.
- SDValue SRIdx = CurDAG->getTargetConstant(1, MVT::i32); // SubRegSet 1
+ SDValue SRIdx = CurDAG->getTargetConstant(X86::SUBREG_8BIT, MVT::i32);
Result = SDValue(CurDAG->getTargetNode(X86::EXTRACT_SUBREG, dl,
MVT::i8, Result, SRIdx), 0);
} else {
@@ -1616,7 +1616,7 @@
CurDAG->getTargetConstant(8, MVT::i8)),
0);
// Then truncate it down to i8.
- SDValue SRIdx = CurDAG->getTargetConstant(1, MVT::i32); // SubRegSet 1
+ SDValue SRIdx = CurDAG->getTargetConstant(X86::SUBREG_8BIT, MVT::i32);
Result = SDValue(CurDAG->getTargetNode(X86::EXTRACT_SUBREG, dl,
MVT::i8, Result, SRIdx), 0);
} else {
From gohman at apple.com Mon Apr 13 10:16:56 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:16:56 -0000
Subject: [llvm-commits] [llvm] r68953 -
/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
Message-ID: <200904131516.n3DFGu0l031741@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:16:56 2009
New Revision: 68953
URL: http://llvm.org/viewvc/llvm-project?rev=68953&view=rev
Log:
Add an assertion to verify that a copy was actually emitted.
Modified:
llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=68953&r1=68952&r2=68953&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Apr 13 10:16:56 2009
@@ -857,7 +857,8 @@
ReMatRegs.set(regB);
++NumReMats;
} else {
- TII->copyRegToReg(*mbbi, mi, regA, regB, rc, rc);
+ bool Emitted = TII->copyRegToReg(*mbbi, mi, regA, regB, rc, rc);
+ assert(Emitted && "Unable to issue a copy instruction!\n");
}
MachineBasicBlock::iterator prevMI = prior(mi);
From gohman at apple.com Mon Apr 13 10:18:42 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:18:42 -0000
Subject: [llvm-commits] [llvm] r68954 -
/llvm/trunk/lib/Target/X86/X86RegisterInfo.td
Message-ID: <200904131518.n3DFIgv5031799@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:18:42 2009
New Revision: 68954
URL: http://llvm.org/viewvc/llvm-project?rev=68954&view=rev
Log:
List the l registers before h registers, for consistency.
Modified:
llvm/trunk/lib/Target/X86/X86RegisterInfo.td
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.td?rev=68954&r1=68953&r2=68954&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.td Mon Apr 13 10:18:42 2009
@@ -56,10 +56,10 @@
def BH : Register<"bh">, DwarfRegNum<[3, 3, 3]>;
// 16-bit registers
- def AX : RegisterWithSubRegs<"ax", [AH,AL]>, DwarfRegNum<[0, 0, 0]>;
- def DX : RegisterWithSubRegs<"dx", [DH,DL]>, DwarfRegNum<[1, 2, 2]>;
- def CX : RegisterWithSubRegs<"cx", [CH,CL]>, DwarfRegNum<[2, 1, 1]>;
- def BX : RegisterWithSubRegs<"bx", [BH,BL]>, DwarfRegNum<[3, 3, 3]>;
+ def AX : RegisterWithSubRegs<"ax", [AL,AH]>, DwarfRegNum<[0, 0, 0]>;
+ def DX : RegisterWithSubRegs<"dx", [DL,DH]>, DwarfRegNum<[1, 2, 2]>;
+ def CX : RegisterWithSubRegs<"cx", [CL,CH]>, DwarfRegNum<[2, 1, 1]>;
+ def BX : RegisterWithSubRegs<"bx", [BL,BH]>, DwarfRegNum<[3, 3, 3]>;
def SI : RegisterWithSubRegs<"si", [SIL]>, DwarfRegNum<[4, 6, 6]>;
def DI : RegisterWithSubRegs<"di", [DIL]>, DwarfRegNum<[5, 7, 7]>;
def BP : RegisterWithSubRegs<"bp", [BPL]>, DwarfRegNum<[6, 4, 5]>;
From gohman at apple.com Mon Apr 13 10:21:32 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:21:32 -0000
Subject: [llvm-commits] [llvm] r68955 - /llvm/trunk/lib/CodeGen/Spiller.cpp
Message-ID: <200904131521.n3DFLWNR031927@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:21:32 2009
New Revision: 68955
URL: http://llvm.org/viewvc/llvm-project?rev=68955&view=rev
Log:
When assigning a physical register to a MachineOperand, set
the subreg field to 0, since the subreg field is only used
for virtual register subregs. This doesn't change
current functionality; it just eliminates bogus noise from
debug output.
Modified:
llvm/trunk/lib/CodeGen/Spiller.cpp
Modified: llvm/trunk/lib/CodeGen/Spiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Spiller.cpp?rev=68955&r1=68954&r2=68955&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/Spiller.cpp (original)
+++ llvm/trunk/lib/CodeGen/Spiller.cpp Mon Apr 13 10:21:32 2009
@@ -104,6 +104,7 @@
}
MF.getRegInfo().setPhysRegUsed(RReg);
MI.getOperand(i).setReg(RReg);
+ MI.getOperand(i).setSubReg(0);
} else {
MF.getRegInfo().setPhysRegUsed(MO.getReg());
}
@@ -280,6 +281,7 @@
assert(Phys);
unsigned RReg = SubIdx ? TRI->getSubReg(Phys, SubIdx) : Phys;
MO.setReg(RReg);
+ MO.setSubReg(0);
}
++NumReMats;
}
@@ -496,7 +498,8 @@
unsigned SubIdx = MI->getOperand(NewOp.Operand).getSubReg();
unsigned RReg = SubIdx ? TRI->getSubReg(NewPhysReg, SubIdx) : NewPhysReg;
MI->getOperand(NewOp.Operand).setReg(RReg);
-
+ MI->getOperand(NewOp.Operand).setSubReg(0);
+
Spills.addAvailable(NewOp.StackSlotOrReMat, NewPhysReg);
--MII;
UpdateKills(*MII, RegKills, KillOps, TRI);
@@ -1122,6 +1125,7 @@
ReusedOperands.markClobbered(Phys);
unsigned RReg = SubIdx ? TRI->getSubReg(Phys, SubIdx) : Phys;
MI.getOperand(i).setReg(RReg);
+ MI.getOperand(i).setSubReg(0);
if (VRM.isImplicitlyDefined(VirtReg))
BuildMI(MBB, &MI, MI.getDebugLoc(),
TII->get(TargetInstrInfo::IMPLICIT_DEF), RReg);
@@ -1185,6 +1189,7 @@
<< TRI->getName(VRM.getPhys(VirtReg)) << "\n";
unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
MI.getOperand(i).setReg(RReg);
+ MI.getOperand(i).setSubReg(0);
// The only technical detail we have is that we don't know that
// PhysReg won't be clobbered by a reloaded stack slot that occurs
@@ -1264,6 +1269,7 @@
<< " instead of reloading into same physreg.\n";
unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
MI.getOperand(i).setReg(RReg);
+ MI.getOperand(i).setSubReg(0);
ReusedOperands.markClobbered(RReg);
++NumReused;
continue;
@@ -1284,6 +1290,7 @@
unsigned RReg =
SubIdx ? TRI->getSubReg(DesignatedReg, SubIdx) : DesignatedReg;
MI.getOperand(i).setReg(RReg);
+ MI.getOperand(i).setSubReg(0);
DOUT << '\t' << *prior(MII);
++NumReused;
continue;
@@ -1328,6 +1335,7 @@
}
unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
MI.getOperand(i).setReg(RReg);
+ MI.getOperand(i).setSubReg(0);
UpdateKills(*prior(MII), RegKills, KillOps, TRI);
DOUT << '\t' << *prior(MII);
}
@@ -1613,6 +1621,7 @@
unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
ReusedOperands.markClobbered(RReg);
MI.getOperand(i).setReg(RReg);
+ MI.getOperand(i).setSubReg(0);
if (!MO.isDead()) {
MachineInstr *&LastStore = MaybeDeadStores[StackSlot];
From gohman at apple.com Mon Apr 13 10:22:30 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:22:30 -0000
Subject: [llvm-commits] [llvm] r68956 -
/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Message-ID: <200904131522.n3DFMUad032009@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:22:29 2009
New Revision: 68956
URL: http://llvm.org/viewvc/llvm-project?rev=68956&view=rev
Log:
Don't abort on an aliasing physical register that does not have
a live interval. This is needed for some upcoming subreg changes.
Modified:
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=68956&r1=68955&r2=68956&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Apr 13 10:22:29 2009
@@ -2235,7 +2235,7 @@
// If there are registers which alias PhysReg, but which are not a
// sub-register of the chosen representative super register. Assert
// since we can't handle it yet.
- assert(*AS == SpillReg || !allocatableRegs_[*AS] ||
+ assert(*AS == SpillReg || !allocatableRegs_[*AS] || !hasInterval(*AS) ||
tri_->isSuperRegister(*AS, SpillReg));
bool Cut = false;
From gohman at apple.com Mon Apr 13 10:24:11 2009
From: gohman at apple.com (Dan Gohman)
Date: Mon, 13 Apr 2009 15:24:11 -0000
Subject: [llvm-commits] [llvm] r68957 -
/llvm/trunk/utils/TableGen/CodeGenTarget.h
Message-ID: <200904131524.n3DFOB8K032067@zion.cs.uiuc.edu>
Author: djg
Date: Mon Apr 13 10:24:11 2009
New Revision: 68957
URL: http://llvm.org/viewvc/llvm-project?rev=68957&view=rev
Log:
Generalize getRegisterClassForRegister to handle registers
in multiple classes in the case that the classes are all
in subset/superset relations. This function is used by the
fast-isel emitter, which always wants the super-most set.
Modified:
llvm/trunk/utils/TableGen/CodeGenTarget.h
Modified: llvm/trunk/utils/TableGen/CodeGenTarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.h?rev=68957&r1=68956&r2=68957&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.h Mon Apr 13 10:24:11 2009
@@ -19,6 +19,7 @@
#include "CodeGenRegisters.h"
#include "CodeGenInstruction.h"
+#include
#include
#include