From 6aac2773d80b42bcf9da2414bbd410aa9f10095e Mon Sep 17 00:00:00 2001 From: Bjorn Pettersson Date: Fri, 18 Jun 2021 08:58:44 +0200 Subject: [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. --- polly/lib/CodeGen/PPCGCodeGeneration.cpp | 4 ++-- polly/test/GPGPU/libdevice-functions-copied-into-kernel.ll | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'polly') 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 CUDALibDeviceFunctions = { const std::map 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 } -- cgit v1.1