[llvm] [ConstantFold] Fold `logb` and `logbf` when the input parameter is a constant value. (PR #111232)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 7 00:28:51 PDT 2024
================
@@ -1676,9 +1676,9 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) {
Name == "floor" || Name == "floorf" ||
Name == "fmod" || Name == "fmodf";
case 'l':
- return Name == "log" || Name == "logf" || Name == "log2" ||
- Name == "log2f" || Name == "log10" || Name == "log10f" ||
- Name == "logl";
+ return Name == "log" || Name == "logf" || Name == "logl" ||
+ Name == "log2" || Name == "log2f" || Name == "log10" ||
+ Name == "log10f" || Name == "logb" || Name == "logbf";
----------------
c8ef wrote:
I plan to postpone `logl` in later patches because the handling of the long double parameter differs from these two functions. Additionally, even though the `logl` function is included here, we are still unable to perform constant folding on it at this time: https://godbolt.org/z/3GcnzMexd.
https://github.com/llvm/llvm-project/pull/111232
More information about the llvm-commits
mailing list