@@ -3150,10 +3150,9 @@ class FirConverter : public Fortran::lower::AbstractConverter {
3150
3150
loc, 1 ); // Use index type directly
3151
3151
3152
3152
// Ensure lb, ub, and step are of index type using fir.convert
3153
- mlir::Type indexType = builder->getIndexType ();
3154
- lb = builder->create <fir::ConvertOp>(loc, indexType, lb);
3155
- ub = builder->create <fir::ConvertOp>(loc, indexType, ub);
3156
- step = builder->create <fir::ConvertOp>(loc, indexType, step);
3153
+ lb = builder->create <fir::ConvertOp>(loc, idxTy, lb);
3154
+ ub = builder->create <fir::ConvertOp>(loc, idxTy, ub);
3155
+ step = builder->create <fir::ConvertOp>(loc, idxTy, step);
3157
3156
3158
3157
lbs.push_back (lb);
3159
3158
ubs.push_back (ub);
@@ -3163,18 +3162,14 @@ class FirConverter : public Fortran::lower::AbstractConverter {
3163
3162
3164
3163
// Handle induction variable
3165
3164
mlir::Value ivValue = getSymbolAddress (*name.symbol );
3166
- std::size_t ivTypeSize = name.symbol ->size ();
3167
- if (ivTypeSize == 0 )
3168
- llvm::report_fatal_error (" unexpected induction variable size" );
3169
- mlir::Type ivTy = builder->getIntegerType (ivTypeSize * 8 );
3170
3165
3171
3166
if (!ivValue) {
3172
3167
// DO CONCURRENT induction variables are not mapped yet since they are
3173
3168
// local to the DO CONCURRENT scope.
3174
3169
mlir::OpBuilder::InsertPoint insPt = builder->saveInsertionPoint ();
3175
3170
builder->setInsertionPointToStart (builder->getAllocaBlock ());
3176
3171
ivValue = builder->createTemporaryAlloc (
3177
- loc, ivTy , toStringRef (name.symbol ->name ()));
3172
+ loc, idxTy , toStringRef (name.symbol ->name ()));
3178
3173
builder->restoreInsertionPoint (insPt);
3179
3174
}
3180
3175
@@ -3186,7 +3181,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
3186
3181
// Bind the symbol to the declared variable
3187
3182
bindSymbol (*name.symbol , ivValue);
3188
3183
ivValues.push_back (ivValue);
3189
- ivTypes.push_back (ivTy );
3184
+ ivTypes.push_back (idxTy );
3190
3185
ivLocs.push_back (loc);
3191
3186
}
3192
3187
} else {
0 commit comments