diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:46:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:46:52 +0000 |
commit | 6b3f41ed88e8e440e11a4fbf20b6600529f80049 (patch) | |
tree | 928b056f24a634d628c80238dbbf10d41b1a71d5 /unittests/Analysis | |
parent | c46e6a5940c50058e00c0c5f9123fd82e338d29a (diff) |
Diffstat (limited to 'unittests/Analysis')
-rw-r--r-- | unittests/Analysis/ProfileSummaryInfoTest.cpp | 6 | ||||
-rw-r--r-- | unittests/Analysis/TargetLibraryInfoTest.cpp | 46 |
2 files changed, 52 insertions, 0 deletions
diff --git a/unittests/Analysis/ProfileSummaryInfoTest.cpp b/unittests/Analysis/ProfileSummaryInfoTest.cpp index 0b4b1de28053..3454474f0376 100644 --- a/unittests/Analysis/ProfileSummaryInfoTest.cpp +++ b/unittests/Analysis/ProfileSummaryInfoTest.cpp @@ -162,6 +162,12 @@ TEST_F(ProfileSummaryInfoTest, InstrProf) { EXPECT_TRUE(PSI.isHotCallSite(CS1, &BFI)); EXPECT_FALSE(PSI.isHotCallSite(CS2, &BFI)); + + // Test that adding an MD_prof metadata with a hot count on CS2 does not + // change its hotness as it has no effect in instrumented profiling. + MDBuilder MDB(M->getContext()); + CI2->setMetadata(llvm::LLVMContext::MD_prof, MDB.createBranchWeights({400})); + EXPECT_FALSE(PSI.isHotCallSite(CS2, &BFI)); } TEST_F(ProfileSummaryInfoTest, SampleProf) { diff --git a/unittests/Analysis/TargetLibraryInfoTest.cpp b/unittests/Analysis/TargetLibraryInfoTest.cpp index 44c141d6a1e9..9d852cf0301b 100644 --- a/unittests/Analysis/TargetLibraryInfoTest.cpp +++ b/unittests/Analysis/TargetLibraryInfoTest.cpp @@ -470,6 +470,52 @@ TEST_F(TargetLibraryInfoTest, ValidProto) { "declare i32 @isascii(i32)\n" "declare i32 @isdigit(i32)\n" "declare i32 @toascii(i32)\n" + + // These functions were extracted from math-finite.h which provides + // functions similar to those in math.h, but optimized for handling + // finite values only. + "declare double @__acos_finite(double)\n" + "declare float @__acosf_finite(float)\n" + "declare x86_fp80 @__acosl_finite(x86_fp80)\n" + "declare double @__acosh_finite(double)\n" + "declare float @__acoshf_finite(float)\n" + "declare x86_fp80 @__acoshl_finite(x86_fp80)\n" + "declare double @__asin_finite(double)\n" + "declare float @__asinf_finite(float)\n" + "declare x86_fp80 @__asinl_finite(x86_fp80)\n" + "declare double @__atan2_finite(double, double)\n" + "declare float @__atan2f_finite(float, float)\n" + "declare x86_fp80 @__atan2l_finite(x86_fp80, x86_fp80)\n" + "declare double @__atanh_finite(double)\n" + "declare float @__atanhf_finite(float)\n" + "declare x86_fp80 @__atanhl_finite(x86_fp80)\n" + "declare double @__cosh_finite(double)\n" + "declare float @__coshf_finite(float)\n" + "declare x86_fp80 @__coshl_finite(x86_fp80)\n" + "declare double @__exp10_finite(double)\n" + "declare float @__exp10f_finite(float)\n" + "declare x86_fp80 @__exp10l_finite(x86_fp80)\n" + "declare double @__exp2_finite(double)\n" + "declare float @__exp2f_finite(float)\n" + "declare x86_fp80 @__exp2l_finite(x86_fp80)\n" + "declare double @__exp_finite(double)\n" + "declare float @__expf_finite(float)\n" + "declare x86_fp80 @__expl_finite(x86_fp80)\n" + "declare double @__log10_finite(double)\n" + "declare float @__log10f_finite(float)\n" + "declare x86_fp80 @__log10l_finite(x86_fp80)\n" + "declare double @__log2_finite(double)\n" + "declare float @__log2f_finite(float)\n" + "declare x86_fp80 @__log2l_finite(x86_fp80)\n" + "declare double @__log_finite(double)\n" + "declare float @__logf_finite(float)\n" + "declare x86_fp80 @__logl_finite(x86_fp80)\n" + "declare double @__pow_finite(double, double)\n" + "declare float @__powf_finite(float, float)\n" + "declare x86_fp80 @__powl_finite(x86_fp80, x86_fp80)\n" + "declare double @__sinh_finite(double)\n" + "declare float @__sinhf_finite(float)\n" + "declare x86_fp80 @__sinhl_finite(x86_fp80)\n" ); for (unsigned FI = 0; FI != LibFunc::NumLibFuncs; ++FI) { |