aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2020-06-03 09:44:00 +0100
committerJay Foad <jay.foad@amd.com>2020-06-03 09:44:33 +0100
commit7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd (patch)
tree36d5a6ffd130f797bbcb8cec6e5d2d906acd753d /llvm/lib/Analysis/ConstantFolding.cpp
parent8577595e03faf740ee0cfae1bbb2d0ff6f4e4516 (diff)
downloadllvm-7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd.zip
llvm-7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd.tar.gz
llvm-7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd.tar.bz2
[AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix)
Try to fix Windows buildbots.
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 2a9c841..67591de 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1977,7 +1977,10 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
const double SinVals[4] = { 0.0, 1.0, 0.0, -1.0 };
V = SinVals[((int)V4 + (IsCos ? 1 : 0)) & 3];
} else {
- V = (IsCos ? cos : sin)(V * 2.0 * numbers::pi);
+ if (IsCos)
+ V = cos(V * 2.0 * numbers::pi);
+ else
+ V = sin(V * 2.0 * numbers::pi);
}
return GetConstantFoldFPValue(V, Ty);
}