This pattern used to create an `llvm.func` op, then check additional
requirements and return "failure". This commit moves the checks before
the creation of the replacement op, so that no rollback is necessary
when one of the checks fails.
Note: This is in preparation of the One-Shot Dialect Conversion
refactoring, which removes the rollback functionality.