[all-commits] [llvm/llvm-project] 1f3708: [Pipelines] Perform hoisting prior to GVN

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Aug 7 01:06:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f37088679a5c2416707d477093950e48148d430
      https://github.com/llvm/llvm-project/commit/1f37088679a5c2416707d477093950e48148d430
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-08-07 (Mon, 07 Aug 2023)

  Changed paths:
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/test/Transforms/PhaseOrdering/gvn-replacement-vs-hoist.ll
    M llvm/test/Transforms/PhaseOrdering/loop-rotation-vs-common-code-hoisting.ll

  Log Message:
  -----------
  [Pipelines] Perform hoisting prior to GVN

We currently only enable hoisting in the last SimplifyCFG run of
the function simplification pipeline. In particular this happens
after GVN, which means that instructions that were identical (and
thus hoistable) prior to GVN might no longer be so after it ran,
due to equality replacements (see the phase ordering test).

The history here is that D84108 restricted hoisting to the very
late (module optimization) pipeline only. Then D101468 went back
on that, and also performed it at the end of function simplification.
This patch goes one step further and allows it prior to GVN.
Importantly, we still don't perform hoisting before LoopRotate,
which was the original motivation for delaying it.

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




More information about the All-commits mailing list