Skip to content

Commit 038764f

Browse files
authored
[SYCL] Make invoke_simd convert its arguments to appropriate type. (#6544)
* [SYCL] Make invoke_simd convert its arguments to appropriate type. - Introduce an intermediate lambda in invoke_simd and call SIMD target from the lambda with given (SIMD) arguments coming from the lambda's formal paremeters. This way compiler automatically performs necessary argument type conversion. - Introduce a new implicit constructor for simd to allow conversion of simd objects with _VecExt storage kind (used in invoke_simd extension). - Protect linkonce_odr invoke_simd targets from DCE after splitting out ESIMD part where there are no references to them by changing linkage to WeakODR. This new scheme complicates the SIMD target function pointer flow, so LowerInvokeSimd.cpp update is needed to accomodate the new flow. Signed-off-by: Konstantin S Bobrovsky <[email protected]>
1 parent 3323da6 commit 038764f

File tree

11 files changed

+676
-275
lines changed

11 files changed

+676
-275
lines changed

llvm/include/llvm/SYCLLowerIR/LowerInvokeSimd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ class SYCLLowerInvokeSimdPass : public PassInfoMixin<SYCLLowerInvokeSimdPass> {
2424

2525
ModulePass *createSYCLLowerInvokeSimdPass();
2626
void initializeSYCLLowerInvokeSimdLegacyPassPass(PassRegistry &);
27+
28+
// Attribute added to functions which are known to be invoke_simd targets.
29+
constexpr char INVOKE_SIMD_DIRECT_TARGET_ATTR[] = "__invoke_simd_target";
30+
2731
} // namespace llvm

0 commit comments

Comments
 (0)