This is an archive of the discontinued LLVM Phabricator instance.

[SCCP] Use range imposed by condition as upper bound for widening.
AbandonedPublic

Authored by fhahn on Apr 17 2020, 8:42 AM.

Details

Summary

In some cases we can do better than going to overdefined when widening.
The range imposed by a condition for example provides an upper bound on
the range of a value. Instead of widening to overdefined we can widen to
that range.

We have to ensure that the upper bound contains the merge result,
otherwise the merge step would not be monotone any longer.

This improves the number of instructions removed for some programs

Tests: 237
Same hash: 219 (filtered out)
Remaining: 18
Metric: sccp.IPNumInstRemoved

Program base p1 diff
test-suite...ks/Prolangs-C/agrep/agrep.test 40.00 57.00 42.5%
test-suite...cations/hexxagon/hexxagon.test 30.00 36.00 20.0%
test-suite...langs-C/football/football.test 85.00 96.00 12.9%
test-suite...rks/FreeBench/pifft/pifft.test 26.00 28.00 7.7%
test-suite...CFP2000/188.ammp/188.ammp.test 67.00 71.00 6.0%
test-suite...000/197.parser/197.parser.test 59.00 61.00 3.4%
test-suite.../CINT2000/254.gap/254.gap.test 158.00 162.00 2.5%
test-suite...pplications/treecc/treecc.test 66.00 67.00 1.5%
test-suite...TimberWolfMC/timberwolfmc.test 67.00 68.00 1.5%
test-suite...CFP2000/177.mesa/177.mesa.test 202.00 204.00 1.0%
test-suite...lications/ClamAV/clamscan.test 902.00 910.00 0.9%
test-suite...6/482.sphinx3/482.sphinx3.test 137.00 138.00 0.7%
test-suite.../CINT2000/176.gcc/176.gcc.test 1118.00 1123.00 0.4%
test-suite.../CINT2006/403.gcc/403.gcc.test 3831.00 3847.00 0.4%
test-suite.../Benchmarks/Bullet/bullet.test 320.00 321.00 0.3%
test-suite...000/255.vortex/255.vortex.test 3805.00 3809.00 0.1%
test-suite...:: External/Povray/povray.test 1537.00 1538.00 0.1%
test-suite...006/453.povray/453.povray.test 1772.00 1773.00 0.1%

Diff Detail

Event Timeline

fhahn created this revision.Apr 17 2020, 8:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2020, 8:42 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fhahn updated this revision to Diff 258377.Apr 17 2020, 11:07 AM

Strip invalid test changes.

nikic added a subscriber: nikic.Apr 17 2020, 1:23 PM
fhahn updated this revision to Diff 259381.Apr 22 2020, 1:42 PM

rebased

fhahn abandoned this revision.May 22 2020, 11:22 AM

After extensive discussions, it seems like the alternative approach D79036 is slightly beneficial in terms of compile time. Abandoning the patch for now.