This commit introduces support for specific intrinsics imports to be
delayed after all instructions of a function were imported. This is
necesarry to import debug intrinsics correctly.
Debug intrinsics in LLVM are excluded from the define-before-use
invariant, i.e., they can reference SSA values that do not dominate
them. So far, we had implemented checks to stop the import of such
intrinsics, but there were always additional cases that were not
covered (the latest being terminators that define such used values).
To resolve this cleanly, the delayed intrinsic conversion functionality
is necessary. It allows the debug intrinsic conversion to place the
newly created MLIR operation in the correct place, while being certain
that the defining operation was already converted.
So far, this is only relevant for two LLVM debug intrinsics, that's
why the tablegen support was not added.
Returning ArrayRef here is imo a bit of a premature optimization where it doesn't really matter and raises a lot of questions about object lifetime. I'd prefer returning SmallVector<unsigned> to always be safe from stack-use-after-return.