[PATCH] D27518: Moving isComplex decision to TTI
Michael Kuperstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 22 10:35:41 PST 2016
mkuper added a comment.
What I'm saying is that you have this code in getAddressAccessComplexity():
const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(Ptr));
if (!AddRec)
return AddressInfo;
AddressInfo.isStrided = true;
// Get Step Recurrence.
AddressInfo.Step = AddRec->getStepRecurrence(*SE);
return AddressInfo;
So, basically, the logic right now is:
1. If we don't have a SCEV for the pointer, or have a SCEV which isn't an AddRec, return a struct with isStrided == false.
2. If we have a SCEV, and it's an AddRec, return a struct with isStrided == true, and a Step.
What I'm saying is that you could replace this with "If we don't have a SCEVAddRecExpr for the pointer return null, otherwise return the SCEV", and pass the result of that into getAddressComputationCost(). Then, if getAddressComputationCost() doesn't get a SCEV, it knows the access isn't strided. If it does get a SCEV, it knows it's strided, and can call getStepRecurrence to get the Step.
Am I missing something?
https://reviews.llvm.org/D27518
More information about the llvm-commits
mailing list