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

Issue 1169493002: Subzero: Improve/refactor folding loads into the next instruction. (Closed)

Created:
5 years, 6 months ago by Jim Stichnoth
Modified:
5 years, 6 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/refactor folding loads into the next instruction. This is turned into a separate (O2-only) pass that looks for opportunities: 1. A Load instruction, or an AtomicLoad intrinsic that would be lowered just like a Load instruction 2. Followed immediately by an instruction with a whitelisted kind that uses the Load dest variable as one of its operands 3. Where the whitelisted instruction ends the live range of the Load dest variable. In such cases, the original two instructions are deleted and a new instruction is added that folds the load into the whitelisted instruction. We also do some work to splice the liveness information (Inst::LiveRangesEnded and Inst::isLastUse()) into the new instruction, so that the target lowering pass might still take advantage. Currently this is used quite sparingly, but in the future we could use that along with operator commutativity to choose among different lowering sequences to reduce register pressure. The whitelisted instruction kinds are chosen based primarily on whether the main operation's native instruction can use a memory operand - e.g., arithmetic (add/sub/imul/etc), compare (cmp/ucomiss), cast (movsx/movzx/etc). Notably, call and ret are not included because arg passing is done through simple assignments which normal lowering is sufficient for. BUG= none R=jvoung@chromium.org, mtrofin@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=8e6bf6e113f496a80b900e61aec802196d83fb6d

Patch Set 1 #

Total comments: 4

Patch Set 2 : Code review changes #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -125 lines) Patch
M src/IceCfgNode.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/IceELFObjectWriter.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M src/IceInst.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/IceInst.cpp View 1 1 chunk +38 lines, -0 lines 0 comments Download
M src/IceTargetLowering.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M src/IceTargetLoweringX8632.h View 2 chunks +3 lines, -1 line 0 comments Download
M src/IceTargetLoweringX8632.cpp View 1 9 chunks +144 lines, -86 lines 2 comments Download
M tests_lit/llvm2ice_tests/nacl-atomic-fence-all.ll View 4 chunks +29 lines, -28 lines 0 comments Download
M tests_lit/llvm2ice_tests/nacl-atomic-intrinsics.ll View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
Jim Stichnoth
Verified that the scons tests pass with this patch, whereas they hit a Subzero assertion ...
5 years, 6 months ago (2015-06-03 14:14:50 UTC) #2
Mircea Trofin
lgtm
5 years, 6 months ago (2015-06-03 14:47:17 UTC) #3
jvoung (off chromium)
https://codereview.chromium.org/1169493002/diff/1/src/IceInst.cpp File src/IceInst.cpp (right): https://codereview.chromium.org/1169493002/diff/1/src/IceInst.cpp#newcode140 src/IceInst.cpp:140: (RightMask >> (Index + getSrc(I)->getNumVars())); Should this be RightMask ...
5 years, 6 months ago (2015-06-03 18:18:16 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/1169493002/diff/1/src/IceInst.cpp File src/IceInst.cpp (right): https://codereview.chromium.org/1169493002/diff/1/src/IceInst.cpp#newcode140 src/IceInst.cpp:140: (RightMask >> (Index + getSrc(I)->getNumVars())); On 2015/06/03 18:18:15, jvoung ...
5 years, 6 months ago (2015-06-03 21:06:51 UTC) #5
jvoung (off chromium)
LGTM https://codereview.chromium.org/1169493002/diff/20001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/1169493002/diff/20001/src/IceTargetLoweringX8632.cpp#newcode3107 src/IceTargetLoweringX8632.cpp:3107: InstLoad *Load = InstLoad::create(Func, Dest, Instr->getArg(0)); Maybe at ...
5 years, 6 months ago (2015-06-03 21:14:05 UTC) #6
Jim Stichnoth
https://codereview.chromium.org/1169493002/diff/20001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/1169493002/diff/20001/src/IceTargetLoweringX8632.cpp#newcode3107 src/IceTargetLoweringX8632.cpp:3107: InstLoad *Load = InstLoad::create(Func, Dest, Instr->getArg(0)); On 2015/06/03 21:14:05, ...
5 years, 6 months ago (2015-06-03 22:51:36 UTC) #7
Jim Stichnoth
5 years, 6 months ago (2015-06-03 22:58:19 UTC) #8
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
8e6bf6e113f496a80b900e61aec802196d83fb6d (tree was closed).

Powered by Google App Engine
This is Rietveld 408576698