[all-commits] [llvm/llvm-project] 6bcff9: [HIPSTDPAR] Add handling for math builtins (#140158)
Alex Voicu via All-commits
all-commits at lists.llvm.org
Mon Jul 28 14:29:53 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6bcff9eb13f226b89bb6ebc80bb0f3e80b7868f7
https://github.com/llvm/llvm-project/commit/6bcff9eb13f226b89bb6ebc80bb0f3e80b7868f7
Author: Alex Voicu <alexandru.voicu at amd.com>
Date: 2025-07-28 (Mon, 28 Jul 2025)
Changed paths:
M llvm/include/llvm/Transforms/HipStdPar/HipStdPar.h
M llvm/lib/Passes/PassRegistry.def
M llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
M llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
A llvm/test/Transforms/HipStdPar/math-fixup.ll
Log Message:
-----------
[HIPSTDPAR] Add handling for math builtins (#140158)
When compiling in `--hipstdpar` mode, the builtins corresponding to the
standard library might end up in code that is expected to execute on the
accelerator (e.g. by using the `std::` prefixed functions from
`<cmath>`). We do not have uniform handling for this in AMDGPU, and the
errors that obtain are quite arcane. Furthermore, the user-space changes
required to work around this tend to be rather intrusive.
This patch adds an additional `--hipstdpar` specific pass which forwards
to the run time component of HIPSTDPAR the intrinsics / libcalls which
result from the use of the math builtins, and which are not properly
handled. In the long run we will want to stop relying on this and handle
things in the compiler, but it is going to be a rather lengthy journey,
which makes this medium term escape hatch necessary.
The paired change in the run time component is here
<https://github.com/ROCm/rocThrust/pull/551>.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list