[all-commits] [llvm/llvm-project] 661cc7: [PassManager][PhaseOrdering] lower expects before ...

RotateRight via All-commits all-commits at lists.llvm.org
Mon Apr 12 12:08:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 661cc71a1c50081389d73b2baae02f51df670ba1
      https://github.com/llvm/llvm-project/commit/661cc71a1c50081389d73b2baae02f51df670ba1
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-04-12 (Mon, 12 Apr 2021)

  Changed paths:
    M clang/test/CodeGen/thinlto-distributed-newpm.ll
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
    M llvm/test/CodeGen/AMDGPU/opt-pipeline.ll
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-pgo.ll
    M llvm/test/Other/new-pm-thinlto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
    M llvm/test/Other/opt-O2-pipeline.ll
    M llvm/test/Other/opt-O3-pipeline-enable-matrix.ll
    M llvm/test/Other/opt-O3-pipeline.ll
    M llvm/test/Other/opt-Os-pipeline.ll
    M llvm/test/Transforms/PhaseOrdering/expect.ll

  Log Message:
  -----------
  [PassManager][PhaseOrdering] lower expects before running simplifyCFG

Retry of 330619a3a623 that includes a clang test update.

Original commit message:

If we run passes before lowering llvm.expect intrinsics to metadata,
then those passes have no way to act on the hints provided by llvm.expect.
SimplifyCFG is the known offender, and we made it smarter about profile
metadata in D98898 <https://reviews.llvm.org/D98898>.

In the motivating example from https://llvm.org/PR49336 , this means we
were ignoring the recommended method for a programmer to tell the compiler
that a compare+branch is expensive. This change appears to solve that case -
the metadata survives to the backend, the compare order is as expected in IR,
and the backend does not do anything to reverse it.

We make the same change to the old pass manager to keep things synchronized.

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




More information about the All-commits mailing list