Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1035)

Issue 1361803002: Subzero: Improve handling of alloca instructions of constant size. (Closed)

Created:
5 years, 3 months ago by Jim Stichnoth
Modified:
5 years, 3 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Subzero: Improve handling of alloca instructions of constant size. PNaCl simplifies varargs calls by creating a known-size argument array with an alloca instruction, and passing the address of that argument array. These alloca instructions don't necessarily require use of a frame pointer, freeing up the frame pointer register for normal register allocation. These varargs calls sometimes show up in cold paths of hot functions, so increasing the number of registers available to the register allocator can produce tangible gains. This patch does a simple recognition of these alloca patterns, and on x86 doesn't force a frame pointer if all alloca instructions are suitable. Future work is to avoid saving the alloca result as a local variable, and instead rematerialize the address as needed with respect to the stack or frame pointer. BUG= none R=jpp@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=55f931f65f307116c2def40c3b11ec93998a907e

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Apply x86-32 changes to x86-64 #

Total comments: 2

Patch Set 4 : Revert ARM changes #

Patch Set 5 : Add a couple of basic tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -9 lines) Patch
M src/IceCfg.cpp View 1 1 chunk +21 lines, -0 lines 0 comments Download
M src/IceInst.h View 2 chunks +3 lines, -0 lines 0 comments Download
M src/IceTargetLowering.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 2 chunks +14 lines, -1 line 0 comments Download
M src/IceTargetLoweringX8664.cpp View 1 2 2 chunks +14 lines, -1 line 0 comments Download
M src/IceTargetLoweringX86Base.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M src/IceTargetLoweringX86BaseImpl.h View 1 4 chunks +15 lines, -5 lines 0 comments Download
M tests_lit/llvm2ice_tests/align-spill-locations.ll View 1 2 chunks +4 lines, -0 lines 0 comments Download
M tests_lit/llvm2ice_tests/alloc.ll View 1 2 3 4 1 chunk +34 lines, -0 lines 0 comments Download
M tests_lit/llvm2ice_tests/ebp_args.ll View 1 1 chunk +2 lines, -0 lines 0 comments Download
M tests_lit/llvm2ice_tests/nacl-atomic-intrinsics.ll View 1 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Jim Stichnoth
I'll be adding more specific tests later today.
5 years, 3 months ago (2015-09-23 15:21:12 UTC) #2
John
lgtm https://codereview.chromium.org/1361803002/diff/40001/src/IceTargetLoweringARM32.h File src/IceTargetLoweringARM32.h (right): https://codereview.chromium.org/1361803002/diff/40001/src/IceTargetLoweringARM32.h#newcode113 src/IceTargetLoweringARM32.h:113: size_t BasicFrameOffset, size_t StackAdjBytes, What's the point of ...
5 years, 3 months ago (2015-09-23 15:28:59 UTC) #3
Jim Stichnoth
https://codereview.chromium.org/1361803002/diff/40001/src/IceTargetLoweringARM32.h File src/IceTargetLoweringARM32.h (right): https://codereview.chromium.org/1361803002/diff/40001/src/IceTargetLoweringARM32.h#newcode113 src/IceTargetLoweringARM32.h:113: size_t BasicFrameOffset, size_t StackAdjBytes, On 2015/09/23 15:28:59, John wrote: ...
5 years, 3 months ago (2015-09-23 20:17:02 UTC) #4
Jim Stichnoth
I added a couple basic tests of the new lowering. It would be nice to ...
5 years, 3 months ago (2015-09-23 22:33:57 UTC) #5
Jim Stichnoth
5 years, 3 months ago (2015-09-23 23:33:12 UTC) #6
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
55f931f65f307116c2def40c3b11ec93998a907e (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698