Skip to content

Commit da851f3

Browse files
kychendevsys_zuul
authored andcommitted
Disable sin/cos to sinpi/cospi optimization when -cl-fast-relaxed-math option is specified.
Change-Id: Ibb6ffebea250038cdf61904671d23b967f979dda
1 parent 4cc6e5e commit da851f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

IGC/Compiler/Optimizer/BuiltInFuncImport.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ bool PreBIImportAnalysis::runOnModule(Module& M)
957957

958958
auto modMD = getAnalysis<MetaDataUtilsWrapper>().getModuleMetaData();
959959
if ((modMD->compOpt.MatchSinCosPi) &&
960+
!(modMD->compOpt.FastRelaxedMath) &&
960961
(funcName.startswith("__builtin_spirv_OpenCL_cos_f32") ||
961962
funcName.startswith("__builtin_spirv_OpenCL_sin_f32"))) {
962963
for (auto Users : pFunc->users()) {

0 commit comments

Comments
 (0)