[PATCH] D65148: [SimplifyCFG] Bump phi-node-folding-threshold from 2 to 3

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 07:24:42 PDT 2019


lebedev.ri created this revision.
lebedev.ri added reviewers: craig.topper, jmolloy, RKSimon, efriedma, chandlerc.
lebedev.ri added a project: LLVM.
Herald added subscribers: sanjoy, hiraditya.
lebedev.ri added a parent revision: D65147: [SimplifyCFG] FoldTwoEntryPHINode(): don't bailout on i1 PHI's if we can hoist a 'not' from incoming values.

There are two motivations here.

First, this finally allows us to flatten the CFG in those
`@llvm.umul.with.overflow`+`not` tests, exposes now-redundant guard
to be folded away by InstSimplify (in a follow-up patch).

And second is the `signbit-like-value-extension.ll` test.
That pattern comes up in JPEG decoding, see e.g.
`Figure F.12 – Extending the sign bit of a decoded value in V`
of `ITU T.81` (JPEG specification).
That branch is not predictable, and it is within the innermost loop,
so the fact that that pattern ends up being stuck with a branch
instead of `select` (i.e. `CMOV` for x86) is unlikely to be beneficial.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65148

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/IndVarSimplify/loop_evaluate_1.ll
  llvm/test/Transforms/PhaseOrdering/unsigned-multiply-overflow-check.ll
  llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
  llvm/test/Transforms/SimplifyCFG/signbit-like-value-extension.ll
  llvm/test/Transforms/SimplifyCFG/unsigned-multiplication-will-overflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65148.211290.patch
Type: text/x-patch
Size: 9594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190723/e895f3f9/attachment.bin>


More information about the llvm-commits mailing list