// Some of these are temporary pending inclusion into a more core dialect.
//===----------------------------------------------------------------------===//
-def fxpmath_ClampISOp : fxpmath_Op<"clampis", [NoSideEffect, SameValueType]> {
+def fxpmath_ClampISOp : fxpmath_Op<"clampis", [NoSideEffect, SameOperandsAndResultType]> {
let summary =
"Clamps a signed-integer like argument to a min/max range.";
let description = [{
def fxpmath_ConvertISOp :
fxpmath_Op<"convertis",
- [NoSideEffect, SameValueShape]> {
+ [NoSideEffect, SameOperandsAndResultShape]> {
let summary =
"Does an element-wise conversion from a signed integer to signed integer";
let description = [{
def fxpmath_ConvertISToFOp :
fxpmath_Op<"convertistof",
- [NoSideEffect, SameValueShape]> {
+ [NoSideEffect, SameOperandsAndResultShape]> {
let summary =
"Does an element-wise conversion from a signed integer to a float";
let description = [{
def fxpmath_VecScalarSaturatingRoundingDoublingHighMulISOp :
fxpmath_Op<"vs_saturating_rounding_doubling_high_mulis",
- [NoSideEffect, SameValueType]> {
+ [NoSideEffect, SameOperandsAndResultType]> {
let summary = "Implements equivalent functionality to ARMv7 NEON VQRDMULH";
let description = [{
Equivalent to the ARMv7 NEON VQRDMULH instruction.
}
def fxpmath_RoundingDivideByPotISOp :
- fxpmath_Op<"rounding_divide_by_potis", [NoSideEffect, SameValueType]> {
+ fxpmath_Op<"rounding_divide_by_potis", [NoSideEffect, SameOperandsAndResultType]> {
let summary = [{
Computes a rounding arithmetic right shift.
}];
//===----------------------------------------------------------------------===//
def quant_ConstFakeQuant : quant_Op<"const_fake_quant",
- [SameValueType, NoSideEffect]> {
+ [SameOperandsAndResultType, NoSideEffect]> {
let summary =
"Simulates the effect of uniform quantization with const range.";
);
}
-def quant_StatisticsRefOp : quant_Op<"stats_ref", [SameValueType]> {
+def quant_StatisticsRefOp : quant_Op<"stats_ref", [SameOperandsAndResultType]> {
let summary =
"Indicates that statistics are resolved by reference.";
let results = (outs quant_RealValueType);
}
-def quant_StatisticsOp : quant_Op<"stats", [SameValueType]> {
+def quant_StatisticsOp : quant_Op<"stats", [SameOperandsAndResultType]> {
let summary =
"Identity op which associates statistics with the value.";
}];
}
-def quant_CoupledRefOp : quant_Op<"coupled_ref", [SameValueType]> {
+def quant_CoupledRefOp : quant_Op<"coupled_ref", [SameOperandsAndResultType]> {
let summary =
"Indicates that one point of the computation is coupled to another.";
// X op Y == Y op X
def Commutative : NativeOpTrait<"IsCommutative">;
// Op results are float or vectors/tensors thereof.
-def FloatLikeResults : NativeOpTrait<"ResultsAreFloatLike">;
+def ResultsAreFloatLike : NativeOpTrait<"ResultsAreFloatLike">;
// Op has no side effect.
def NoSideEffect : NativeOpTrait<"HasNoSideEffect">;
// Op has the same operand type.
-def SameOperandType : NativeOpTrait<"SameTypeOperands">;
+def SameTypeOperands : NativeOpTrait<"SameTypeOperands">;
// Op has same operand and result shape.
-def SameValueShape : NativeOpTrait<"SameOperandsAndResultShape">;
+def SameOperandsAndResultShape : NativeOpTrait<"SameOperandsAndResultShape">;
// Op has the same operand and result type.
-def SameValueType : NativeOpTrait<"SameOperandsAndResultType">;
+def SameOperandsAndResultType : NativeOpTrait<"SameOperandsAndResultType">;
// Op has the same operand and result element type.
def SameOperandsAndResultElementType :
NativeOpTrait<"SameOperandsAndResultElementType">;
class LLVM_ArithmeticOp<string mnemonic, string builderFunc,
list<OpTrait> traits = []> :
LLVM_OneResultOp<mnemonic,
- !listconcat([NoSideEffect, SameValueType], traits)>,
+ !listconcat([NoSideEffect, SameOperandsAndResultType], traits)>,
Arguments<(ins LLVM_Type:$lhs, LLVM_Type:$rhs)>,
LLVM_Builder<"$res = builder." # builderFunc # "($lhs, $rhs);"> {
let parser = [{ return impl::parseBinaryOp(parser, result); }];
class SPV_Op<string mnemonic, list<OpTrait> traits = []> :
Op<SPV_Dialect, mnemonic, traits>;
-def SPV_FMulOp : SPV_Op<"FMul", [NoSideEffect, SameValueType]> {
+def SPV_FMulOp : SPV_Op<"FMul", [NoSideEffect, SameOperandsAndResultType]> {
let summary = "Floating-point multiplication of Operand 1 and Operand 2";
let description = [{
// types. Individual classes will have `lhs` and `rhs` accessor to operands.
class ArithmeticOp<string mnemonic, list<OpTrait> traits = []> :
Op<Std_Dialect, mnemonic,
- !listconcat(traits, [NoSideEffect, SameValueType])> {
+ !listconcat(traits, [NoSideEffect, SameOperandsAndResultType])> {
let results = (outs AnyType);
let hasCanonicalizer = 1;
}
-def CmpIOp : Std_Op<"cmpi", [NoSideEffect, SameOperandType, SameValueShape]> {
+def CmpIOp : Std_Op<"cmpi", [NoSideEffect, SameTypeOperands, SameOperandsAndResultShape]> {
let summary = "integer comparison operation";
let description = [{
The "cmpi" operation compares its two operands according to the integer
let hasFolder = 1;
}
-def CmpFOp : Std_Op<"cmpf", [NoSideEffect, SameOperandType, SameValueShape]> {
+def CmpFOp : Std_Op<"cmpf", [NoSideEffect, SameTypeOperands, SameOperandsAndResultShape]> {
let summary = "floating-point comparison operation";
let description = [{
The "cmpf" operation compares its two operands according to the float
>];
}
-def SelectOp : Std_Op<"select", [NoSideEffect, SameValueShape]> {
+def SelectOp : Std_Op<"select", [NoSideEffect, SameOperandsAndResultShape]> {
let summary = "select operation";
let description = [{
The "select" operation chooses one value based on a binary condition
}
def SameOperandAndResultShapeOp : TEST_Op<"same_operand_and_result_shape",
- [SameValueShape]> {
+ [SameOperandsAndResultShape]> {
let arguments = (ins AnyVectorOrTensor:$x, AnyVectorOrTensor:$y);
let results = (outs AnyVectorOrTensor:$res);
}
// CHECK: if (!((this->getOperation()->getResult(0)->getType().isInteger(32))))
// CHECK-NEXT: return emitOpError("result #0 must be 32-bit integer");
-def OpB : NS_Op<"same_input_output_type_op", [SameValueType]> {
+def OpB : NS_Op<"same_input_output_type_op", [SameOperandsAndResultType]> {
let arguments = (ins I32:$x);
let results = (outs I32:$y);
}
// Test that if the only operand is variadic, we acess the first value in the
// pack to set result type
// ---
-def OpK : NS_Op<"only_input_is_variadic_with_same_value_type_op", [SameValueType]> {
+def OpK : NS_Op<"only_input_is_variadic_with_same_value_type_op", [SameOperandsAndResultType]> {
let arguments = (ins Variadic<AnyTensor>:$input);
let results = (outs AnyTensor:$result);
}
// Then we build the new op corresponding to this DAG node.
- bool isSameValueType = resultOp.hasTrait("SameOperandsAndResultType");
+ bool isSameOperandsAndResultType =
+ resultOp.hasTrait("SameOperandsAndResultType");
bool isBroadcastable = resultOp.hasTrait("BroadcastableTwoOperandsOneResult");
bool useFirstAttr = resultOp.hasTrait("FirstAttrDerivedResultType");
- if (isSameValueType || isBroadcastable || useFirstAttr || depth > 0) {
+ if (isSameOperandsAndResultType || isBroadcastable || useFirstAttr ||
+ depth > 0) {
os.indent(4) << formatv("auto {0} = rewriter.create<{1}>(loc", resultValue,
resultOp.getQualCppClassName());
} else {