[mlir][llvm] Fastmath flags import from LLVM IR.
This revision adds support to import fastmath flags from LLVMIR. It implement the import using a listener attached to the builder. The listener gets notified if an operation is created and then checks if there are fastmath flags to import from LLVM IR to the MLIR. The listener based approach allows us to perform the import without changing the mlirBuilders used to create the imported operations. An alternative solution, could be to update the builders so that they return the created operation using FailureOr<Operation*> instead of LogicalResult. However, this solution implies an LLVM IR instruction always maps to exatly one MLIR operation. While mostly true, there are already exceptions to this such as the PHI instruciton. Additionally, an mlirBuilder based solution also further complicates the builder implementations, which led to the listener based solution. Depends on D139405 Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D139620
Loading
Please sign in to comment