|Anonymous | Login | Signup for a new account||2014-07-23 05:49 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005345||OCaml||OCaml general||public||2011-08-20 17:41||2012-09-25 20:07|
|Target Version||Fixed in Version|
|Summary||0005345: Optimize bounds checking|
|Description||Here is a sequence of patches to improve the code selection for Ccheckbound. The first patch avoids the separate right shifting for block headers in most cases. The second and third patches further improve the code selection for amd64 and i386. Ccheckbound is now a sequence of cmp,jbe instead of mov,shr,cmp,jbe for the common memory/immediate case.|
|Tags||No tags attached.|
|Attached Files|| 0001-Optimize-Ccheckbound-during-cmmgen.patch [^] (5,912 bytes) 2011-08-20 17:41 [Show Content]
0002-Optimize-common-case-of-Ccheckbound-for-amd64.patch [^] (3,978 bytes) 2011-08-20 17:41 [Show Content]
0003-Also-optimize-common-case-of-Ccheckbound-for-i386.patch [^] (3,579 bytes) 2011-08-20 17:41 [Show Content]
Can you provide benchmarks for real-world situations where this is useful? Also, there's a compile flag that allows one to disable array bounds checking (-unsafe). Can you provide a rationale for optimizing this? I would tend to think that people who want performance disable array bounds checking.
A speed increase with bounds checking enabled would certainly be welcome. I would rather not give up the safety of bounds checking to gain speed when possible.
This assumes that the complexity of the patch is acceptable to the OCaml maintainers and that benchmarks show this patch provides a speed increase.
Applied patch 0001 (the processor-independent part) in SVN trunk, commit 11934.
Even though array indexing with constant indices isn't that common, the patch is short, sweet, clever, and applies to all targets, so, let's go!
I prefer not to add x86-specific operations for this purpose, though. The "op mem, cst" form used to be a win over "mov reg, mem; op reg, cst" for early processors like the Pentium, but I doubt it makes much of a difference with contemporary x86 processors.
|2011-08-20 17:41||meurer||New Issue|
|2011-08-20 17:41||meurer||File Added: 0001-Optimize-Ccheckbound-during-cmmgen.patch|
|2011-08-20 17:41||meurer||File Added: 0002-Optimize-common-case-of-Ccheckbound-for-amd64.patch|
|2011-08-20 17:41||meurer||File Added: 0003-Also-optimize-common-case-of-Ccheckbound-for-i386.patch|
|2011-12-21 15:05||protz||Note Added: 0006457|
|2011-12-21 15:15||hcarty||Note Added: 0006458|
|2011-12-22 09:40||protz||Relationship added||related to 0005360|
|2011-12-22 10:44||xleroy||Note Added: 0006489|
|2011-12-22 10:44||xleroy||Status||new => resolved|
|2011-12-22 10:44||xleroy||Resolution||open => fixed|
|2012-09-25 20:07||xleroy||Status||resolved => closed|
|Copyright © 2000 - 2011 MantisBT Group|