[PATCH] D128796: [SCCP] Simplify CFG in SCCP as well

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 02:39:47 PDT 2022


nikic created this revision.
nikic added reviewers: fhahn, efriedma.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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: http://llvm-compile-time-tracker.com/compare.php?from=f65c88c42fdd0e46d16fe31737e6627c56de77c3&to=d9d221a4687368b26083ca34a230e69f9f0fb59b&stat=instructions

For the test case from https://reviews.llvm.org/D126962#3611579 the result after `-sccp` now looks like this: https://gist.github.com/nikic/d50c03ec140bf9de217c9960d4f60a08 `-jump-threading` does nothing on this, but `-simplifycfg` will produce the optimal result.


https://reviews.llvm.org/D128796

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128796.440906.patch
Type: text/x-patch
Size: 13048 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220629/38e8e560/attachment.bin>


More information about the llvm-commits mailing list