9 #ifndef MLIR_CONVERSION_ARITHCOMMON_ATTRTOLLVMCONVERTER_H
10 #define MLIR_CONVERSION_ARITHCOMMON_ATTRTOLLVMCONVERTER_H
27 LLVM::FastmathFlagsAttr
31 LLVM::IntegerOverflowFlags
36 LLVM::IntegerOverflowFlagsAttr
42 template <
typename SourceOp,
typename TargetOp>
49 StringRef arithFMFAttrName = SourceOp::getFastMathAttrName();
51 auto arithFMFAttr = dyn_cast_if_present<arith::FastMathFlagsAttr>(
52 convertedAttr.
erase(arithFMFAttrName));
54 StringRef targetAttrName = TargetOp::getFastmathAttrName();
55 convertedAttr.
set(targetAttrName,
69 template <
typename SourceOp,
typename TargetOp>
76 StringRef arithAttrName = SourceOp::getIntegerOverflowAttrName();
78 auto arithAttr = dyn_cast_if_present<arith::IntegerOverflowFlagsAttr>(
79 convertedAttr.
erase(arithAttrName));
81 StringRef targetAttrName = TargetOp::getIntegerOverflowAttrName();
82 convertedAttr.
set(targetAttrName,
NamedAttrList is array of NamedAttributes that tracks whether it is sorted and does some basic work t...
ArrayRef< NamedAttribute > getAttrs() const
Return all of the attributes on this operation.
Attribute erase(StringAttr name)
Erase the attribute with the given name from the list.
Attribute set(StringAttr name, Attribute value)
If the an attribute exists with the specified name, change it to the new value.
ArrayRef< NamedAttribute > getAttrs() const
AttrConvertFastMathToLLVM(SourceOp srcOp)
AttrConvertOverflowToLLVM(SourceOp srcOp)
ArrayRef< NamedAttribute > getAttrs() const
LLVM::IntegerOverflowFlagsAttr convertArithOverflowAttrToLLVM(arith::IntegerOverflowFlagsAttr flagsAttr)
Creates an LLVM overflow attribute from a given arithmetic overflow attribute.
LLVM::FastmathFlagsAttr convertArithFastMathAttrToLLVM(arith::FastMathFlagsAttr fmfAttr)
Creates an LLVM fastmath attribute from a given arithmetic fastmath attribute.
LLVM::IntegerOverflowFlags convertArithOverflowFlagsToLLVM(arith::IntegerOverflowFlags arithFlags)
Maps arithmetic overflow enum values to LLVM enum values.
LLVM::FastmathFlags convertArithFastMathFlagsToLLVM(arith::FastMathFlags arithFMF)
Maps arithmetic fastmath enum values to LLVM enum values.
Include the generated interface declarations.