[all-commits] [llvm/llvm-project] 10c531: [SCCP] Simplify CFG in SCCP as well

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Jun 30 00:25:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10c531cd5bf0166ce5bf42736506733b2285fdf8
      https://github.com/llvm/llvm-project/commit/10c531cd5bf0166ce5bf42736506733b2285fdf8
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-06-30 (Thu, 30 Jun 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/test/Transforms/GVN/gvn-loop-load-pre-order.ll
    M llvm/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll
    M llvm/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll
    M llvm/test/Transforms/SCCP/preserve-analysis.ll
    M llvm/test/Transforms/SCCP/sccptest.ll
    M llvm/test/Transforms/SCCP/strictfp-phis-fcmp.ll
    M llvm/test/Transforms/SCCP/strictfp-phis-fcmps.ll
    M llvm/test/Transforms/SCCP/widening.ll

  Log Message:
  -----------
  [SCCP] Simplify CFG in SCCP as well

Currently, we only remove dead blocks and non-feasible edges in
IPSCCP, but not in SCCP. I'm not aware of any strong reason for
that difference, so this patch updates SCCP to perform the CFG
cleanup as well.

Compile-time impact seems to be pretty minimal, in the 0.05%
geomean range on CTMark.

For the test case from https://reviews.llvm.org/D126962#3611579
the result after -sccp now looks like this:

    define void @test(i1 %c) {
    entry:
      br i1 %c, label %unreachable, label %next
    next:
      unreachable
    unreachable:
      call void @bar()
      unreachable
    }

-jump-threading does nothing on this, but -simplifycfg will produce
the optimal result.

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




More information about the All-commits mailing list