mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Add a comment
Make LSR ignore GEP's that have loop variant base values, as we currently cannot codegen them git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1060e09fb2
commit
07cd0ff298
@ -251,6 +251,9 @@ void LoopStrengthReduce::AnalyzeGetElementPtrUsers(GetElementPtrInst *GEP,
|
|||||||
UIntPtrTy));
|
UIntPtrTy));
|
||||||
} else {
|
} else {
|
||||||
SCEVHandle Idx = SE->getSCEV(GEP->getOperand(i));
|
SCEVHandle Idx = SE->getSCEV(GEP->getOperand(i));
|
||||||
|
|
||||||
|
// If this operand is reducible, and it's not the one we are looking at
|
||||||
|
// currently, do not process the GEP at this time.
|
||||||
if (CanReduceSCEV(Idx, L))
|
if (CanReduceSCEV(Idx, L))
|
||||||
return;
|
return;
|
||||||
Base = SCEVAddExpr::get(Base, GetAdjustedIndex(Idx,
|
Base = SCEVAddExpr::get(Base, GetAdjustedIndex(Idx,
|
||||||
@ -287,6 +290,13 @@ void LoopStrengthReduce::AnalyzeGetElementPtrUsers(GetElementPtrInst *GEP,
|
|||||||
|
|
||||||
assert(CanReduceSCEV(GEPIndexExpr, L) && "Non reducible idx??");
|
assert(CanReduceSCEV(GEPIndexExpr, L) && "Non reducible idx??");
|
||||||
|
|
||||||
|
// FIXME: If the base is not loop invariant, we currently cannot emit this.
|
||||||
|
if (!Base->isLoopInvariant(L)) {
|
||||||
|
DEBUG(std::cerr << "IGNORING GEP due to non-invaiant base: "
|
||||||
|
<< *Base << "\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Base = SCEVAddExpr::get(Base, cast<SCEVAddRecExpr>(GEPIndexExpr)->getStart());
|
Base = SCEVAddExpr::get(Base, cast<SCEVAddRecExpr>(GEPIndexExpr)->getStart());
|
||||||
SCEVHandle Stride = cast<SCEVAddRecExpr>(GEPIndexExpr)->getOperand(1);
|
SCEVHandle Stride = cast<SCEVAddRecExpr>(GEPIndexExpr)->getOperand(1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user