https://llvm.org/bugs/show_bug.cgi?id=29103

            Bug ID: 29103
           Summary: Probability of taking branch when checking for NaN is
                    too high
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedb...@nondot.org
          Reporter: ameh...@ca.ibm.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Currently when we have a check to find if a FP value is NaN, the probability of
the path taken, when the input is NaN is 3/8. 

If we reduce this probability to something smaller (I tried a value slightly
less than 5%), that will allow that basic blocks to be placed differently and
we will get a higher number of fall throughs (assuming NaNs are really rare).

One place that this matters, is in std::sqrt, where the result will be NaN if
the input is negative. I was looking at a FP code with many calls to std::sqrt,
and realized this.

Currently the function below is where these branch probabilities are decided:
bool BranchProbabilityInfo::calcFloatingPointHeuristics(const BasicBlock *BB)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to