[flang-commits] [flang] [flang][cuda] Change induction variable from i32 to index for doconcurrent inside cuf kernel directive (PR #129924)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Wed Mar 5 12:28:39 PST 2025


================
@@ -3163,18 +3162,14 @@ class FirConverter : public Fortran::lower::AbstractConverter {
 
         // Handle induction variable
         mlir::Value ivValue = getSymbolAddress(*name.symbol);
-        std::size_t ivTypeSize = name.symbol->size();
-        if (ivTypeSize == 0)
-          llvm::report_fatal_error("unexpected induction variable size");
-        mlir::Type ivTy = builder->getIntegerType(ivTypeSize * 8);
 
         if (!ivValue) {
           // DO CONCURRENT induction variables are not mapped yet since they are
           // local to the DO CONCURRENT scope.
           mlir::OpBuilder::InsertPoint insPt = builder->saveInsertionPoint();
           builder->setInsertionPointToStart(builder->getAllocaBlock());
           ivValue = builder->createTemporaryAlloc(
----------------
clementval wrote:

We should map the iv symbol to the block argument directly so we don't need a temporary. This can be done in a separate patch. 

https://github.com/llvm/llvm-project/pull/129924


More information about the flang-commits mailing list