mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 03:29:40 +00:00
[opaque pointer type] gep API migration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
67dcb7d7ca
commit
e265afc254
@ -255,6 +255,7 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
|
|||||||
Value *BasePtr = GetPointerOperand(MemI);
|
Value *BasePtr = GetPointerOperand(MemI);
|
||||||
assert(BasePtr && "No pointer operand");
|
assert(BasePtr && "No pointer operand");
|
||||||
|
|
||||||
|
Type *I8Ty = Type::getInt8Ty(MemI->getParent()->getContext());
|
||||||
Type *I8PtrTy = Type::getInt8PtrTy(MemI->getParent()->getContext(),
|
Type *I8PtrTy = Type::getInt8PtrTy(MemI->getParent()->getContext(),
|
||||||
BasePtr->getType()->getPointerAddressSpace());
|
BasePtr->getType()->getPointerAddressSpace());
|
||||||
|
|
||||||
@ -289,8 +290,8 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Instruction *InsPoint = Header->getFirstInsertionPt();
|
Instruction *InsPoint = Header->getFirstInsertionPt();
|
||||||
GetElementPtrInst *PtrInc =
|
GetElementPtrInst *PtrInc = GetElementPtrInst::Create(
|
||||||
GetElementPtrInst::Create(NewPHI, BasePtrIncSCEV->getValue(),
|
I8Ty, NewPHI, BasePtrIncSCEV->getValue(),
|
||||||
MemI->hasName() ? MemI->getName() + ".inc" : "", InsPoint);
|
MemI->hasName() ? MemI->getName() + ".inc" : "", InsPoint);
|
||||||
PtrInc->setIsInBounds(IsPtrInBounds(BasePtr));
|
PtrInc->setIsInBounds(IsPtrInBounds(BasePtr));
|
||||||
for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
|
for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
|
||||||
@ -335,9 +336,9 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
|
|||||||
PtrIP = PtrIP->getParent()->getFirstInsertionPt();
|
PtrIP = PtrIP->getParent()->getFirstInsertionPt();
|
||||||
else if (!PtrIP)
|
else if (!PtrIP)
|
||||||
PtrIP = I->second;
|
PtrIP = I->second;
|
||||||
|
|
||||||
GetElementPtrInst *NewPtr =
|
GetElementPtrInst *NewPtr = GetElementPtrInst::Create(
|
||||||
GetElementPtrInst::Create(PtrInc, Diff->getValue(),
|
I8Ty, PtrInc, Diff->getValue(),
|
||||||
I->second->hasName() ? I->second->getName() + ".off" : "", PtrIP);
|
I->second->hasName() ? I->second->getName() + ".off" : "", PtrIP);
|
||||||
if (!PtrIP)
|
if (!PtrIP)
|
||||||
NewPtr->insertAfter(cast<Instruction>(PtrInc));
|
NewPtr->insertAfter(cast<Instruction>(PtrInc));
|
||||||
|
Loading…
Reference in New Issue
Block a user