Skip to content

Commit 6165aeb

Browse files
committed
[Delinearization] Remove tryDelinearizeFixedSizeImpl
1 parent 3005886 commit 6165aeb

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

llvm/include/llvm/Analysis/Delinearization.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,6 @@ bool getIndexExpressionsFromGEP(ScalarEvolution &SE,
155155
SmallVectorImpl<const SCEV *> &Subscripts,
156156
SmallVectorImpl<int> &Sizes);
157157

158-
/// Implementation of fixed size array delinearization. Try to delinearize
159-
/// access function for a fixed size multi-dimensional array, by deriving
160-
/// subscripts from GEP instructions. Returns true upon success and false
161-
/// otherwise. \p Inst is the load/store instruction whose pointer operand is
162-
/// the one we want to delinearize. \p AccessFn is its corresponding SCEV
163-
/// expression w.r.t. the surrounding loop.
164-
bool tryDelinearizeFixedSizeImpl(ScalarEvolution *SE, Instruction *Inst,
165-
const SCEV *AccessFn,
166-
SmallVectorImpl<const SCEV *> &Subscripts,
167-
SmallVectorImpl<int> &Sizes);
168-
169158
struct DelinearizationPrinterPass
170159
: public PassInfoMixin<DelinearizationPrinterPass> {
171160
explicit DelinearizationPrinterPass(raw_ostream &OS);

llvm/lib/Analysis/Delinearization.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -704,44 +704,6 @@ bool llvm::getIndexExpressionsFromGEP(ScalarEvolution &SE,
704704
return !Subscripts.empty();
705705
}
706706

707-
bool llvm::tryDelinearizeFixedSizeImpl(
708-
ScalarEvolution *SE, Instruction *Inst, const SCEV *AccessFn,
709-
SmallVectorImpl<const SCEV *> &Subscripts, SmallVectorImpl<int> &Sizes) {
710-
Value *SrcPtr = getLoadStorePointerOperand(Inst);
711-
712-
// Check the simple case where the array dimensions are fixed size.
713-
auto *SrcGEP = dyn_cast<GetElementPtrInst>(SrcPtr);
714-
if (!SrcGEP)
715-
return false;
716-
717-
getIndexExpressionsFromGEP(*SE, SrcGEP, Subscripts, Sizes);
718-
719-
// Check that the two size arrays are non-empty and equal in length and
720-
// value.
721-
// TODO: it would be better to let the caller to clear Subscripts, similar
722-
// to how we handle Sizes.
723-
if (Sizes.empty() || Subscripts.size() <= 1) {
724-
Subscripts.clear();
725-
return false;
726-
}
727-
728-
// Check that for identical base pointers we do not miss index offsets
729-
// that have been added before this GEP is applied.
730-
Value *SrcBasePtr = SrcGEP->getOperand(0)->stripPointerCasts();
731-
const SCEVUnknown *SrcBase =
732-
dyn_cast<SCEVUnknown>(SE->getPointerBase(AccessFn));
733-
if (!SrcBase || SrcBasePtr != SrcBase->getValue()) {
734-
Subscripts.clear();
735-
return false;
736-
}
737-
738-
assert(Subscripts.size() == Sizes.size() + 1 &&
739-
"Expected equal number of entries in the list of size and "
740-
"subscript.");
741-
742-
return true;
743-
}
744-
745707
namespace {
746708

747709
void printDelinearization(raw_ostream &O, Function *F, LoopInfo *LI,

0 commit comments

Comments
 (0)