Closed
Description
One of the use cases for this target triple component is configuring SPIR target address space map.
During discussion in https://reviews.llvm.org/D89909 comments we decided to implement a different approach, which doesn't require adding environment component for SYCL.
I'd like to gather to all existing use cases for -sycldevice
and check if it's really necessary.
Use cases:
NVPTX
We have two passes added in llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp to process GlobalOffset and Local accessors. These are added to the pipeline only if module hassycldevice
environment component. @Naghasan, would be safe to enable them by default?NVPTX target configures TLSSupported for SYCL. We should be able to overloadDone by [SYCL][NVPTX][NFC] Refactor NVPTX target configuration #3535.adjust
member function and uses language option for configuration.
- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp - deletes "dead" SPIR kernel parameters. This is safe to do only when host part of the application setting SPIR kernel arguments is adjusted. TODO: check if we can enable this optimization w/o target triple modifications (e.g. metadata?)
- libclc uses a hack using
-sycldevice
to work around for [SYCL][Driver] fsycl-device-only does not offload, target triple is used to define programing model #1814. TODO: check if we can remove the hack as [SYCL][Driver] fsycl-device-only does not offload, target triple is used to define programing model #1814 is fixed. - Driver. There are a lot of places where
-sycldevice
component is checked and I hope we can replace all these checks with the language mode check i.e. if-fsycl-[device,host]-only
mode is set. @mdtoguchi, can we do this? - AllocateTarget in clang/lib/Basic/Targets.cpp uses environment triple and host OS component for OS specific configuration. TODO: check if this needed and if not, revert. Probably should should be handled w/o checking environment triple within SPIRTargetInfo methods.
- Back-ends. DPC++ uses SPIR-V for Intel devices, which doesn't preserve
-sycldevice
, but we need to check if it's the case for other targets as well (e.g. NVPTX, Xilinx, Intel FPGA, ???). - Documentation and LIT tests. These can be easily updated.