DynamoRIO / DynamoRIO/dynamorio
clean call inlining regression: swapping stack every single time even when nothing preserved
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on April 01, 2012 11:58:06_
in Jan 2011, DR auto-inlined bbcount's callee (just does counter increment) into nothing more than an add instruction. today, it includes a stack swap even when there's absolute nothing to preserve, resulting in horrible performance:
SPEC2006 bzip2 64MB input (default):
native 27.2s
Pin, no client 32.3s 1.19x
DynamoRIO, no client 28.6s 1.05x
Pin, bbcount, callout 55.7s 2.05x
DynamoRIO, bbcount, callout 74.9s 2.75x <=== REGRESSION!
DynamoRIO, bbcount, hand-opt 50.9s 1.87x
swapping stack when need to preserve flags is one thing (using pushf,popf, though can we revisit that as well b/c popf takes up to 20 cycles and normally is not a good idea), but shouldn't swap stack in cases where flags need not be preserved.
in one case rax was preserved even though clearly dead
_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=713_
Contributor guide
Assessment
This issue has not been assessed yet.