@@ -394,9 +394,9 @@ struct WhileLowering : public OpConversionPattern<WhileOp> {
394394 if (!convertedType)
395395 return rewriter.notifyMatchFailure (whileOp, " type conversion failed" );
396396
397- emitc::VariableOp var = rewriter. create < emitc::VariableOp> (
398- loc, emitc::LValueType::get (convertedType), noInit);
399- rewriter. create < emitc::AssignOp>( loc, var.getResult (), init);
397+ auto var = emitc::VariableOp::create (
398+ rewriter, loc, emitc::LValueType::get (convertedType), noInit);
399+ emitc::AssignOp::create (rewriter, loc, var.getResult (), init);
400400 loopVars.push_back (var);
401401 }
402402
@@ -411,11 +411,11 @@ struct WhileLowering : public OpConversionPattern<WhileOp> {
411411 // Create a global boolean variable to store the loop condition state.
412412 Type i1Type = IntegerType::get (context, 1 );
413413 auto globalCondition =
414- rewriter. create < emitc::VariableOp>( loc, emitc::LValueType::get (i1Type),
415- emitc::OpaqueAttr::get (context, " " ));
414+ emitc::VariableOp::create (rewriter, loc, emitc::LValueType::get (i1Type),
415+ emitc::OpaqueAttr::get (context, " " ));
416416 Value conditionVal = globalCondition.getResult ();
417417
418- auto loweredDo = rewriter. create < emitc::DoOp>( loc);
418+ auto loweredDo = emitc::DoOp::create (rewriter, loc);
419419
420420 // Convert region types to match the target dialect type system.
421421 if (failed (rewriter.convertRegionTypes (&whileOp.getBefore (),
@@ -450,12 +450,12 @@ struct WhileLowering : public OpConversionPattern<WhileOp> {
450450
451451 // Convert scf.condition to condition variable assignment.
452452 Value condition = rewriter.getRemappedValue (condOp.getCondition ());
453- rewriter. create < emitc::AssignOp>( loc, conditionVal, condition);
453+ emitc::AssignOp::create (rewriter, loc, conditionVal, condition);
454454
455455 // Wrap body region in conditional to preserve scf semantics. Only create
456456 // ifOp if after-region is non-empty.
457457 if (whileOp.getAfterBody ()->getOperations ().size () > 1 ) {
458- auto ifOp = rewriter. create < emitc::IfOp>( loc, condition, false , false );
458+ auto ifOp = emitc::IfOp::create (rewriter, loc, condition, false , false );
459459
460460 // Prepare the after region (loop body) for merging.
461461 Block *afterBlock = &whileOp.getAfter ().front ();
@@ -480,8 +480,8 @@ struct WhileLowering : public OpConversionPattern<WhileOp> {
480480 Block *condBlock = rewriter.createBlock (&condRegion);
481481 rewriter.setInsertionPointToStart (condBlock);
482482
483- auto exprOp = rewriter. create < emitc::ExpressionOp> (
484- loc, i1Type, conditionVal, /* do_not_inline=*/ false );
483+ auto exprOp = emitc::ExpressionOp::create (
484+ rewriter, loc, i1Type, conditionVal, /* do_not_inline=*/ false );
485485 Block *exprBlock = rewriter.createBlock (&exprOp.getBodyRegion ());
486486
487487 // Set up the expression block to load the condition variable.
@@ -490,12 +490,12 @@ struct WhileLowering : public OpConversionPattern<WhileOp> {
490490
491491 // Load the condition value and yield it as the expression result.
492492 Value cond =
493- rewriter. create < emitc::LoadOp>( loc, i1Type, exprBlock->getArgument (0 ));
494- rewriter. create < emitc::YieldOp>( loc, cond);
493+ emitc::LoadOp::create (rewriter, loc, i1Type, exprBlock->getArgument (0 ));
494+ emitc::YieldOp::create (rewriter, loc, cond);
495495
496496 // Yield the expression as the condition region result.
497497 rewriter.setInsertionPointToEnd (condBlock);
498- rewriter. create < emitc::YieldOp>( loc, exprOp);
498+ emitc::YieldOp::create (rewriter, loc, exprOp);
499499
500500 return success ();
501501 }
0 commit comments