From 714eb5b4ba3a79b852fcd4deade3ccd4afef10ab Mon Sep 17 00:00:00 2001 From: Dmitry Vodoypanov Date: Tue, 29 Oct 2024 09:29:49 -0700 Subject: [PATCH] [SYCL] Minor fixes to SYCLConditionalCallOnDevice pass This patch fixes minor issues in impl and tests for SYCLConditionalCallOnDevice pass: - new FCaller function now have attributes from the old one - fix tests to support RelWithDebInfo and Debug modes --- llvm/lib/SYCLLowerIR/SYCLConditionalCallOnDevice.cpp | 1 + .../ConditionalCallOnDevice/conditional-call-on-device-1.ll | 2 +- .../ConditionalCallOnDevice/conditional-call-on-device-2.ll | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/lib/SYCLLowerIR/SYCLConditionalCallOnDevice.cpp b/llvm/lib/SYCLLowerIR/SYCLConditionalCallOnDevice.cpp index b226437709b93..e4465698f7fc0 100644 --- a/llvm/lib/SYCLLowerIR/SYCLConditionalCallOnDevice.cpp +++ b/llvm/lib/SYCLLowerIR/SYCLConditionalCallOnDevice.cpp @@ -104,6 +104,7 @@ SYCLConditionalCallOnDevicePass::run(Module &M, ModuleAnalysisManager &) { &M); NewFCaller->setCallingConv(FCaller->getCallingConv()); + NewFCaller->setAttributes(FCaller->getAttributes()); DenseMap OldCallsToNewCalls; diff --git a/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-1.ll b/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-1.ll index ebbe411a845ca..29f114649757e 100644 --- a/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-1.ll +++ b/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-1.ll @@ -28,7 +28,7 @@ entry: ret void } -; CHECK: declare spir_func void @call_if_on_device_conditionally_PREFIX_1(ptr, ptr, i32, i32) +; CHECK: declare spir_func void @call_if_on_device_conditionally_PREFIX_1(ptr[[VAL1:.*]], ptr[[VAL2:.*]], i32[[VAL3:.*]], i32[[VAL4:.*]]) attributes #2 = { convergent mustprogress norecurse nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } attributes #6 = { convergent inlinehint mustprogress norecurse nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } diff --git a/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-2.ll b/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-2.ll index c3ca95a332b51..27362474e56b4 100644 --- a/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-2.ll +++ b/llvm/test/SYCLLowerIR/ConditionalCallOnDevice/conditional-call-on-device-2.ll @@ -42,8 +42,8 @@ entry: ret void } -; CHECK: declare spir_func void @call_if_on_device_conditionally1_PREFIX_1(ptr, ptr, i32, i32) -; CHECK: declare spir_func void @call_if_on_device_conditionally2_PREFIX_2(ptr, ptr, i32, i32) +; CHECK: declare spir_func void @call_if_on_device_conditionally1_PREFIX_1(ptr[[VAL1:.*]], ptr[[VAL2:.*]], i32[[VAL3:.*]], i32[[VAL4:.*]]) +; CHECK: declare spir_func void @call_if_on_device_conditionally2_PREFIX_2(ptr[[VAL1:.*]], ptr[[VAL2:.*]], i32[[VAL3:.*]], i32[[VAL4:.*]]) attributes #2 = { convergent mustprogress norecurse nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } attributes #6 = { convergent inlinehint mustprogress norecurse nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }