Bug 125528 - [MIPS] Redundant instructions in code generated from offlineasm.
Summary: [MIPS] Redundant instructions in code generated from offlineasm.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 108664
  Show dependency treegraph
 
Reported: 2013-12-10 11:57 PST by Balazs Kilvady
Modified: 2013-12-11 01:27 PST (History)
8 users (show)

See Also:


Attachments
proposed patch. (5.43 KB, patch)
2013-12-10 12:27 PST, Balazs Kilvady
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Kilvady 2013-12-10 11:57:31 PST
loadi TagOffset[cfr, index, 8], tag
load PayloadOffset[cfr, index, 8], payload

sequences are quite common in LowLevelInterpreter32_64.asm. On MIPS we don't have shifted addressing mode so when the lowering of the addresses goes independently by instructions then the generated code will be:

sll $t8, $t2, 3
addu $t8, $t8, $fp
lw $v1, 4($t8)
sll $t8, $t2, 3
addu $t8, $t8, $fp
lw $v0, 0($t8)

The second sll; addu instructions are redundant.
Comment 1 Balazs Kilvady 2013-12-10 12:27:54 PST
Created attachment 218890 [details]
proposed patch.

This patch modifies the lowering of BaseIndex addresses to check instructions in pairs so it can leave out redundant MIPS code.
Redundant MIPS instructions optimized out at 210 times processing the current LowLevelInterpreter.asm. It is hard to measure the speed of LLInt but performance test shows a small improvement:
v8-v6: 19001.8ms -> 18855.0ms
SunSpider: 5323.5ms -> 5316.1ms
And at least the size of the code is smaller.
Comment 2 WebKit Commit Bot 2013-12-10 13:48:34 PST
Comment on attachment 218890 [details]
proposed patch.

Clearing flags on attachment: 218890

Committed r160387: <http://trac.webkit.org/changeset/160387>
Comment 3 WebKit Commit Bot 2013-12-10 13:48:36 PST
All reviewed patches have been landed.  Closing bug.