https://bugs.llvm.org/show_bug.cgi?id=43233
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371221
91177308-0d34-0410-b5e6-
96231b3b80d8
if (match(Expo, m_SpecificFP(-1.0)))
return B.CreateFDiv(ConstantFP::get(Ty, 1.0), Base, "reciprocal");
- // pow(x, 0.0) -> 1.0
- if (match(Expo, m_SpecificFP(0.0)))
+ // pow(x, +/-0.0) -> 1.0
+ if (match(Expo, m_AnyZeroFP()))
return ConstantFP::get(Ty, 1.0);
// pow(x, 1.0) -> x
ret <4 x float> %1
}
+; Make sure that -0.0 exponent is always simplified.
+
+define double @PR43233(double %x) {
+; CHECK-LABEL: @PR43233(
+; CHECK-NEXT: ret double 1.000000e+00
+;
+ %r = call fast double @llvm.pow.f64(double %x, double -0.0)
+ ret double %r
+}
+