[llvm] b0f4b65 - AMDGPU: Delete probably wrong constant folding of expm1

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 18:01:49 PDT 2023


Author: Matt Arsenault
Date: 2023-08-04T21:01:44-04:00
New Revision: b0f4b6587a8e1044f6e4e1e117cc166586678ee5

URL: https://github.com/llvm/llvm-project/commit/b0f4b6587a8e1044f6e4e1e117cc166586678ee5
DIFF: https://github.com/llvm/llvm-project/commit/b0f4b6587a8e1044f6e4e1e117cc166586678ee5.diff

LOG: AMDGPU: Delete probably wrong constant folding of expm1

It's not really correct to implement this as exp(x) - 1, it was maybe
OK for the restricted float-as-double case handled here. There's not a
strong reason to special case it with the host function, as the
implementation naturally constant folds anyway. InstSimplify can fully
handle everything in it, so just running the inliner alone with a
constant argument produces the fully constant folded result. This also
had no tests.

https://reviews.llvm.org/D156892

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
index 10ae460326d926..b9b6f7d6d55f29 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
@@ -1359,10 +1359,6 @@ bool AMDGPULibCalls::evaluateScalarMathFunc(const FuncInfo &FInfo,
     Res0 = pow(10.0, opr0);
     return true;
 
-  case AMDGPULibFunc::EI_EXPM1:
-    Res0 = exp(opr0) - 1.0;
-    return true;
-
   case AMDGPULibFunc::EI_LOG:
     Res0 = log(opr0);
     return true;


        


More information about the llvm-commits mailing list