[llvm] [Transforms] Expand optimizeTan to fold more inverse trig pairs (PR #77799)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 16 21:13:21 PST 2024
================
@@ -2603,13 +2604,27 @@ Value *LibCallSimplifier::optimizeSqrt(CallInst *CI, IRBuilderBase &B) {
return copyFlags(*CI, FabsCall);
}
-// TODO: Generalize to handle any trig function and its inverse.
-Value *LibCallSimplifier::optimizeTan(CallInst *CI, IRBuilderBase &B) {
+Value *LibCallSimplifier::optimizeTrigInverionPairs(CallInst *CI,
+ IRBuilderBase &B) {
+ static const std::map<llvm::StringRef, LibFunc> trigInverses = {
----------------
arsenm wrote:
Don't use std::map. Can create an alphabetically sorted constant table and search with lower_bound
https://github.com/llvm/llvm-project/pull/77799
More information about the llvm-commits
mailing list