aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-04-07 07:36:45 +0700
committerMatt Arsenault <arsenm2@gmail.com>2025-04-13 16:47:07 +0200
commita24ef4b07ee798b14fe0f3daa23cc3ec09410bc6 (patch)
tree37a0dd05de2cae23ce1170fcff7382bbc8fecfe3 /llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
parentdb20b0d4ec96e4dee0b5ca6e7ddd616eafd88d40 (diff)
downloadllvm-a24ef4b07ee798b14fe0f3daa23cc3ec09410bc6.zip
llvm-a24ef4b07ee798b14fe0f3daa23cc3ec09410bc6.tar.gz
llvm-a24ef4b07ee798b14fe0f3daa23cc3ec09410bc6.tar.bz2
SimplifyLibCalls: Skip sincospi optimization for ConstantData (#134688)
Avoids looking at the uselist, and it would probably be more productive to constant fold this.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 2d0027d..4e37c58 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -3002,6 +3002,9 @@ Value *LibCallSimplifier::optimizeSinCosPi(CallInst *CI, bool IsSin, IRBuilderBa
return nullptr;
Value *Arg = CI->getArgOperand(0);
+ if (isa<ConstantData>(Arg))
+ return nullptr;
+
SmallVector<CallInst *, 1> SinCalls;
SmallVector<CallInst *, 1> CosCalls;
SmallVector<CallInst *, 1> SinCosCalls;