Skip to content

Commit b62e592

Browse files
committed
[flang][NFC] Remove obsolete IntrinsicCall helper
Remove obsolete code that has moved to the `flang/Optimizer/Builder/Intrinsic` directory. `genMin` is inlined in the code since it's not available in the builder. Reviewed By: kiranchandramohan, schweitz Differential Revision: https://reviews.llvm.org/D118465
1 parent 0daa72a commit b62e592

File tree

4 files changed

+5
-1377
lines changed

4 files changed

+5
-1377
lines changed

flang/include/flang/Lower/IntrinsicCall.h

Lines changed: 0 additions & 67 deletions
This file was deleted.

flang/lib/Lower/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ add_flang_library(FortranLower
55
CharacterRuntime.cpp
66
Coarray.cpp
77
ConvertType.cpp
8-
IntrinsicCall.cpp
98
IO.cpp
109
Mangler.cpp
1110
OpenACC.cpp

flang/lib/Lower/CharacterExpr.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "flang/Lower/CharacterExpr.h"
1010
#include "flang/Lower/ConvertType.h"
11-
#include "flang/Lower/IntrinsicCall.h"
1211
#include "flang/Optimizer/Builder/DoLoopHelper.h"
1312

1413
//===----------------------------------------------------------------------===//
@@ -244,9 +243,12 @@ void Fortran::lower::CharacterExprHelper::createAssign(
244243
// Copy the minimum of the lhs and rhs lengths and pad the lhs remainder
245244
// if needed.
246245
mlir::Value copyCount = lhs.getLen();
247-
if (!compileTimeSameLength)
246+
if (!compileTimeSameLength) {
247+
auto cmp = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::slt,
248+
lhs.getLen(), rhs.getLen());
248249
copyCount =
249-
Fortran::lower::genMin(builder, loc, {lhs.getLen(), rhs.getLen()});
250+
builder.create<mlir::SelectOp>(loc, cmp, lhs.getLen(), rhs.getLen());
251+
}
250252

251253
fir::CharBoxValue safeRhs = rhs;
252254
if (needToMaterialize(rhs)) {

0 commit comments

Comments
 (0)