[Driver][SYCL] Update preprocessed file generation (#19849)
When generating preprocessed files for SYCL offloading, create a fully
packaged file that contains both the HOST and DEVICE binaries. This will
allow for consumption of these binary preprocessed files to be more
useful, as opposed to only being able to preprocess and keep the host
side of the offloading compilation
When the driver encounters preprocessed (file.ii) files on the command
line, these are processed in the following way:
- Determines if the file is a packaged file (offload binary)
- Extracts device side
- Compiles device side, packages generated device into offload binary
- Extracts host side
- Compiles host side, embedding device binary
Offload binary determination is performed by checking the magic number
associated with the input file. The extraction is done via the
clang-offload-packager using a new JobAction.
When no output file is given, we will not package the preprocessed files
but will just perform the host preprocessing. When output to a file
(with an output file option), we will perform the host and device
compilation, package and output to that file.