[PATCH] D61314: [SCCP] Remove forcedconstant and replace some uses with constant ranges.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 07:57:59 PDT 2019


fhahn created this revision.
fhahn added reviewers: davide, efriedma, mssimpso.
Herald added subscribers: dexonsmith, hiraditya, mehdi_amini.
Herald added a project: LLVM.
fhahn added a parent revision: D60582: [IPSCCP] Add general integer range support..

The forcedconstant lattice value is a special case to deal with undef in
SCCP and does not really fit into a more general value lattice. In most
cases, we can replace it with integer ranges: if we discover additional
facts later, the integer range is extended to accommodate new facts,
thus avoiding conflicting information.

The only cases we lose are floating point constants and constants where
we do not know the exact value.

The overall impact of this change should be low. I gathered statistics
for the MultiSource,SingleSource, SPEC2000 and SPEC2006 for -O3 with
LTO. Total number of tests is 655.

Metric: sccp.NumInstRemoved

Program                                        sccp    noforcedconst diff
 test-suite...marks/7zip/7zip-benchmark.test   1297.00 1257.00       -3.1%
 test-suite...6/471.omnetpp/471.omnetpp.test   1538.00 1550.00        0.8%
 test-suite...3.xalancbmk/483.xalancbmk.test   3245.00 3268.00        0.7%
 test-suite...6/482.sphinx3/482.sphinx3.test   729.00  726.00        -0.4%
 test-suite.../Prolangs-C/bison/mybison.test     2.00    2.00         0.0%

Metric: sccp.NumDeadBlocks

Program                                        sccp    noforcedconst diff
 test-suite...marks/7zip/7zip-benchmark.test   503.00  496.00        -1.4%
 test-suite...3.xalancbmk/483.xalancbmk.test   1330.00 1333.00        0.2%
 test-suite...ternal/HMMER/hmmcalibrate.test   621.00  621.00         0.0%

Metric: sccp.IPNumInstRemoved, sccp.IPNumArgsElimed, sccp.IPNumGlobalConst

no changes


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61314

Files:
  llvm/include/llvm/Analysis/ValueLattice.h
  llvm/lib/Analysis/ValueLattice.cpp
  llvm/lib/Transforms/Scalar/SCCP.cpp
  llvm/test/Transforms/SCCP/undef-constant.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61314.197330.patch
Type: text/x-patch
Size: 10320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190430/7f721b27/attachment.bin>


More information about the llvm-commits mailing list