catalyst
catalyst copied to clipboard
Fix Enzyme pass check and add `replace_ir_from_file` helper
Context:
In the compiler driver, we only check if there is any GradientOpInterface for enzyme. However, it only works for early mlir levels with replace_ir. This PR moves the check to the llvm level and detects any __enzyme_* functions.
The PR also adds an extra helper replace_ir_from_file to read the replacement ir from file.