@@ -1237,9 +1237,13 @@ def ShiftOp : CIR_Op<"shift", [Pure]> {
12371237 ```
12381238 }];
12391239
1240- let results = (outs CIR_AnyIntOrVecOfInt:$result);
1241- let arguments = (ins CIR_AnyIntOrVecOfInt:$value, CIR_AnyIntOrVecOfInt:$amount,
1242- UnitAttr:$isShiftleft);
1240+ let arguments = (ins
1241+ CIR_AnyIntOrVecOfIntType:$value,
1242+ CIR_AnyIntOrVecOfIntType:$amount,
1243+ UnitAttr:$isShiftleft
1244+ );
1245+
1246+ let results = (outs CIR_AnyIntOrVecOfIntType:$result);
12431247
12441248 let assemblyFormat = [{
12451249 `(`
@@ -3125,7 +3129,7 @@ def VecInsertOp : CIR_Op<"vec.insert", [Pure,
31253129
31263130 let arguments = (ins
31273131 CIR_VectorType:$vec,
3128- AnyType :$value,
3132+ CIR_VectorElementType :$value,
31293133 CIR_AnyFundamentalIntType:$index
31303134 );
31313135
@@ -3158,13 +3162,14 @@ def VecExtractOp : CIR_Op<"vec.extract", [Pure,
31583162 CIR_AnyFundamentalIntType:$index
31593163 );
31603164
3161- let results = (outs CIR_AnyType :$result);
3165+ let results = (outs CIR_VectorElementType :$result);
31623166
31633167 let assemblyFormat = [{
31643168 $vec `[` $index `:` type($index) `]` attr-dict `:` qualified(type($vec))
31653169 }];
31663170
31673171 let llvmOp = "ExtractElementOp";
3172+ let hasFolder = 1;
31683173}
31693174
31703175//===----------------------------------------------------------------------===//
@@ -3180,7 +3185,7 @@ def VecCreateOp : CIR_Op<"vec.create", [Pure]> {
31803185 in the vector type.
31813186 }];
31823187
3183- let arguments = (ins Variadic<CIR_AnyType >:$elements);
3188+ let arguments = (ins Variadic<CIR_VectorElementType >:$elements);
31843189 let results = (outs CIR_VectorType:$result);
31853190
31863191 let assemblyFormat = [{
@@ -3210,7 +3215,7 @@ def VecSplatOp : CIR_Op<"vec.splat", [Pure,
32103215 All elements of the vector have the same value, that of the given scalar.
32113216 }];
32123217
3213- let arguments = (ins CIR_AnyType :$value);
3218+ let arguments = (ins CIR_VectorElementType :$value);
32143219 let results = (outs CIR_VectorType:$result);
32153220
32163221 let assemblyFormat = [{
@@ -3263,8 +3268,13 @@ def VecTernaryOp : CIR_Op<"vec.ternary",
32633268 The result is a vector of the same type as the second and third arguments.
32643269 Each element of the result is `(bool)a[n] ? b[n] : c[n]`.
32653270 }];
3266- let arguments = (ins IntegerVector:$cond, CIR_VectorType:$vec1,
3267- CIR_VectorType:$vec2);
3271+
3272+ let arguments = (ins
3273+ CIR_VectorOfIntType:$cond,
3274+ CIR_VectorType:$vec1,
3275+ CIR_VectorType:$vec2
3276+ );
3277+
32683278 let results = (outs CIR_VectorType:$result);
32693279 let assemblyFormat = [{
32703280 `(` $cond `,` $vec1 `,` $vec2 `)` `:` qualified(type($cond)) `,`
@@ -3327,7 +3337,7 @@ def VecShuffleDynamicOp : CIR_Op<"vec.shuffle.dynamic",
33273337 result vector is constructed by taking the elements from the first input
33283338 vector from the indices indicated by the elements of the second vector.
33293339 }];
3330- let arguments = (ins CIR_VectorType:$vec, IntegerVector :$indices);
3340+ let arguments = (ins CIR_VectorType:$vec, CIR_VectorOfIntType :$indices);
33313341 let results = (outs CIR_VectorType:$result);
33323342 let assemblyFormat = [{
33333343 $vec `:` qualified(type($vec)) `,` $indices `:` qualified(type($indices))
@@ -4711,8 +4721,8 @@ def LLrintOp : UnaryFPToIntBuiltinOp<"llrint", "LlrintOp">;
47114721
47124722class UnaryFPToFPBuiltinOp<string mnemonic, string llvmOpName>
47134723 : CIR_Op<mnemonic, [Pure, SameOperandsAndResultType]> {
4714- let arguments = (ins CIR_AnyFloatOrVecOfFloat :$src);
4715- let results = (outs CIR_AnyFloatOrVecOfFloat :$result);
4724+ let arguments = (ins CIR_AnyFloatOrVecOfFloatType :$src);
4725+ let results = (outs CIR_AnyFloatOrVecOfFloatType :$result);
47164726 let summary = "libc builtin equivalent ignoring "
47174727 "floating point exceptions and errno";
47184728 let assemblyFormat = "$src `:` type($src) attr-dict";
@@ -4742,8 +4752,6 @@ def TanOp : UnaryFPToFPBuiltinOp<"tan", "TanOp">;
47424752def TruncOp : UnaryFPToFPBuiltinOp<"trunc", "FTruncOp">;
47434753
47444754def AbsOp : CIR_Op<"abs", [Pure, SameOperandsAndResultType]> {
4745- let arguments = (ins CIR_AnySignedIntOrVecOfSignedInt:$src, UnitAttr:$poison);
4746- let results = (outs CIR_AnySignedIntOrVecOfSignedInt:$result);
47474755 let summary = [{
47484756 libc builtin equivalent abs, labs, llabs
47494757
@@ -4759,6 +4767,14 @@ def AbsOp : CIR_Op<"abs", [Pure, SameOperandsAndResultType]> {
47594767 %2 = cir.abs %3 : !cir.vector<!s32i x 4>
47604768 ```
47614769 }];
4770+
4771+ let arguments = (ins
4772+ CIR_AnySIntOrVecOfSIntType:$src,
4773+ UnitAttr:$poison
4774+ );
4775+
4776+ let results = (outs CIR_AnySIntOrVecOfSIntType:$result);
4777+
47624778 let assemblyFormat = "$src ( `poison` $poison^ )? `:` type($src) attr-dict";
47634779}
47644780
@@ -4768,9 +4784,12 @@ class BinaryFPToFPBuiltinOp<string mnemonic, string llvmOpName>
47684784 libc builtin equivalent ignoring floating-point exceptions and errno.
47694785 }];
47704786
4771- let arguments = (ins CIR_AnyFloatOrVecOfFloat:$lhs,
4772- CIR_AnyFloatOrVecOfFloat:$rhs);
4773- let results = (outs CIR_AnyFloatOrVecOfFloat:$result);
4787+ let arguments = (ins
4788+ CIR_AnyFloatOrVecOfFloatType:$lhs,
4789+ CIR_AnyFloatOrVecOfFloatType:$rhs
4790+ );
4791+
4792+ let results = (outs CIR_AnyFloatOrVecOfFloatType:$result);
47744793
47754794 let assemblyFormat = [{
47764795 $lhs `,` $rhs `:` qualified(type($lhs)) attr-dict
0 commit comments