[llvm-commits] [llvm] r51459 - in /llvm/trunk/lib: CodeGen/MachOWriter.cpp Transforms/IPO/ArgumentPromotion.cpp Transforms/IPO/GlobalOpt.cpp
Dan Gohman
gohman at apple.com
Thu May 22 17:17:26 PDT 2008
Author: djg
Date: Thu May 22 19:17:26 2008
New Revision: 51459
URL: http://llvm.org/viewvc/llvm-project?rev=51459&view=rev
Log:
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.
Modified:
llvm/trunk/lib/CodeGen/MachOWriter.cpp
llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=51459&r1=51458&r2=51459&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Thu May 22 19:17:26 2008
@@ -840,7 +840,7 @@
abort();
break;
}
- } else if (PC->getType()->isFirstClassType()) {
+ } else if (PC->getType()->isSingleValueType()) {
unsigned char *ptr = (unsigned char *)PA;
switch (PC->getType()->getTypeID()) {
case Type::IntegerTyID: {
Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=51459&r1=51458&r2=51459&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Thu May 22 19:17:26 2008
@@ -154,10 +154,10 @@
<< PtrArg->getName() << "' because it would require adding more "
<< "than " << maxElements << " arguments to the function.\n";
} else {
- // If all the elements are first class types, we can promote it.
+ // If all the elements are single-value types, we can promote it.
bool AllSimple = true;
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- if (!STy->getElementType(i)->isFirstClassType()) {
+ if (!STy->getElementType(i)->isSingleValueType()) {
AllSimple = false;
break;
}
Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=51459&r1=51458&r2=51459&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu May 22 19:17:26 2008
@@ -1493,11 +1493,11 @@
// this global a local variable) we replace the global with a local alloca
// in this function.
//
- // NOTE: It doesn't make sense to promote non first class types since we
+ // NOTE: It doesn't make sense to promote non single-value types since we
// are just replacing static memory to stack memory.
if (!GS.HasMultipleAccessingFunctions &&
GS.AccessingFunction && !GS.HasNonInstructionUser &&
- GV->getType()->getElementType()->isFirstClassType() &&
+ GV->getType()->getElementType()->isSingleValueType() &&
GS.AccessingFunction->getName() == "main" &&
GS.AccessingFunction->hasExternalLinkage()) {
DOUT << "LOCALIZING GLOBAL: " << *GV;
@@ -1548,7 +1548,7 @@
++NumMarked;
return true;
- } else if (!GV->getInitializer()->getType()->isFirstClassType()) {
+ } else if (!GV->getInitializer()->getType()->isSingleValueType()) {
if (GlobalVariable *FirstNewGV = SRAGlobal(GV,
getAnalysis<TargetData>())) {
GVI = FirstNewGV; // Don't skip the newly produced globals!
More information about the llvm-commits
mailing list