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

Issue 1125323004: Subzero: Use cmov to improve lowering for the select instruction. (Closed)

Created:
5 years, 7 months ago by Jim Stichnoth
Modified:
5 years, 7 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: Use cmov to improve lowering for the select instruction. This is instead of explicit control flow which may interfere with branch prediction. However, explicit control flow is still needed for types other than i16 and i32, due to cmov limitations. The assembler for cmov is extended to allow the non-dest operand to be a memory operand. The select lowering is getting large enough that it was in our best interest to combine the default lowering with the bool-folding optimization. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4095 R=jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=537b5ba030eac501734276a39223e2b7a5465ad6

Patch Set 1 #

Total comments: 4

Patch Set 2 : Remove a rogue comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -99 lines) Patch
M src/IceInstX8632.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/IceInstX8632.cpp View 3 chunks +26 lines, -7 lines 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 3 chunks +58 lines, -58 lines 0 comments Download
M src/assembler_ia32.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/assembler_ia32.cpp View 1 chunk +17 lines, -1 line 0 comments Download
M tests_lit/assembler/x86/sandboxing.ll View 2 chunks +16 lines, -10 lines 0 comments Download
M tests_lit/llvm2ice_tests/64bit.pnacl.ll View 6 chunks +6 lines, -6 lines 0 comments Download
M tests_lit/llvm2ice_tests/bool-folding.ll View 6 chunks +13 lines, -16 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Jim Stichnoth
This improves twolf by 13%, mcf by 5-6%, and a few others by lesser amounts, ...
5 years, 7 months ago (2015-05-18 22:38:16 UTC) #2
jvoung (off chromium)
LGTM https://codereview.chromium.org/1125323004/diff/1/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/1125323004/diff/1/src/IceTargetLoweringX8632.cpp#newcode4170 src/IceTargetLoweringX8632.cpp:4170: // XXX test select of i1 src operands, ...
5 years, 7 months ago (2015-05-19 16:25:38 UTC) #3
Jim Stichnoth
Committed patchset #2 (id:20001) manually as 537b5ba030eac501734276a39223e2b7a5465ad6 (presubmit successful).
5 years, 7 months ago (2015-05-19 16:48:51 UTC) #4
Jim Stichnoth
5 years, 7 months ago (2015-05-19 20:41:51 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/1125323004/diff/1/src/IceTargetLoweringX8632.cpp
File src/IceTargetLoweringX8632.cpp (right):

https://codereview.chromium.org/1125323004/diff/1/src/IceTargetLoweringX8632....
src/IceTargetLoweringX8632.cpp:4170: // XXX test select of i1 src operands, also
f32/f64.
On 2015/05/19 16:25:37, jvoung wrote:
> Update XXX ?

Done.  (forgot to cleanup my notes...)

https://codereview.chromium.org/1125323004/diff/1/src/IceTargetLoweringX8632....
src/IceTargetLoweringX8632.cpp:4184: // mov t, SrcT; cmov_!cond t, SrcF; mov
dest, t
On 2015/05/19 16:25:38, jvoung wrote:
> Is it often that both are immediates (does that happen in the benchmarks that
> fall behind a bit)?

I counted 1115 instances across all of spec2k:
  egrep 'select i.*, i.* [0-9]+, i.* [0-9]+$' *.ll | wc -l

This pattern accounts for 10-20% of select instructions in each benchmark, and
roughly 0.1% of all bitcode instructions.  Those are static numbers, I don't
know dynamic numbers.

Powered by Google App Engine
This is Rietveld 408576698