mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Don't use default address space arguments in GlobalOpt
llvm-svn: 207019
This commit is contained in:
parent
0a7dc3330f
commit
71fe4a9cad
@ -1170,10 +1170,13 @@ static Value *GetHeapSROAValue(Value *V, unsigned FieldNo,
|
||||
} else if (PHINode *PN = dyn_cast<PHINode>(V)) {
|
||||
// PN's type is pointer to struct. Make a new PHI of pointer to struct
|
||||
// field.
|
||||
StructType *ST = cast<StructType>(PN->getType()->getPointerElementType());
|
||||
|
||||
PointerType *PTy = cast<PointerType>(PN->getType());
|
||||
StructType *ST = cast<StructType>(PTy->getElementType());
|
||||
|
||||
unsigned AS = PTy->getAddressSpace();
|
||||
PHINode *NewPN =
|
||||
PHINode::Create(PointerType::getUnqual(ST->getElementType(FieldNo)),
|
||||
PHINode::Create(PointerType::get(ST->getElementType(FieldNo), AS),
|
||||
PN->getNumIncomingValues(),
|
||||
PN->getName()+".f"+Twine(FieldNo), PN);
|
||||
Result = NewPN;
|
||||
@ -1285,9 +1288,10 @@ static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, CallInst *CI,
|
||||
std::vector<Value*> FieldGlobals;
|
||||
std::vector<Value*> FieldMallocs;
|
||||
|
||||
unsigned AS = GV->getType()->getPointerAddressSpace();
|
||||
for (unsigned FieldNo = 0, e = STy->getNumElements(); FieldNo != e;++FieldNo){
|
||||
Type *FieldTy = STy->getElementType(FieldNo);
|
||||
PointerType *PFieldTy = PointerType::getUnqual(FieldTy);
|
||||
PointerType *PFieldTy = PointerType::get(FieldTy, AS);
|
||||
|
||||
GlobalVariable *NGV =
|
||||
new GlobalVariable(*GV->getParent(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user