[all-commits] [llvm/llvm-project] 1408e7: [PowerPC] [CodeGen] Use MachineBranchProbabilityIn...

zhangkangcool via All-commits all-commits at lists.llvm.org
Wed Dec 11 01:46:26 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1408e7e17525287c596a8f575957aecb684fa75d
      https://github.com/llvm/llvm-project/commit/1408e7e17525287c596a8f575957aecb684fa75d
  Author: shkzhang <shkzhang at cn.ibm.com>
  Date:   2019-12-11 (Wed, 11 Dec 2019)

  Changed paths:
    M llvm/lib/CodeGen/EarlyIfConversion.cpp

  Log Message:
  -----------
  [PowerPC] [CodeGen] Use MachineBranchProbabilityInfo in EarlyIfPredicator to avoid the potential bug

Summary:
In the function `EarlyIfPredicator::shouldConvertIf()`, we call
`TII->isProfitableToIfCvt()` with `BranchProbability::getUnknown()`, it may
cause the potential assertion error for those hook which use `BranchProbability`
in `isProfitableToIfCvt()`, for example `SystemZ`.
`SystemZ` use `Probability < BranchProbability(1, 8))` in the function
`SystemZInstrInfo::isProfitableToIfCvt()`, if we call this function with
`BranchProbability::getUnknown()`, it will cause assertion error.

This patch is to fix the potential bug.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D71273




More information about the All-commits mailing list