slightly sub-optimal assembly in ARM chrome |
|||||||
Issue descriptionChrome Version: 56.0.2924.87 OS: Chrome OS --- I happened to be looking at some disassembly in Chrome as part of http://crosbug.com/p/62731 I was looking at this snippet of code: char* ubuf = new char[ulength]; if (!port::Snappy_Uncompress(data, n, ubuf)) { Here's what the compiler did: 0xad622360 <+536>: ldr r0, [r7, #32] // Put number of bytes to pass to new in R0 (first param) 0xad622362 <+538>: bl 0xad23868c // the call to new 0xad622366 <+542>: ldr r1, [r7, #16] // put "data" in r1, but eventually goes to r0 0xad622368 <+544>: mov r6, r0 // store ubuf in r6 0xad62236a <+546>: mov r2, r6 // ubuf is the 3rd param to Snappy_Uncompress 0xad62236c <+548>: mov r0, r1 // finally "data" goes into r0. 0xad62236e <+550>: ldr r1, [r7, #8] // so r7 + 8 is "n" 0xad622370 <+552>: bl 0xad60cc04 <_ZN7leveldb4port17Snappy_UncompressEPKcjPc> It seems like there's an extra needless register shuffle going on here. Specifically there was no real reason that the compiler needed to store "data" in r1 and then later shuffle it over to r0.
,
Feb 23 2017
diander@, Just to confirm, this is on Kevin board?
,
Feb 23 2017
@2: right
,
Dec 26 2017
,
Jan 2 2018
[It appears that a bunch of old cros issues bulk-added the "Infra" component recently, but they should probably be "Infra>Client>ChromeOS".]
,
Jan 4 2018
,
Feb 5 2018
,
Apr 9 2018
Haven't been able to look into this :-(. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by llozano@chromium.org
, Feb 11 2017Status: Assigned (was: Untriaged)