Skip to content

Commit f39242c

Browse files
authored
Revert "[flang] Generalized simplification of HLFIR reduction ops." (#136218)
Reverts #136071
1 parent 767c8c1 commit f39242c

18 files changed

+1999
-2287
lines changed

flang/include/flang/Optimizer/Builder/HLFIRTools.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,6 @@ mlir::Value genExtent(mlir::Location loc, fir::FirOpBuilder &builder,
301301
mlir::Value genLBound(mlir::Location loc, fir::FirOpBuilder &builder,
302302
hlfir::Entity entity, unsigned dim);
303303

304-
/// Compute the lower bounds of \p entity, which is an array of known rank.
305-
llvm::SmallVector<mlir::Value> genLBounds(mlir::Location loc,
306-
fir::FirOpBuilder &builder,
307-
hlfir::Entity entity);
308-
309304
/// Generate a vector of extents with index type from a fir.shape
310305
/// of fir.shape_shift value.
311306
llvm::SmallVector<mlir::Value> getIndexExtents(mlir::Location loc,

flang/lib/Optimizer/Builder/HLFIRTools.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -659,33 +659,6 @@ mlir::Value hlfir::genLBound(mlir::Location loc, fir::FirOpBuilder &builder,
659659
return dimInfo.getLowerBound();
660660
}
661661

662-
llvm::SmallVector<mlir::Value> hlfir::genLBounds(mlir::Location loc,
663-
fir::FirOpBuilder &builder,
664-
hlfir::Entity entity) {
665-
assert(!entity.isAssumedRank() &&
666-
"cannot compute all lower bounds for assumed rank");
667-
assert(!entity.isScalar() && "expected an array entity");
668-
int rank = entity.getRank();
669-
mlir::Type idxTy = builder.getIndexType();
670-
if (!entity.mayHaveNonDefaultLowerBounds())
671-
return {static_cast<std::size_t>(rank),
672-
builder.createIntegerConstant(loc, idxTy, 1)};
673-
674-
if (auto shape = tryRetrievingShapeOrShift(entity)) {
675-
auto lbounds = getExplicitLboundsFromShape(shape);
676-
if (!lbounds.empty())
677-
return lbounds;
678-
}
679-
680-
if (entity.isMutableBox())
681-
entity = hlfir::derefPointersAndAllocatables(loc, builder, entity);
682-
683-
llvm::SmallVector<mlir::Value, Fortran::common::maxRank> lbounds;
684-
fir::factory::genDimInfoFromBox(builder, loc, entity, &lbounds,
685-
/*extents=*/nullptr, /*strides=*/nullptr);
686-
return lbounds;
687-
}
688-
689662
void hlfir::genLengthParameters(mlir::Location loc, fir::FirOpBuilder &builder,
690663
Entity entity,
691664
llvm::SmallVectorImpl<mlir::Value> &result) {

flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp

Lines changed: 465 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)