Index: llvm/lib/Analysis/ValueTracking.cpp =================================================================== --- llvm/lib/Analysis/ValueTracking.cpp +++ llvm/lib/Analysis/ValueTracking.cpp @@ -4651,7 +4651,8 @@ break; } case Intrinsic::exp: - case Intrinsic::exp2: { + case Intrinsic::exp2: + case Intrinsic::exp10: { Known.knownNot(fcNegative); if ((InterestedClasses & fcNan) == fcNone) break; Index: llvm/test/Transforms/Attributor/nofpclass-exp.ll =================================================================== --- llvm/test/Transforms/Attributor/nofpclass-exp.ll +++ llvm/test/Transforms/Attributor/nofpclass-exp.ll @@ -236,9 +236,9 @@ } define float @ret_exp10(float %arg0) { -; CHECK-LABEL: define float @ret_exp10 +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_exp10 ; CHECK-SAME: (float [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -246,9 +246,9 @@ } define float @ret_exp10_noinf(float nofpclass(inf) %arg0) { -; CHECK-LABEL: define float @ret_exp10_noinf +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_exp10_noinf ; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -256,9 +256,9 @@ } define float @ret_exp10_nopinf(float nofpclass(pinf) %arg0) { -; CHECK-LABEL: define float @ret_exp10_nopinf +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_exp10_nopinf ; CHECK-SAME: (float nofpclass(pinf) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -266,9 +266,9 @@ } define float @ret_exp10_noninf(float nofpclass(ninf) %arg0) { -; CHECK-LABEL: define float @ret_exp10_noninf +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_exp10_noninf ; CHECK-SAME: (float nofpclass(ninf) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -276,9 +276,9 @@ } define float @ret_exp10_nonan(float nofpclass(nan) %arg0) { -; CHECK-LABEL: define float @ret_exp10_nonan +; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) float @ret_exp10_nonan ; CHECK-SAME: (float nofpclass(nan) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -286,9 +286,9 @@ } define float @ret_exp10_nonan_noinf(float nofpclass(nan inf) %arg0) { -; CHECK-LABEL: define float @ret_exp10_nonan_noinf +; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) float @ret_exp10_nonan_noinf ; CHECK-SAME: (float nofpclass(nan inf) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -296,9 +296,9 @@ } define float @ret_exp10_nonan_noinf_nozero(float nofpclass(nan inf zero) %arg0) { -; CHECK-LABEL: define float @ret_exp10_nonan_noinf_nozero +; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) float @ret_exp10_nonan_noinf_nozero ; CHECK-SAME: (float nofpclass(nan inf zero) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -306,9 +306,9 @@ } define float @ret_exp10_noinf_nozero(float nofpclass(inf zero) %arg0) { -; CHECK-LABEL: define float @ret_exp10_noinf_nozero +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_exp10_noinf_nozero ; CHECK-SAME: (float nofpclass(inf zero) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -316,9 +316,9 @@ } define float @ret_exp10_noinf_nonegzero(float nofpclass(inf nzero) %arg0) { -; CHECK-LABEL: define float @ret_exp10_noinf_nonegzero +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_exp10_noinf_nonegzero ; CHECK-SAME: (float nofpclass(inf nzero) [[ARG0:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[ARG0]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %call = call float @llvm.exp10.f32(float %arg0) @@ -326,10 +326,10 @@ } define float @ret_exp10_positive_source(i32 %arg) { -; CHECK-LABEL: define float @ret_exp10_positive_source +; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) float @ret_exp10_positive_source ; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: [[UITOFP:%.*]] = uitofp i32 [[ARG]] to float -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[UITOFP]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[UITOFP]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %uitofp = uitofp i32 %arg to float @@ -339,10 +339,10 @@ ; Could produce a nan because we don't know if the multiply is negative. define float @ret_exp10_unknown_sign(float nofpclass(nan) %arg0, float nofpclass(nan) %arg1) { -; CHECK-LABEL: define float @ret_exp10_unknown_sign +; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) float @ret_exp10_unknown_sign ; CHECK-SAME: (float nofpclass(nan) [[ARG0:%.*]], float nofpclass(nan) [[ARG1:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: [[UNKNOWN_SIGN_NOT_NAN:%.*]] = fmul nnan float [[ARG0]], [[ARG1]] -; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.exp10.f32(float [[UNKNOWN_SIGN_NOT_NAN]]) #[[ATTR2]] +; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan ninf nzero nsub nnorm) float @llvm.exp10.f32(float [[UNKNOWN_SIGN_NOT_NAN]]) #[[ATTR2]] ; CHECK-NEXT: ret float [[CALL]] ; %unknown.sign.not.nan = fmul nnan float %arg0, %arg1