WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
154207
Load + Register Extend should be simplified into Load
https://bugs.webkit.org/show_bug.cgi?id=154207
Summary
Load + Register Extend should be simplified into Load
Benjamin Poulain
Reported
2016-02-12 18:50:57 PST
This: @1 = Load(@x); @2 = SExt8(@1) should be transformed as: @3 = Load8(@x) This must be done at B3 level instead of lowering in order to have the address go through legalizeMemoryOffsets().
Attachments
Patch
(25.84 KB, patch)
2016-03-03 01:21 PST
,
Benjamin Poulain
ggaren
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Filip Pizlo
Comment 1
2016-02-27 16:26:37 PST
(In reply to
comment #0
)
> This: > @1 = Load(@x); > @2 = SExt8(@1) > > should be transformed as: > @3 = Load8(@x) > > This must be done at B3 level instead of lowering in order to have the > address go through legalizeMemoryOffsets().
Seems like we "just" need use counts to do this, so we prove that the Load is not used for anything else. reduceStrength() could almost do it, but it would be dangerous, since that phase modifies the IR as it goes - so it will probably mess up any use count calculations. That implies that we should add a new phase to do this. This phase should probably also get other things that require use counts.
Benjamin Poulain
Comment 2
2016-03-03 01:21:46 PST
Created
attachment 272741
[details]
Patch
WebKit Commit Bot
Comment 3
2016-03-03 01:23:06 PST
Attachment 272741
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/b3/testb3.cpp:5560: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5578: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5620: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5621: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5635: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5636: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5651: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5653: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5667: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5668: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5682: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5683: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5697: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5698: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5713: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5715: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5729: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] ERROR: Source/JavaScriptCore/b3/testb3.cpp:5730: Consider using CHECK_EQ instead of CHECK(a == b) [readability/check] [2] Total errors found: 18 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 4
2016-03-03 01:36:53 PST
Comment on
attachment 272741
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=272741&action=review
> Source/JavaScriptCore/b3/B3ReduceLoadStrength.cpp:2 > + * Copyright (C) 2015 Apple Inc. All rights reserved.
nit: 2016
Benjamin Poulain
Comment 5
2016-03-03 14:50:17 PST
Oddly, this looks neutral on ARM64. Conf#1 Conf#2 SunSpider: 3d-cube 10.4225+-0.0819 ? 10.4328+-0.0886 ? 3d-morph 8.3399+-0.1316 8.3179+-0.0621 3d-raytrace 9.5516+-0.3255 9.5405+-0.3488 access-binary-trees 4.3262+-0.2322 ? 4.3801+-0.0600 ? might be 1.0125x slower access-fannkuch 11.5094+-0.3124 11.4914+-0.2874 access-nbody 4.7831+-0.0301 4.7522+-0.0290 access-nsieve 3.4041+-0.0409 ? 3.4456+-0.0558 ? might be 1.0122x slower bitops-3bit-bits-in-byte 1.7092+-0.0215 ? 1.7697+-0.1189 ? might be 1.0354x slower bitops-bits-in-byte 4.1934+-0.0406 4.1794+-0.0285 bitops-bitwise-and 3.2763+-0.0777 3.2463+-0.0582 bitops-nsieve-bits 5.9133+-0.0633 5.9008+-0.0456 controlflow-recursive 3.7743+-0.2521 3.7358+-0.3400 might be 1.0103x faster crypto-aes 6.4744+-0.0808 6.4397+-0.0534 crypto-md5 4.0788+-0.1389 ? 4.2801+-0.3735 ? might be 1.0494x slower crypto-sha1 3.7694+-0.0639 ? 3.7959+-0.1367 ? date-format-tofte 11.2938+-0.0841 ? 11.3011+-0.0991 ? date-format-xparb 7.3490+-0.1118 ? 7.3584+-0.1007 ? math-cordic 5.4631+-0.0912 5.4425+-0.1090 math-partial-sums 11.6965+-0.1031 ? 11.7500+-0.0898 ? math-spectral-norm 3.5078+-0.2203 3.3322+-0.2333 might be 1.0527x faster regexp-dna 9.7854+-0.0681 9.7693+-0.0664 string-base64 6.5219+-0.0450 6.5099+-0.0299 string-fasta 9.6279+-0.3293 ? 9.6350+-0.2924 ? string-tagcloud 11.0055+-0.2440 ? 11.0197+-0.1790 ? string-unpack-code 23.4390+-0.0882 23.3442+-0.0803 string-validate-input 6.4305+-0.1878 ? 6.5413+-0.1407 ? might be 1.0172x slower <arithmetic> 7.3710+-0.0179 ? 7.3735+-0.0319 ? might be 1.0003x slower Conf#1 Conf#2 Octane: encrypt 0.19687+-0.00067 ? 0.19781+-0.00148 ? decrypt 3.72317+-0.00911 3.71527+-0.00690 deltablue x2 0.17056+-0.00089 ? 0.17340+-0.00418 ? might be 1.0167x slower earley 0.42355+-0.00966 ? 0.42556+-0.01110 ? boyer 7.39531+-0.12680 ? 7.54110+-0.26902 ? might be 1.0197x slower navier-stokes x2 7.18109+-0.00599 7.17997+-0.00690 raytrace x2 1.28817+-0.00785 ? 1.30752+-0.03433 ? might be 1.0150x slower richards x2 0.11298+-0.00289 ? 0.11326+-0.00194 ? splay x2 0.72602+-0.01767 ? 0.72802+-0.01090 ? regexp x2 34.90936+-0.12731 34.81403+-0.12786 pdfjs x2 57.28040+-0.24741 57.15629+-0.34824 mandreel x2 71.03873+-0.86106 70.69574+-1.02180 gbemu x2 46.46087+-3.14811 ? 51.50368+-5.56189 ? might be 1.1085x slower closure 0.65471+-0.00954 0.65139+-0.00274 jquery 9.62274+-0.02646 9.62142+-0.04047 box2d x2 16.09526+-0.16333 16.02558+-0.09420 zlib x2 683.23024+-31.72146 672.21808+-37.34598 might be 1.0164x faster typescript x2 1141.30809+-4.78125 ? 1144.27098+-8.93657 ? <geometric> 8.07399+-0.04610 ? 8.13484+-0.06335 ? might be 1.0075x slower Conf#1 Conf#2 Kraken: ai-astar 156.768+-2.865 156.533+-2.479 audio-beat-detection 77.603+-5.235 ? 79.476+-4.149 ? might be 1.0241x slower audio-dft 150.311+-6.566 142.803+-5.301 might be 1.0526x faster audio-fft 41.889+-0.106 ? 41.990+-0.211 ? audio-oscillator 54.419+-0.656 54.144+-0.163 imaging-darkroom 69.249+-0.222 69.208+-0.174 imaging-desaturate 78.500+-0.796 ? 78.953+-1.253 ? imaging-gaussian-blur 98.852+-0.486 98.127+-1.138 json-parse-financial 47.499+-0.216 47.251+-0.261 json-stringify-tinderbox 27.298+-0.118 27.089+-0.144 stanford-crypto-aes 58.808+-0.255 ? 59.165+-0.511 ? stanford-crypto-ccm 46.773+-0.881 46.543+-0.780 stanford-crypto-pbkdf2 141.222+-0.537 ? 141.414+-1.004 ? stanford-crypto-sha256-iterative 51.213+-0.142 51.042+-0.168 <arithmetic> 78.600+-0.522 78.124+-0.530 might be 1.0061x faster Conf#1 Conf#2 AsmBench: bigfib.cpp 725.7208+-29.8290 ? 734.5102+-20.2056 ? might be 1.0121x slower cray.c 559.5356+-4.5890 ? 563.1744+-5.9183 ? dry.c 471.0161+-3.8902 ? 472.3592+-2.9768 ? FloatMM.c 810.2771+-8.9211 805.1089+-9.3111 gcc-loops.cpp 4675.4980+-24.6400 4661.7415+-3.5747 n-body.c 1762.1646+-2.4270 ? 1762.2233+-3.8443 ? Quicksort.c 561.8582+-2.4384 560.1319+-3.1790 stepanov_container.cpp 5636.6802+-23.4988 ? 5639.4599+-17.3435 ? Towers.c 277.4103+-1.1818 ? 277.5199+-1.6721 ? <geometric> 1012.6144+-5.2120 ? 1013.8331+-3.6487 ? might be 1.0012x slower Conf#1 Conf#2 Geomean of preferred means: <scaled-result> 46.6509+-0.0970 ? 46.6853+-0.1113 ? might be 1.0007x slower
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug