Skip to content

Commit 5178aef

Browse files
authored
Revert "[flang] Lower EOSHIFT into hlfir.eoshift." (#153907)
Reverts #153106 Buildbots failing: * https://lab.llvm.org/buildbot/#/builders/199/builds/5188 * https://lab.llvm.org/buildbot/#/builders/41/builds/8329
1 parent b7ec10c commit 5178aef

File tree

2 files changed

+0
-300
lines changed

2 files changed

+0
-300
lines changed

flang/lib/Lower/HlfirIntrinsics.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,6 @@ class HlfirCShiftLowering : public HlfirTransformationalIntrinsic {
170170
mlir::Type stmtResultType) override;
171171
};
172172

173-
class HlfirEOShiftLowering : public HlfirTransformationalIntrinsic {
174-
public:
175-
using HlfirTransformationalIntrinsic::HlfirTransformationalIntrinsic;
176-
177-
protected:
178-
mlir::Value
179-
lowerImpl(const Fortran::lower::PreparedActualArguments &loweredActuals,
180-
const fir::IntrinsicArgumentLoweringRules *argLowering,
181-
mlir::Type stmtResultType) override;
182-
};
183-
184173
class HlfirReshapeLowering : public HlfirTransformationalIntrinsic {
185174
public:
186175
using HlfirTransformationalIntrinsic::HlfirTransformationalIntrinsic;
@@ -441,33 +430,6 @@ mlir::Value HlfirCShiftLowering::lowerImpl(
441430
return createOp<hlfir::CShiftOp>(resultType, operands);
442431
}
443432

444-
mlir::Value HlfirEOShiftLowering::lowerImpl(
445-
const Fortran::lower::PreparedActualArguments &loweredActuals,
446-
const fir::IntrinsicArgumentLoweringRules *argLowering,
447-
mlir::Type stmtResultType) {
448-
auto operands = getOperandVector(loweredActuals, argLowering);
449-
assert(operands.size() == 4);
450-
mlir::Value array = operands[0];
451-
mlir::Value shift = operands[1];
452-
mlir::Value boundary = operands[2];
453-
mlir::Value dim = operands[3];
454-
// If DIM is present, then dereference it if it is a ref.
455-
if (dim)
456-
dim = hlfir::loadTrivialScalar(loc, builder, hlfir::Entity{dim});
457-
458-
mlir::Type resultType = computeResultType(array, stmtResultType);
459-
460-
// Scalar logical constant boundary might be represented using i1, i2, ...
461-
// type. We need to cast it to fir.logical type of the ARRAY/result.
462-
if (auto logicalTy = mlir::dyn_cast<fir::LogicalType>(
463-
hlfir::getFortranElementType(resultType)))
464-
if (boundary && fir::isa_trivial(boundary.getType()) &&
465-
boundary.getType() != logicalTy)
466-
boundary = builder.createConvert(loc, logicalTy, boundary);
467-
468-
return createOp<hlfir::EOShiftOp>(resultType, array, shift, boundary, dim);
469-
}
470-
471433
mlir::Value HlfirReshapeLowering::lowerImpl(
472434
const Fortran::lower::PreparedActualArguments &loweredActuals,
473435
const fir::IntrinsicArgumentLoweringRules *argLowering,
@@ -527,9 +489,6 @@ std::optional<hlfir::EntityWithAttributes> Fortran::lower::lowerHlfirIntrinsic(
527489
if (name == "cshift")
528490
return HlfirCShiftLowering{builder, loc}.lower(loweredActuals, argLowering,
529491
stmtResultType);
530-
if (name == "eoshift")
531-
return HlfirEOShiftLowering{builder, loc}.lower(loweredActuals, argLowering,
532-
stmtResultType);
533492
if (name == "reshape")
534493
return HlfirReshapeLowering{builder, loc}.lower(loweredActuals, argLowering,
535494
stmtResultType);

0 commit comments

Comments
 (0)