@@ -53,7 +53,7 @@ class LLVM_IntArithmeticOp<string mnemonic, string instName,
53
53
LLVM_ArithmeticOpBase<AnySignlessInteger, mnemonic, instName, traits> {
54
54
let arguments = commonArgs;
55
55
string mlirBuilder = [{
56
- $res = $_builder.create<$ _qualCppClassName>( $_location, $lhs, $rhs);
56
+ $res = $_qualCppClassName::create($_builder, $_location, $lhs, $rhs);
57
57
}];
58
58
}
59
59
class LLVM_IntArithmeticOpWithOverflowFlag<string mnemonic, string instName,
@@ -64,7 +64,7 @@ class LLVM_IntArithmeticOpWithOverflowFlag<string mnemonic, string instName,
64
64
let arguments = !con(commonArgs, iofArg);
65
65
66
66
string mlirBuilder = [{
67
- auto op = $_builder.create<$ _qualCppClassName>( $_location, $lhs, $rhs);
67
+ auto op = $_qualCppClassName::create($_builder, $_location, $lhs, $rhs);
68
68
moduleImport.setIntegerOverflowFlags(inst, op);
69
69
$res = op;
70
70
}];
@@ -82,7 +82,7 @@ class LLVM_IntArithmeticOpWithExactFlag<string mnemonic, string instName,
82
82
let arguments = !con(commonArgs, (ins UnitAttr:$isExact));
83
83
84
84
string mlirBuilder = [{
85
- auto op = $_builder.create<$ _qualCppClassName>( $_location, $lhs, $rhs);
85
+ auto op = $_qualCppClassName::create($_builder, $_location, $lhs, $rhs);
86
86
moduleImport.setExactFlag(inst, op);
87
87
$res = op;
88
88
}];
@@ -100,7 +100,7 @@ class LLVM_IntArithmeticOpWithDisjointFlag<string mnemonic, string instName,
100
100
let arguments = !con(commonArgs, (ins UnitAttr:$isDisjoint));
101
101
102
102
string mlirBuilder = [{
103
- auto op = $_builder.create<$ _qualCppClassName>( $_location, $lhs, $rhs);
103
+ auto op = $_qualCppClassName::create($_builder, $_location, $lhs, $rhs);
104
104
moduleImport.setDisjointFlag(inst, op);
105
105
$res = op;
106
106
}];
@@ -121,7 +121,7 @@ class LLVM_FloatArithmeticOp<string mnemonic, string instName,
121
121
ins DefaultValuedAttr<LLVM_FastmathFlagsAttr, "{}">:$fastmathFlags);
122
122
let arguments = !con(commonArgs, fmfArg);
123
123
string mlirBuilder = [{
124
- auto op = $_builder.create<$ _qualCppClassName>( $_location, $lhs, $rhs);
124
+ auto op = $_qualCppClassName::create($_builder, $_location, $lhs, $rhs);
125
125
moduleImport.setFastmathFlagsAttr(inst, op);
126
126
$res = op;
127
127
}];
@@ -141,7 +141,7 @@ class LLVM_UnaryFloatArithmeticOp<Type type, string mnemonic,
141
141
let assemblyFormat = "$operand attr-dict `:` type($res)";
142
142
string llvmInstName = instName;
143
143
string mlirBuilder = [{
144
- auto op = $_builder.create<$ _qualCppClassName>( $_location, $operand);
144
+ auto op = $_qualCppClassName::create($_builder, $_location, $operand);
145
145
moduleImport.setFastmathFlagsAttr(inst, op);
146
146
$res = op;
147
147
}];
@@ -193,7 +193,7 @@ def LLVM_ICmpOp : LLVM_ArithmeticCmpOp<"icmp", [Pure]> {
193
193
}];
194
194
string mlirBuilder = [{
195
195
auto *iCmpInst = cast<llvm::ICmpInst>(inst);
196
- $res = $_builder.create<$ _qualCppClassName>( $_location,
196
+ $res = $_qualCppClassName::create($_builder, $_location,
197
197
convertICmpPredicateFromLLVM(iCmpInst->getPredicate()), $lhs, $rhs);
198
198
}];
199
199
// Set the $predicate index to -1 to indicate there is no matching operand
@@ -217,7 +217,7 @@ def LLVM_FCmpOp : LLVM_ArithmeticCmpOp<"fcmp", [
217
217
}];
218
218
string mlirBuilder = [{
219
219
auto *fCmpInst = cast<llvm::FCmpInst>(inst);
220
- auto op = $_builder.create<$ _qualCppClassName>(
220
+ auto op = $_qualCppClassName::create($_builder,
221
221
$_location, convertFCmpPredicateFromLLVM(fCmpInst->getPredicate()), $lhs, $rhs);
222
222
moduleImport.setFastmathFlagsAttr(inst, op);
223
223
$res = op;
@@ -261,7 +261,7 @@ def LLVM_AllocaOp : LLVM_Op<"alloca",
261
261
Type allocatedType =
262
262
moduleImport.convertType(allocaInst->getAllocatedType());
263
263
unsigned alignment = allocaInst->getAlign().value();
264
- $res = $_builder.create< LLVM::AllocaOp>(
264
+ $res = LLVM::AllocaOp::create($_builder,
265
265
$_location, $_resultType, $arraySize,
266
266
alignment == 0 ? IntegerAttr() : $_builder.getI64IntegerAttr(alignment),
267
267
allocatedType, allocaInst->isUsedWithInAlloca());
@@ -440,7 +440,7 @@ def LLVM_LoadOp : LLVM_MemAccessOpBase<"load",
440
440
string mlirBuilder = [{
441
441
auto *loadInst = cast<llvm::LoadInst>(inst);
442
442
unsigned alignment = loadInst->getAlign().value();
443
- $res = $_builder.create< LLVM::LoadOp>( $_location, $_resultType, $addr,
443
+ $res = LLVM::LoadOp::create($_builder, $_location, $_resultType, $addr,
444
444
alignment, loadInst->isVolatile(),
445
445
loadInst->hasMetadata(llvm::LLVMContext::MD_nontemporal),
446
446
loadInst->hasMetadata(llvm::LLVMContext::MD_invariant_load),
@@ -518,7 +518,7 @@ def LLVM_StoreOp : LLVM_MemAccessOpBase<"store",
518
518
string mlirBuilder = [{
519
519
auto *storeInst = cast<llvm::StoreInst>(inst);
520
520
unsigned alignment = storeInst->getAlign().value();
521
- $_op = $_builder.create< LLVM::StoreOp>( $_location, $value, $addr,
521
+ $_op = LLVM::StoreOp::create($_builder, $_location, $value, $addr,
522
522
alignment, storeInst->isVolatile(),
523
523
storeInst->hasMetadata(llvm::LLVMContext::MD_nontemporal),
524
524
storeInst->hasMetadata(llvm::LLVMContext::MD_invariant_group),
@@ -547,7 +547,7 @@ class LLVM_CastOp<string mnemonic, string instName, Type type,
547
547
let assemblyFormat = "$arg attr-dict `:` type($arg) `to` type($res)";
548
548
string llvmInstName = instName;
549
549
string mlirBuilder = [{
550
- $res = $_builder.create<$ _qualCppClassName>(
550
+ $res = $_qualCppClassName::create($_builder,
551
551
$_location, $_resultType, $arg);
552
552
}];
553
553
}
@@ -561,7 +561,7 @@ class LLVM_CastOpWithNNegFlag<string mnemonic, string instName, Type type,
561
561
let assemblyFormat = "(`nneg` $nonNeg^)? $arg attr-dict `:` type($arg) `to` type($res)";
562
562
string llvmInstName = instName;
563
563
string mlirBuilder = [{
564
- auto op = $_builder.create<$ _qualCppClassName>(
564
+ auto op = $_qualCppClassName::create($_builder,
565
565
$_location, $_resultType, $arg);
566
566
moduleImport.setNonNegFlag(inst, op);
567
567
$res = op;
@@ -578,7 +578,7 @@ class LLVM_CastOpWithOverflowFlag<string mnemonic, string instName, Type type,
578
578
let assemblyFormat = "$arg ($overflowFlags^)? attr-dict `:` type($arg) `to` type($res)";
579
579
string llvmInstName = instName;
580
580
string mlirBuilder = [{
581
- auto op = $_builder.create<$ _qualCppClassName>(
581
+ auto op = $_qualCppClassName::create($_builder,
582
582
$_location, $_resultType, $arg);
583
583
moduleImport.setIntegerOverflowFlags(inst, op);
584
584
$res = op;
@@ -602,7 +602,7 @@ class LLVM_DereferenceableCastOp<string mnemonic, string instName, Type type,
602
602
}
603
603
}];
604
604
string mlirBuilder = [{
605
- auto op = $_builder.create<$ _qualCppClassName>(
605
+ auto op = $_qualCppClassName::create($_builder,
606
606
$_location, $_resultType, $arg);
607
607
$res = op;
608
608
}];
@@ -725,7 +725,7 @@ def LLVM_VaArgOp : LLVM_Op<"va_arg"> {
725
725
726
726
string llvmInstName = "VAArg";
727
727
string mlirBuilder = [{
728
- $res = $_builder.create< mlir::LLVM::VaArgOp>(
728
+ $res = mlir::LLVM::VaArgOp::create($_builder,
729
729
$_location, $_resultType, $arg);
730
730
}];
731
731
}
@@ -847,7 +847,7 @@ def LLVM_ExtractElementOp : LLVM_Op<"extractelement", [Pure,
847
847
$res = builder.CreateExtractElement($vector, $position);
848
848
}];
849
849
string mlirBuilder = [{
850
- $res = $_builder.create< LLVM::ExtractElementOp>(
850
+ $res = LLVM::ExtractElementOp::create($_builder,
851
851
$_location, $vector, $position);
852
852
}];
853
853
}
@@ -881,7 +881,7 @@ def LLVM_ExtractValueOp : LLVM_Op<"extractvalue", [Pure]> {
881
881
}];
882
882
string mlirBuilder = [{
883
883
auto *evInst = cast<llvm::ExtractValueInst>(inst);
884
- $res = $_builder.create< LLVM::ExtractValueOp>( $_location,
884
+ $res = LLVM::ExtractValueOp::create($_builder, $_location,
885
885
$container, getPositionFromIndices(evInst->getIndices()));
886
886
}];
887
887
}
@@ -913,7 +913,7 @@ def LLVM_InsertElementOp : LLVM_Op<"insertelement", [Pure,
913
913
$res = builder.CreateInsertElement($vector, $value, $position);
914
914
}];
915
915
string mlirBuilder = [{
916
- $res = $_builder.create< LLVM::InsertElementOp>(
916
+ $res = LLVM::InsertElementOp::create($_builder,
917
917
$_location, $vector, $value, $position);
918
918
}];
919
919
}
@@ -945,7 +945,7 @@ def LLVM_InsertValueOp : LLVM_Op<
945
945
}];
946
946
string mlirBuilder = [{
947
947
auto *ivInst = cast<llvm::InsertValueInst>(inst);
948
- $res = $_builder.create< LLVM::InsertValueOp>( $_location,
948
+ $res = LLVM::InsertValueOp::create($_builder, $_location,
949
949
$container, $value, getPositionFromIndices(ivInst->getIndices()));
950
950
}];
951
951
}
@@ -982,7 +982,7 @@ def LLVM_ShuffleVectorOp : LLVM_Op<"shufflevector",
982
982
string mlirBuilder = [{
983
983
auto *svInst = cast<llvm::ShuffleVectorInst>(inst);
984
984
SmallVector<int32_t> mask(svInst->getShuffleMask());
985
- $res = $_builder.create< LLVM::ShuffleVectorOp>(
985
+ $res = LLVM::ShuffleVectorOp::create($_builder,
986
986
$_location, $v1, $v2, mask);
987
987
}];
988
988
}
@@ -1003,7 +1003,7 @@ def LLVM_SelectOp
1003
1003
let assemblyFormat = "operands attr-dict `:` type($condition) `,` type($res)";
1004
1004
string llvmInstName = "Select";
1005
1005
string mlirBuilder = [{
1006
- auto op = $_builder.create< LLVM::SelectOp>(
1006
+ auto op = LLVM::SelectOp::create($_builder,
1007
1007
$_location, $_resultType, $condition, $trueValue, $falseValue);
1008
1008
moduleImport.setFastmathFlagsAttr(inst, op);
1009
1009
$res = op;
@@ -1017,7 +1017,7 @@ def LLVM_FreezeOp : LLVM_Op<"freeze", [Pure, SameOperandsAndResultType]> {
1017
1017
string llvmInstName = "Freeze";
1018
1018
string llvmBuilder = "$res = builder.CreateFreeze($val);";
1019
1019
string mlirBuilder = [{
1020
- $res = $_builder.create< LLVM::FreezeOp>( $_location, $val);
1020
+ $res = LLVM::FreezeOp::create($_builder, $_location, $val);
1021
1021
}];
1022
1022
}
1023
1023
@@ -1108,7 +1108,7 @@ def LLVM_ReturnOp : LLVM_TerminatorOp<"return", [Pure, ReturnLike]> {
1108
1108
moduleImport.convertValues(llvmOperands);
1109
1109
if (failed(mlirOperands))
1110
1110
return failure();
1111
- $_op = $_builder.create< LLVM::ReturnOp>( $_location, *mlirOperands);
1111
+ $_op = LLVM::ReturnOp::create($_builder, $_location, *mlirOperands);
1112
1112
}];
1113
1113
}
1114
1114
@@ -1120,15 +1120,15 @@ def LLVM_ResumeOp : LLVM_TerminatorOp<"resume"> {
1120
1120
string llvmInstName = "Resume";
1121
1121
string llvmBuilder = [{ builder.CreateResume($value); }];
1122
1122
string mlirBuilder = [{
1123
- $_op = $_builder.create< LLVM::ResumeOp>( $_location, $value);
1123
+ $_op = LLVM::ResumeOp::create($_builder, $_location, $value);
1124
1124
}];
1125
1125
}
1126
1126
def LLVM_UnreachableOp : LLVM_TerminatorOp<"unreachable"> {
1127
1127
let assemblyFormat = "attr-dict";
1128
1128
string llvmInstName = "Unreachable";
1129
1129
string llvmBuilder = [{ builder.CreateUnreachable(); }];
1130
1130
string mlirBuilder = [{
1131
- $_op = $_builder.create< LLVM::UnreachableOp>( $_location);
1131
+ $_op = LLVM::UnreachableOp::create($_builder, $_location);
1132
1132
}];
1133
1133
}
1134
1134
@@ -2256,7 +2256,7 @@ def LLVM_AtomicRMWOp : LLVM_MemAccessOpBase<"atomicrmw", [
2256
2256
string mlirBuilder = [{
2257
2257
auto *atomicInst = cast<llvm::AtomicRMWInst>(inst);
2258
2258
unsigned alignment = atomicInst->getAlign().value();
2259
- $res = $_builder.create< LLVM::AtomicRMWOp>( $_location,
2259
+ $res = LLVM::AtomicRMWOp::create($_builder, $_location,
2260
2260
convertAtomicBinOpFromLLVM(atomicInst->getOperation()), $ptr, $val,
2261
2261
convertAtomicOrderingFromLLVM(atomicInst->getOrdering()),
2262
2262
getLLVMSyncScope(atomicInst), alignment, atomicInst->isVolatile());
@@ -2311,7 +2311,7 @@ def LLVM_AtomicCmpXchgOp : LLVM_MemAccessOpBase<"cmpxchg", [
2311
2311
string mlirBuilder = [{
2312
2312
auto *cmpXchgInst = cast<llvm::AtomicCmpXchgInst>(inst);
2313
2313
unsigned alignment = cmpXchgInst->getAlign().value();
2314
- $res = $_builder.create< LLVM::AtomicCmpXchgOp>(
2314
+ $res = LLVM::AtomicCmpXchgOp::create($_builder,
2315
2315
$_location, $ptr, $cmp, $val,
2316
2316
convertAtomicOrderingFromLLVM(cmpXchgInst->getSuccessOrdering()),
2317
2317
convertAtomicOrderingFromLLVM(cmpXchgInst->getFailureOrdering()),
@@ -2340,7 +2340,7 @@ def LLVM_FenceOp : LLVM_Op<"fence">, LLVM_MemOpPatterns {
2340
2340
}] # setSyncScopeCode;
2341
2341
string mlirBuilder = [{
2342
2342
llvm::FenceInst *fenceInst = cast<llvm::FenceInst>(inst);
2343
- $_op = $_builder.create< LLVM::FenceOp>(
2343
+ $_op = LLVM::FenceOp::create($_builder,
2344
2344
$_location,
2345
2345
convertAtomicOrderingFromLLVM(fenceInst->getOrdering()),
2346
2346
getLLVMSyncScope(fenceInst));
0 commit comments