Skip to content

Commit ce0c472

Browse files
committed
Revert "Reland [flang] Generalized simplification of HLFIR reduction ops. (#136071)"
This reverts commit 32311a6.
1 parent 7f107c3 commit ce0c472

18 files changed

+1999
-2286
lines changed

Diff for: flang/include/flang/Optimizer/Builder/HLFIRTools.h

-5
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,

Diff for: flang/lib/Optimizer/Builder/HLFIRTools.cpp

-27
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> 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) {

Diff for: flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp

+465
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)