From: Jay Foad Date: Wed, 3 Jun 2020 08:44:00 +0000 (+0100) Subject: [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c7941fb4bd884ee7dce96fdfdf657c0fdb608dd;p=platform%2Fupstream%2Fllvm.git [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix) Try to fix Windows buildbots. --- 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); }