This is an archive of the discontinued LLVM Phabricator instance.

[EarlyCSE] Force hash collision with EXPENSIVE_CHECKS
Needs ReviewPublic

Authored by bryanpkc on Sep 6 2020, 5:52 AM.

Details

Summary

This patch turns on EarlyCSEDebugHash when EXPENSIVE_CHECKS is defined, to
help detect inconsistencies between hashing and equivalence tests.

Running CTMark at O2 and O3 shows that this change does not significantly
increase the compile time, both with a baseline release build with assertions
enabled, and a release build with assertions and expensive checks enabled.

Program                                        O2     O2-debughash diff
 test-suite...ark/tramp3d-v4/tramp3d-v4.test    31.10  32.64        4.9%
 test-sutie...:: CTMark/ClamAV/clamscan.test    21.25  21.65        1.8%
 test-suite...TMark/7zip/7zip-benchmark.test    50.85  51.46        1.2%
 test-suite :: CTMark/kimwitu++/kc.test         19.14  19.23        0.4%
 test-suite...-typeset/consumer-typeset.test    16.01  16.07        0.4%
 test-suite :: CTMark/lencode/lencod.test       22.79  22.86        0.3%
 test-suite...Mark/mafft/pairlocalalign.test    13.16  13.14       -0.2%
 test-suite :: CTMark/SPASS/SPASS.test          19.50  19.13       -1.9%
 test-suite :: CTMark/Bullet/bullet.test        37.42  36.66       -2.0%
 test-suite...:: CTMark/sqlite3/sqlite3.test    21.44  20.78       -3.1%
 Geomean difference                                                 0.2%

Program                                        ExpnsvO3 ExpnsvO3-dbghsh diff
 test-suite...ark/tramp3d-v4/tramp3d-v4.test   1829.05  1976.60          8.1%
 test-suite...Mark/mafft/pairlocalalign.test     28.06    28.39          1.2%
 test-suite...-typeset/consumer-typeset.test     33.73    33.88          0.4%
 test-suite...TMark/7zip/7zip-benchmark.test     99.23    99.19         -0.0%
 test-suite :: CTMark/lencode/lencod.test        47.97    47.90         -0.1%
 test-suite :: CTMark/SPASS/SPASS.test           39.19    39.09         -0.3%
 test-sutie...:: CTMark/ClamAV/clamscan.test     40.95    40.70         -0.6%
 test-suite :: CTMark/Bullet/bullet.test         73.79    73.32         -0.6%
 test-suite :: CTMark/kimwitu++/kc.test         18.32    136.15         -1.6%
 Geomean difference                                                      0.7%

Diff Detail

Event Timeline

bryanpkc created this revision.Sep 6 2020, 5:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2020, 5:52 AM
bryanpkc requested review of this revision.Sep 6 2020, 5:52 AM
lebedev.ri accepted this revision.Sep 6 2020, 6:09 AM

That doesn't sound all that bad to me :)
I'd like to hear from those who commented in D86863, but this doesn't seem too bad, given what it protects agains.

This revision is now accepted and ready to land.Sep 6 2020, 6:09 AM

I'm primarily concerned about running into some basic block with a few thousand instructions and compile-time spiking essentially to infinity. Maybe CTMark doesn't have any functions like that, but I see them regularly.

lebedev.ri resigned from this revision.Jan 12 2023, 5:42 PM

This review seems to be stuck/dead, consider abandoning if no longer relevant.

This revision now requires review to proceed.Jan 12 2023, 5:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 5:42 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
nikic resigned from this revision.Jan 20 2023, 12:32 PM