@@ -2059,37 +2059,38 @@ static void genCanonicalLoopNest(
20592059 // Start lowering
20602060 mlir::Value zero = firOpBuilder.createIntegerConstant (loc, loopVarType, 0 );
20612061 mlir::Value one = firOpBuilder.createIntegerConstant (loc, loopVarType, 1 );
2062- mlir::Value isDownwards = firOpBuilder. create < mlir::arith::CmpIOp> (
2063- loc, mlir::arith::CmpIPredicate::slt, loopStepVar, zero);
2062+ mlir::Value isDownwards = mlir::arith::CmpIOp::create (
2063+ firOpBuilder, loc, mlir::arith::CmpIPredicate::slt, loopStepVar, zero);
20642064
20652065 // Ensure we are counting upwards. If not, negate step and swap lb and ub.
20662066 mlir::Value negStep =
2067- firOpBuilder. create < mlir::arith::SubIOp>( loc, zero, loopStepVar);
2068- mlir::Value incr = firOpBuilder. create < mlir::arith::SelectOp> (
2069- loc, isDownwards, negStep, loopStepVar);
2070- mlir::Value lb = firOpBuilder. create < mlir::arith::SelectOp> (
2071- loc, isDownwards, loopUBVar, loopLBVar);
2072- mlir::Value ub = firOpBuilder. create < mlir::arith::SelectOp> (
2073- loc, isDownwards, loopLBVar, loopUBVar);
2067+ mlir::arith::SubIOp::create (firOpBuilder, loc, zero, loopStepVar);
2068+ mlir::Value incr = mlir::arith::SelectOp::create (
2069+ firOpBuilder, loc, isDownwards, negStep, loopStepVar);
2070+ mlir::Value lb = mlir::arith::SelectOp::create (
2071+ firOpBuilder, loc, isDownwards, loopUBVar, loopLBVar);
2072+ mlir::Value ub = mlir::arith::SelectOp::create (
2073+ firOpBuilder, loc, isDownwards, loopLBVar, loopUBVar);
20742074
20752075 // Compute the trip count assuming lb <= ub. This guarantees that the result
20762076 // is non-negative and we can use unsigned arithmetic.
2077- mlir::Value span = firOpBuilder. create < mlir::arith::SubIOp> (
2078- loc, ub, lb, ::mlir::arith::IntegerOverflowFlags::nuw);
2077+ mlir::Value span = mlir::arith::SubIOp::create (
2078+ firOpBuilder, loc, ub, lb, ::mlir::arith::IntegerOverflowFlags::nuw);
20792079 mlir::Value tcMinusOne =
2080- firOpBuilder.create <mlir::arith::DivUIOp>(loc, span, incr);
2081- mlir::Value tcIfLooping = firOpBuilder.create <mlir::arith::AddIOp>(
2082- loc, tcMinusOne, one, ::mlir::arith::IntegerOverflowFlags::nuw);
2080+ mlir::arith::DivUIOp::create (firOpBuilder, loc, span, incr);
2081+ mlir::Value tcIfLooping =
2082+ mlir::arith::AddIOp::create (firOpBuilder, loc, tcMinusOne, one,
2083+ ::mlir::arith::IntegerOverflowFlags::nuw);
20832084
20842085 // Fall back to 0 if lb > ub
2085- mlir::Value isZeroTC = firOpBuilder. create < mlir::arith::CmpIOp> (
2086- loc, mlir::arith::CmpIPredicate::slt, ub, lb);
2087- mlir::Value tripcount = firOpBuilder. create < mlir::arith::SelectOp> (
2088- loc, isZeroTC, zero, tcIfLooping);
2086+ mlir::Value isZeroTC = mlir::arith::CmpIOp::create (
2087+ firOpBuilder, loc, mlir::arith::CmpIPredicate::slt, ub, lb);
2088+ mlir::Value tripcount = mlir::arith::SelectOp::create (
2089+ firOpBuilder, loc, isZeroTC, zero, tcIfLooping);
20892090 tripcounts.push_back (tripcount);
20902091
20912092 // Create the CLI handle.
2092- auto newcli = firOpBuilder. create < mlir::omp::NewCliOp>( loc);
2093+ auto newcli = mlir::omp::NewCliOp::create (firOpBuilder, loc);
20932094 mlir::Value cli = newcli.getResult ();
20942095 clis.push_back (cli);
20952096
@@ -2122,10 +2123,10 @@ static void genCanonicalLoopNest(
21222123 " Expecting all block args to have been collected by now" );
21232124 for (auto j : llvm::seq<size_t >(numLoops)) {
21242125 mlir::Value natIterNum = fir::getBase (blockArgs[j]);
2125- mlir::Value scaled = firOpBuilder. create < mlir::arith::MulIOp> (
2126- loc, natIterNum, loopStepVars[j]);
2127- mlir::Value userVal = firOpBuilder. create < mlir::arith::AddIOp> (
2128- loc, loopLBVars[j], scaled);
2126+ mlir::Value scaled = mlir::arith::MulIOp::create (
2127+ firOpBuilder, loc, natIterNum, loopStepVars[j]);
2128+ mlir::Value userVal = mlir::arith::AddIOp::create (
2129+ firOpBuilder, loc, loopLBVars[j], scaled);
21292130
21302131 mlir::OpBuilder::InsertPoint insPt =
21312132 firOpBuilder.saveInsertionPoint ();
@@ -2198,9 +2199,9 @@ static void genTileOp(Fortran::lower::AbstractConverter &converter,
21982199 gridGeneratees.reserve (numLoops);
21992200 intratileGeneratees.reserve (numLoops);
22002201 for ([[maybe_unused]] auto i : llvm::seq<int >(0 , sizesClause.sizes .size ())) {
2201- auto gridCLI = firOpBuilder. create < mlir::omp::NewCliOp>( loc);
2202+ auto gridCLI = mlir::omp::NewCliOp::create (firOpBuilder, loc);
22022203 gridGeneratees.push_back (gridCLI.getResult ());
2203- auto intratileCLI = firOpBuilder. create < mlir::omp::NewCliOp>( loc);
2204+ auto intratileCLI = mlir::omp::NewCliOp::create (firOpBuilder, loc);
22042205 intratileGeneratees.push_back (intratileCLI.getResult ());
22052206 }
22062207
@@ -2209,8 +2210,8 @@ static void genTileOp(Fortran::lower::AbstractConverter &converter,
22092210 generatees.append (gridGeneratees);
22102211 generatees.append (intratileGeneratees);
22112212
2212- firOpBuilder. create < mlir::omp::TileOp>( loc, generatees, applyees,
2213- sizesClause.sizes );
2213+ mlir::omp::TileOp::create (firOpBuilder, loc, generatees, applyees,
2214+ sizesClause.sizes );
22142215}
22152216
22162217static void genUnrollOp (Fortran::lower::AbstractConverter &converter,
0 commit comments