[all-commits] [llvm/llvm-project] 27ae17: [SimplifyCFG] use profile metadata to refine mergi...

RotateRight via All-commits all-commits at lists.llvm.org
Mon Mar 22 13:49:42 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27ae17a6b0145a559c501c35ded0ab4e9dd69e8e
      https://github.com/llvm/llvm-project/commit/27ae17a6b0145a559c501c35ded0ab4e9dd69e8e
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-03-22 (Mon, 22 Mar 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/PGOProfile/chr.ll
    M llvm/test/Transforms/SimplifyCFG/preserve-branchweights.ll

  Log Message:
  -----------
  [SimplifyCFG] use profile metadata to refine merging branch conditions

This is one step towards solving:
https://llvm.org/PR49336

In that example, we disregard the recommended usage of builtin_expect,
so an expensive (unpredictable) branch is folded into another branch
that is guarding it.
Here, we read the profile metadata to see if the 1st (predecessor)
condition is likely to cause execution to bypass the 2nd (successor)
condition before merging conditions by using logic ops.

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




More information about the All-commits mailing list