diff options
author | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2021-06-18 08:58:44 +0200 |
---|---|---|
committer | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2021-06-18 08:59:06 +0200 |
commit | 6aac2773d80b42bcf9da2414bbd410aa9f10095e (patch) | |
tree | 20c795a6bf4012fcaa88432f28bc6644b2c06934 /polly | |
parent | 5798be84580be233e4cf34c08ceec8f79e80502e (diff) | |
download | llvm-6aac2773d80b42bcf9da2414bbd410aa9f10095e.zip llvm-6aac2773d80b42bcf9da2414bbd410aa9f10095e.tar.gz llvm-6aac2773d80b42bcf9da2414bbd410aa9f10095e.tar.bz2 |
[polly][GPGPU] Fixup related to overloading exponent type in llvm.powi
Commit 4c7f820b2b206bb changed the llvm.powi intrinsic to support
different 'int' sizes for the exponent. That happened to break
the IntrinsicToLibdeviceFunc mapping in PPCGCodeGeneration, which
obviously should have been updated as part of commit 4c7f820b2b
(https://reviews.llvm.org/D99439).
The shortcoming was found by buildbots that use
-DPOLLY_ENABLE_GPGPU_CODEGEN=ON
This patch should fixup the problem.
Diffstat (limited to 'polly')
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 4 | ||||
-rw-r--r-- | polly/test/GPGPU/libdevice-functions-copied-into-kernel.ll | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 39f320a..dac1fcd 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -1415,8 +1415,8 @@ const std::set<std::string> CUDALibDeviceFunctions = { const std::map<std::string, std::string> IntrinsicToLibdeviceFunc = { {"llvm.exp.f64", "exp"}, {"llvm.exp.f32", "expf"}, - {"llvm.powi.f64", "powi"}, - {"llvm.powi.f32", "powif"}}; + {"llvm.powi.f64.i32", "powi"}, + {"llvm.powi.f32.i32", "powif"}}; /// Return the corresponding CUDA libdevice function name @p Name. /// Note that this function will try to convert instrinsics in the list diff --git a/polly/test/GPGPU/libdevice-functions-copied-into-kernel.ll b/polly/test/GPGPU/libdevice-functions-copied-into-kernel.ll index 62fc6ba..194cb6c 100644 --- a/polly/test/GPGPU/libdevice-functions-copied-into-kernel.ll +++ b/polly/test/GPGPU/libdevice-functions-copied-into-kernel.ll @@ -65,7 +65,7 @@ for.body: ; preds = %for.body.lr.ph, %fo %expf = tail call float @expf(float %A.arr.i.val) %cosf = tail call float @cosf(float %expf) %logf = tail call float @logf(float %cosf) - %powi = tail call float @llvm.powi.f32(float %logf, i32 2) + %powi = tail call float @llvm.powi.f32.i32(float %logf, i32 2) %exp = tail call float @llvm.exp.f32(float %powi) %B.arr.i = getelementptr inbounds float, float* %B, i64 %indvars.iv store float %exp, float* %B.arr.i, align 4 @@ -86,7 +86,7 @@ for.end: ; preds = %for.cond.for.end_cr declare float @expf(float) #0 declare float @cosf(float) #0 declare float @logf(float) #0 -declare float @llvm.powi.f32(float, i32) #0 +declare float @llvm.powi.f32.i32(float, i32) #0 declare float @llvm.exp.f32(float) #0 attributes #0 = { nounwind readnone } |