@@ -2082,15 +2082,15 @@ Value *LibCallSimplifier::replacePowWithExp(CallInst *Pow, IRBuilderBase &B) {
20822082 // Evaluate special cases related to a constant base.
20832083
20842084 const APFloat *BaseF;
2085- if (!match (Pow-> getArgOperand ( 0 ) , m_APFloat (BaseF)))
2085+ if (!match (Base , m_APFloat (BaseF)))
20862086 return nullptr ;
20872087
20882088 AttributeList NoAttrs; // Attributes are only meaningful on the original call
20892089
20902090 const bool UseIntrinsic = Pow->doesNotAccessMemory ();
20912091
20922092 // pow(2.0, itofp(x)) -> ldexp(1.0, x)
2093- if ((UseIntrinsic || !Ty->isVectorTy ()) && match (Base, m_SpecificFP ( 2.0 ) ) &&
2093+ if ((UseIntrinsic || !Ty->isVectorTy ()) && BaseF-> isExactlyValue ( 2.0 ) &&
20942094 (isa<SIToFPInst>(Expo) || isa<UIToFPInst>(Expo)) &&
20952095 (UseIntrinsic ||
20962096 hasFloatFn (M, TLI, Ty, LibFunc_ldexp, LibFunc_ldexpf, LibFunc_ldexpl))) {
@@ -2137,7 +2137,7 @@ Value *LibCallSimplifier::replacePowWithExp(CallInst *Pow, IRBuilderBase &B) {
21372137 }
21382138
21392139 // pow(10.0, x) -> exp10(x)
2140- if (match (Base, m_SpecificFP ( 10.0 ) ) &&
2140+ if (BaseF-> isExactlyValue ( 10.0 ) &&
21412141 hasFloatFn (M, TLI, Ty, LibFunc_exp10, LibFunc_exp10f, LibFunc_exp10l)) {
21422142
21432143 if (Pow->doesNotAccessMemory ()) {
0 commit comments