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

Issue 569033002: Split ConstantInteger into ConstantInteger32 and ConstantInteger64. (Closed)

Created:
6 years, 3 months ago by jvoung (off chromium)
Modified:
6 years, 3 months ago
Reviewers:
Jim Stichnoth
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Split ConstantInteger into ConstantInteger32 and ConstantInteger64. In many cases, we expect a constant to be 32-bits or less. This simplifies range checking for x86 memory operand displacements (can only be 32-bit), or immediates in instructions (also 32-bit), since we only store 32-bits (so it trivially fits in 32-bits). Checks for whether a constant fits in 8-bits can be done on the 32-bit value instead of the 64-bit value. When TargetLowering sees a 64-bit immediate as an operand on a 64-bit instruction, it should have split the 64-bit immediate into a 32-bit loOperand(), and a 32-bit hiOperand(). So what's left for the Emit pass should be 32-bit constants. Other places which work with constants: - intrinsic operands (the ABI only allows i32 params for atomic mem order, or atomic is lock free byte-size, or the longjmp param). - addressing mode optimization (gep expansion should be working with i32 constants). - insertelement, and extractelement constant indices (bitcode reader restricts the type of the index to be i32 also). I guess now you may end up with multiple copies of what may be the "same" constant (i64 0 vs i32 0). BUG=none R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=bc004630f011e69deeca08428e59e15a4a602c1e

Patch Set 1 #

Patch Set 2 : format #

Patch Set 3 : check for overflow, now that constants are i32 #

Patch Set 4 : test min #

Patch Set 5 : fix neg overflow check, double checked with ubsan #

Patch Set 6 : rebase #

Patch Set 7 : format #

Patch Set 8 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+209 lines, -99 lines) Patch
M src/IceConverter.cpp View 1 chunk +6 lines, -2 lines 0 comments Download
M src/IceDefs.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M src/IceGlobalContext.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/IceGlobalContext.cpp View 4 chunks +14 lines, -6 lines 0 comments Download
M src/IceInstX8632.cpp View 1 2 3 4 5 6 7 2 chunks +10 lines, -4 lines 0 comments Download
M src/IceOperand.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -4 lines 0 comments Download
M src/IceTargetLoweringX8632.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 2 3 4 5 48 chunks +91 lines, -79 lines 0 comments Download
M src/PNaClTranslator.cpp View 1 2 3 4 5 6 7 1 chunk +5 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/address-mode-opt.ll View 1 2 3 4 1 chunk +62 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
jvoung (off chromium)
Split from: https://codereview.chromium.org/476323004/diff/580001/src/IceInstX8632.cpp#newcode89 Did this seem worthwhile?
6 years, 3 months ago (2014-09-16 20:41:46 UTC) #2
Jim Stichnoth
LGTM. This seems useful across x86, and probably ARM as well.
6 years, 3 months ago (2014-09-16 21:16:40 UTC) #3
jvoung (off chromium)
6 years, 3 months ago (2014-09-16 22:09:15 UTC) #4
Message was sent while issue was closed.
Committed patchset #8 (id:140001) manually as bc00463 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698