[llvm] 7c7941f - [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 3 01:51:55 PDT 2020
Author: Jay Foad
Date: 2020-06-03T09:44:33+01:00
New Revision: 7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd
URL: https://github.com/llvm/llvm-project/commit/7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd
DIFF: https://github.com/llvm/llvm-project/commit/7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd.diff
LOG: [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix)
Try to fix Windows buildbots.
Added:
Modified:
llvm/lib/Analysis/ConstantFolding.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 2a9c84196090..67591de756cb 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);
}
More information about the llvm-commits
mailing list