File tree 1 file changed +8
-8
lines changed
llvm/lib/Transforms/InstCombine 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -947,14 +947,6 @@ Instruction *InstCombinerImpl::foldFMulReassoc(BinaryOperator &I) {
947
947
return BinaryOperator::CreateFMulFMF (XX, Y, &I);
948
948
}
949
949
950
- // tan(X) * cos(X) -> sin(X)
951
- if (match (&I,
952
- m_c_FMul (m_OneUse (m_Intrinsic<Intrinsic::tan >(m_Value (X))),
953
- m_OneUse (m_Intrinsic<Intrinsic::cos >(m_Deferred (X)))))) {
954
- Value *Sin = Builder.CreateUnaryIntrinsic (Intrinsic::sin , X, &I);
955
- return replaceInstUsesWith (I, Sin);
956
- }
957
-
958
950
return nullptr ;
959
951
}
960
952
@@ -1081,6 +1073,14 @@ Instruction *InstCombinerImpl::visitFMul(BinaryOperator &I) {
1081
1073
return Result;
1082
1074
}
1083
1075
1076
+ // tan(X) * cos(X) -> sin(X)
1077
+ if (I.hasAllowContract () && match (&I,
1078
+ m_c_FMul (m_OneUse (m_Intrinsic<Intrinsic::tan >(m_Value (X))),
1079
+ m_OneUse (m_Intrinsic<Intrinsic::cos >(m_Deferred (X)))))) {
1080
+ Value *Sin = Builder.CreateUnaryIntrinsic (Intrinsic::sin , X, &I);
1081
+ return replaceInstUsesWith (I, Sin);
1082
+ }
1083
+
1084
1084
return nullptr ;
1085
1085
}
1086
1086
You can’t perform that action at this time.
0 commit comments