New issue
Advanced search Search tips

Issue 691144 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

slightly sub-optimal assembly in ARM chrome

Project Member Reported by diand...@chromium.org, Feb 10 2017

Issue description

Chrome 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.

 
Owner: manojgupta@chromium.org
Status: Assigned (was: Untriaged)
Manoj, please check this with llvm generated code. 



Cc: manojgupta@chromium.org diand...@chromium.org
diander@, Just to confirm, this is on Kevin board?
@2: right
Components: Infra

Comment 5 by mmoss@chromium.org, Jan 2 2018

Components: -Infra Infra>Client>ChromeOS
[It appears that a bunch of old cros issues bulk-added the "Infra" component recently, but they should probably be "Infra>Client>ChromeOS".]
Components: -Infra>Client>ChromeOS
Components: Tools>ChromeOS-Toolchain
Owner: ----
Haven't been able to look into this :-(.

Sign in to add a comment