mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bbcb34cafb
commit
399101a599
@ -840,7 +840,7 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset,
|
|||||||
abort();
|
abort();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (PC->getType()->isFirstClassType()) {
|
} else if (PC->getType()->isSingleValueType()) {
|
||||||
unsigned char *ptr = (unsigned char *)PA;
|
unsigned char *ptr = (unsigned char *)PA;
|
||||||
switch (PC->getType()->getTypeID()) {
|
switch (PC->getType()->getTypeID()) {
|
||||||
case Type::IntegerTyID: {
|
case Type::IntegerTyID: {
|
||||||
|
@ -154,10 +154,10 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
|
|||||||
<< PtrArg->getName() << "' because it would require adding more "
|
<< PtrArg->getName() << "' because it would require adding more "
|
||||||
<< "than " << maxElements << " arguments to the function.\n";
|
<< "than " << maxElements << " arguments to the function.\n";
|
||||||
} else {
|
} 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;
|
bool AllSimple = true;
|
||||||
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
|
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
|
||||||
if (!STy->getElementType(i)->isFirstClassType()) {
|
if (!STy->getElementType(i)->isSingleValueType()) {
|
||||||
AllSimple = false;
|
AllSimple = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1493,11 +1493,11 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
|
|||||||
// this global a local variable) we replace the global with a local alloca
|
// this global a local variable) we replace the global with a local alloca
|
||||||
// in this function.
|
// 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.
|
// are just replacing static memory to stack memory.
|
||||||
if (!GS.HasMultipleAccessingFunctions &&
|
if (!GS.HasMultipleAccessingFunctions &&
|
||||||
GS.AccessingFunction && !GS.HasNonInstructionUser &&
|
GS.AccessingFunction && !GS.HasNonInstructionUser &&
|
||||||
GV->getType()->getElementType()->isFirstClassType() &&
|
GV->getType()->getElementType()->isSingleValueType() &&
|
||||||
GS.AccessingFunction->getName() == "main" &&
|
GS.AccessingFunction->getName() == "main" &&
|
||||||
GS.AccessingFunction->hasExternalLinkage()) {
|
GS.AccessingFunction->hasExternalLinkage()) {
|
||||||
DOUT << "LOCALIZING GLOBAL: " << *GV;
|
DOUT << "LOCALIZING GLOBAL: " << *GV;
|
||||||
@ -1548,7 +1548,7 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
|
|||||||
|
|
||||||
++NumMarked;
|
++NumMarked;
|
||||||
return true;
|
return true;
|
||||||
} else if (!GV->getInitializer()->getType()->isFirstClassType()) {
|
} else if (!GV->getInitializer()->getType()->isSingleValueType()) {
|
||||||
if (GlobalVariable *FirstNewGV = SRAGlobal(GV,
|
if (GlobalVariable *FirstNewGV = SRAGlobal(GV,
|
||||||
getAnalysis<TargetData>())) {
|
getAnalysis<TargetData>())) {
|
||||||
GVI = FirstNewGV; // Don't skip the newly produced globals!
|
GVI = FirstNewGV; // Don't skip the newly produced globals!
|
||||||
|
Loading…
Reference in New Issue
Block a user