[PATCH] D101494: [SimplifyCFG] Ignore ephemeral values when counting insts for threading

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 28 15:27:22 PDT 2021


tejohnson created this revision.
tejohnson added reviewers: mkazantsev, fhahn.
Herald added subscribers: wenlei, hiraditya.
tejohnson requested review of this revision.
Herald added a project: LLVM.

Ignore ephemeral values (only feeding llvm.assume intrinsics) when
computing the instruction count to decide if a block is small enough for
threading. This is similar to the handling of these values in the
InlineCost computation. These instructions will eventually be removed
and shouldn't count against code size (similar to the existing ignoring
of phis).

Without this change, when enabling -fwhole-program-vtables, which causes
type test / assume sequences to be inserted by clang, we can get
different threading decisions. In particular, when building with
instrumentation FDO it can affect the optimizations decisions before FDO
matching, leading to some mismatches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101494

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/SimplifyCFG/unprofitable-pr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101494.341331.patch
Type: text/x-patch
Size: 11556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210428/33f03b8e/attachment.bin>


More information about the llvm-commits mailing list