mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Shorten some expressions by using ArrayRef::slice().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -407,8 +407,7 @@ InsertPHITranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
GetElementPtrInst *Result =
|
GetElementPtrInst *Result =
|
||||||
GetElementPtrInst::Create(GEPOps[0],
|
GetElementPtrInst::Create(GEPOps[0], makeArrayRef(GEPOps).slice(1),
|
||||||
makeArrayRef(GEPOps.begin() + 1, GEPOps.end()),
|
|
||||||
InVal->getName()+".phi.trans.insert",
|
InVal->getName()+".phi.trans.insert",
|
||||||
PredBB->getTerminator());
|
PredBB->getTerminator());
|
||||||
Result->setIsInBounds(GEP->isInBounds());
|
Result->setIsInBounds(GEP->isInBounds());
|
||||||
|
@@ -229,8 +229,7 @@ Instruction *InstCombiner::FoldPHIArgGEPIntoPHI(PHINode &PN) {
|
|||||||
|
|
||||||
Value *Base = FixedOperands[0];
|
Value *Base = FixedOperands[0];
|
||||||
GetElementPtrInst *NewGEP =
|
GetElementPtrInst *NewGEP =
|
||||||
GetElementPtrInst::Create(Base, makeArrayRef(FixedOperands.begin() + 1,
|
GetElementPtrInst::Create(Base, makeArrayRef(FixedOperands).slice(1));
|
||||||
FixedOperands.end()));
|
|
||||||
if (AllInBounds) NewGEP->setIsInBounds();
|
if (AllInBounds) NewGEP->setIsInBounds();
|
||||||
NewGEP->setDebugLoc(FirstInst->getDebugLoc());
|
NewGEP->setDebugLoc(FirstInst->getDebugLoc());
|
||||||
return NewGEP;
|
return NewGEP;
|
||||||
|
Reference in New Issue
Block a user