[PATCH] D43256: [MBP] Move a latch block with conditional exit and multi predecessors to top of loop

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 10:49:46 PDT 2019


Carrot added a comment.

Thanks for the test case, I can reproduce it now.

As I suspected, the problem is in BranchProbabilityAnalysis. For floating point unorder comparison, it estimates the probability as 12/32. While for loop exit, the probability is 3.1%. With these probability numbers, move the latch before header is beneficial. Unfortunately there is never NaN in the input.

Even for a normal program, the NaN possibility is extremely rare, we should give a much smaller number for the unordered comparison.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D43256/new/

https://reviews.llvm.org/D43256





More information about the llvm-commits mailing list