@@ -50,58 +50,40 @@ def FastmathFlagsInterface : OpInterface<"FastmathFlagsInterface"> {
5050
5151def IntegerOverflowFlagsInterface : OpInterface<"IntegerOverflowFlagsInterface"> {
5252 let description = [{
53- Access to op integer overflow flags.
53+ This interface defines an LLVM operation with integer overflow flags and
54+ provides a uniform API for accessing them.
5455 }];
5556
5657 let cppNamespace = "::mlir::LLVM";
5758
5859 let methods = [
59- InterfaceMethod<
60- /*desc=*/ "Returns an IntegerOverflowFlagsAttr attribute for the operation",
61- /*returnType=*/ "IntegerOverflowFlagsAttr",
62- /*methodName=*/ "getOverflowAttr",
63- /*args=*/ (ins),
64- /*methodBody=*/ [{}],
65- /*defaultImpl=*/ [{
66- auto op = cast<ConcreteOp>(this->getOperation());
67- return op.getOverflowFlagsAttr();
68- }]
69- >,
70- InterfaceMethod<
71- /*desc=*/ "Returns whether the operation has the No Unsigned Wrap keyword",
72- /*returnType=*/ "bool",
73- /*methodName=*/ "hasNoUnsignedWrap",
74- /*args=*/ (ins),
75- /*methodBody=*/ [{}],
76- /*defaultImpl=*/ [{
77- auto op = cast<ConcreteOp>(this->getOperation());
78- IntegerOverflowFlags flags = op.getOverflowFlagsAttr().getValue();
79- return bitEnumContainsAll(flags, IntegerOverflowFlags::nuw);
80- }]
81- >,
82- InterfaceMethod<
83- /*desc=*/ "Returns whether the operation has the No Signed Wrap keyword",
84- /*returnType=*/ "bool",
85- /*methodName=*/ "hasNoSignedWrap",
86- /*args=*/ (ins),
87- /*methodBody=*/ [{}],
88- /*defaultImpl=*/ [{
89- auto op = cast<ConcreteOp>(this->getOperation());
90- IntegerOverflowFlags flags = op.getOverflowFlagsAttr().getValue();
91- return bitEnumContainsAll(flags, IntegerOverflowFlags::nsw);
92- }]
93- >,
94- StaticInterfaceMethod<
95- /*desc=*/ [{Returns the name of the IntegerOverflowFlagsAttr attribute
96- for the operation}],
97- /*returnType=*/ "StringRef",
98- /*methodName=*/ "getIntegerOverflowAttrName",
99- /*args=*/ (ins),
100- /*methodBody=*/ [{}],
101- /*defaultImpl=*/ [{
102- return "overflowFlags";
103- }]
104- >
60+ InterfaceMethod<[{
61+ Get the integer overflow flags for the operation.
62+ }], "IntegerOverflowFlags", "getOverflowFlags", (ins), [{}], [{
63+ return $_op.getProperties().overflowFlags;
64+ }]>,
65+ InterfaceMethod<[{
66+ Set the integer overflow flags for the operation.
67+ }], "void", "setOverflowFlags", (ins "IntegerOverflowFlags":$flags), [{}], [{
68+ $_op.getProperties().overflowFlags = flags;
69+ }]>,
70+ InterfaceMethod<[{
71+ Returns whether the operation has the No Unsigned Wrap keyword.
72+ }], "bool", "hasNoUnsignedWrap", (ins), [{}], [{
73+ return bitEnumContainsAll($_op.getOverflowFlags(),
74+ IntegerOverflowFlags::nuw);
75+ }]>,
76+ InterfaceMethod<[{
77+ Returns whether the operation has the No Signed Wrap keyword.
78+ }], "bool", "hasNoSignedWrap", (ins), [{}], [{
79+ return bitEnumContainsAll($_op.getOverflowFlags(),
80+ IntegerOverflowFlags::nsw);
81+ }]>,
82+ StaticInterfaceMethod<[{
83+ Get the attribute name of the overflow flags property.
84+ }], "StringRef", "getOverflowFlagsAttrName", (ins), [{}], [{
85+ return "overflowFlags";
86+ }]>,
10587 ];
10688}
10789
0 commit comments