@@ -48,15 +48,15 @@ mlir::LLVM::ConstantOp ConvertFIRToLLVMPattern::genI32Constant(
4848 int value) const {
4949 mlir::Type i32Ty = rewriter.getI32Type ();
5050 mlir::IntegerAttr attr = rewriter.getI32IntegerAttr (value);
51- return rewriter. create < mlir::LLVM::ConstantOp>( loc, i32Ty, attr);
51+ return mlir::LLVM::ConstantOp::create (rewriter, loc, i32Ty, attr);
5252}
5353
5454mlir::LLVM::ConstantOp ConvertFIRToLLVMPattern::genConstantOffset (
5555 mlir::Location loc, mlir::ConversionPatternRewriter &rewriter,
5656 int offset) const {
5757 mlir::Type ity = lowerTy ().offsetType ();
5858 mlir::IntegerAttr cattr = rewriter.getI32IntegerAttr (offset);
59- return rewriter. create < mlir::LLVM::ConstantOp>( loc, ity, cattr);
59+ return mlir::LLVM::ConstantOp::create (rewriter, loc, ity, cattr);
6060}
6161
6262// / Perform an extension or truncation as needed on an integer value. Lowering
@@ -80,9 +80,9 @@ mlir::Value ConvertFIRToLLVMPattern::integerCast(
8080 return rewriter.createOrFold <mlir::LLVM::SExtOp>(loc, ty, val);
8181 } else {
8282 if (toSize < fromSize)
83- return rewriter. create < mlir::LLVM::TruncOp>( loc, ty, val);
83+ return mlir::LLVM::TruncOp::create (rewriter, loc, ty, val);
8484 if (toSize > fromSize)
85- return rewriter. create < mlir::LLVM::SExtOp>( loc, ty, val);
85+ return mlir::LLVM::SExtOp::create (rewriter, loc, ty, val);
8686 }
8787 return val;
8888}
@@ -100,16 +100,16 @@ mlir::Value ConvertFIRToLLVMPattern::getValueFromBox(
100100 mlir::ConversionPatternRewriter &rewriter, int boxValue) const {
101101 if (mlir::isa<mlir::LLVM::LLVMPointerType>(box.getType ())) {
102102 auto pty = getLlvmPtrType (resultTy.getContext ());
103- auto p = rewriter. create < mlir::LLVM::GEPOp> (
104- loc, pty, boxTy.llvm , box,
103+ auto p = mlir::LLVM::GEPOp::create (
104+ rewriter, loc, pty, boxTy.llvm , box,
105105 llvm::ArrayRef<mlir::LLVM::GEPArg>{0 , boxValue});
106106 auto fldTy = getBoxEleTy (boxTy.llvm , {boxValue});
107- auto loadOp = rewriter. create < mlir::LLVM::LoadOp>( loc, fldTy, p);
107+ auto loadOp = mlir::LLVM::LoadOp::create (rewriter, loc, fldTy, p);
108108 auto castOp = integerCast (loc, rewriter, resultTy, loadOp);
109109 attachTBAATag (loadOp, boxTy.fir , nullptr , p);
110110 return castOp;
111111 }
112- return rewriter. create < mlir::LLVM::ExtractValueOp>( loc, box, boxValue);
112+ return mlir::LLVM::ExtractValueOp::create (rewriter, loc, box, boxValue);
113113}
114114
115115// / Method to construct code sequence to get the triple for dimension `dim`
@@ -147,7 +147,7 @@ mlir::Value ConvertFIRToLLVMPattern::loadDimFieldFromBox(
147147 " in memory" );
148148 mlir::LLVM::GEPOp p = genGEP (loc, boxTy.llvm , rewriter, box, 0 ,
149149 static_cast <int >(kDimsPosInBox ), dim, off);
150- auto loadOp = rewriter. create < mlir::LLVM::LoadOp>( loc, ty, p);
150+ auto loadOp = mlir::LLVM::LoadOp::create (rewriter, loc, ty, p);
151151 attachTBAATag (loadOp, boxTy.fir , nullptr , p);
152152 return loadOp;
153153}
@@ -158,12 +158,13 @@ mlir::Value ConvertFIRToLLVMPattern::getDimFieldFromBox(
158158 if (mlir::isa<mlir::LLVM::LLVMPointerType>(box.getType ())) {
159159 mlir::LLVM::GEPOp p = genGEP (loc, boxTy.llvm , rewriter, box, 0 ,
160160 static_cast <int >(kDimsPosInBox ), dim, off);
161- auto loadOp = rewriter. create < mlir::LLVM::LoadOp>( loc, ty, p);
161+ auto loadOp = mlir::LLVM::LoadOp::create (rewriter, loc, ty, p);
162162 attachTBAATag (loadOp, boxTy.fir , nullptr , p);
163163 return loadOp;
164164 }
165- return rewriter.create <mlir::LLVM::ExtractValueOp>(
166- loc, box, llvm::ArrayRef<std::int64_t >{kDimsPosInBox , dim, off});
165+ return mlir::LLVM::ExtractValueOp::create (
166+ rewriter, loc, box,
167+ llvm::ArrayRef<std::int64_t >{kDimsPosInBox , dim, off});
167168}
168169
169170mlir::Value ConvertFIRToLLVMPattern::getStrideFromBox (
@@ -251,10 +252,10 @@ mlir::Value ConvertFIRToLLVMPattern::genBoxAttributeCheck(
251252 getValueFromBox (loc, boxTy, box, attrTy, rewriter, kAttributePosInBox );
252253 mlir::LLVM::ConstantOp attrMask = genConstantOffset (loc, rewriter, maskValue);
253254 auto maskRes =
254- rewriter. create < mlir::LLVM::AndOp>( loc, attrTy, attribute, attrMask);
255+ mlir::LLVM::AndOp::create (rewriter, loc, attrTy, attribute, attrMask);
255256 mlir::LLVM::ConstantOp c0 = genConstantOffset (loc, rewriter, 0 );
256- return rewriter. create < mlir::LLVM::ICmpOp>(loc, mlir::LLVM::ICmpPredicate::ne ,
257- maskRes, c0);
257+ return mlir::LLVM::ICmpOp::create (rewriter, loc ,
258+ mlir::LLVM::ICmpPredicate::ne, maskRes, c0);
258259}
259260
260261mlir::Value ConvertFIRToLLVMPattern::computeBoxSize (
@@ -281,10 +282,10 @@ mlir::Value ConvertFIRToLLVMPattern::computeBoxSize(
281282 firBoxType.getBoxTypeWithNewShape (1 )))) &&
282283 " descriptor layout requires adding padding for dim field" );
283284 mlir::Value sizePerDim = genConstantOffset (loc, rewriter, sizePerDimCst);
284- mlir::Value dimsSize = rewriter. create < mlir::LLVM::MulOp> (
285- loc, sizePerDim.getType (), sizePerDim, rank);
286- mlir::Value size = rewriter. create < mlir::LLVM::AddOp> (
287- loc, scalarBoxSize.getType (), scalarBoxSize, dimsSize);
285+ mlir::Value dimsSize = mlir::LLVM::MulOp::create (
286+ rewriter, loc, sizePerDim.getType (), sizePerDim, rank);
287+ mlir::Value size = mlir::LLVM::AddOp::create (
288+ rewriter, loc, scalarBoxSize.getType (), scalarBoxSize, dimsSize);
288289 return size;
289290}
290291
@@ -324,18 +325,19 @@ mlir::Value ConvertFIRToLLVMPattern::genAllocaAndAddrCastWithType(
324325 unsigned allocaAs = getAllocaAddressSpace (rewriter);
325326 unsigned programAs = getProgramAddressSpace (rewriter);
326327
327- mlir::Value al = rewriter. create < mlir::LLVM::AllocaOp> (
328- loc, ::getLlvmPtrType (llvmObjectTy.getContext (), allocaAs), llvmObjectTy ,
329- size, alignment);
328+ mlir::Value al = mlir::LLVM::AllocaOp::create (
329+ rewriter, loc, ::getLlvmPtrType (llvmObjectTy.getContext (), allocaAs),
330+ llvmObjectTy, size, alignment);
330331
331332 // if our allocation address space, is not the same as the program address
332333 // space, then we must emit a cast to the program address space before use.
333334 // An example case would be on AMDGPU, where the allocation address space is
334335 // the numeric value 5 (private), and the program address space is 0
335336 // (generic).
336337 if (allocaAs != programAs) {
337- al = rewriter.create <mlir::LLVM::AddrSpaceCastOp>(
338- loc, ::getLlvmPtrType (llvmObjectTy.getContext (), programAs), al);
338+ al = mlir::LLVM::AddrSpaceCastOp::create (
339+ rewriter, loc, ::getLlvmPtrType (llvmObjectTy.getContext (), programAs),
340+ al);
339341 }
340342
341343 rewriter.restoreInsertionPoint (thisPt);
0 commit comments