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

Issue 2208523002: Float Constant CSE (Closed)

Created:
4 years, 4 months ago by manasijm
Modified:
4 years, 4 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

Float Constant CSE Load multiple uses of a floating point constant (between two call instructions or block start/end) into a variable before its first use. t1 = b + 1.0 t2 = c + 1.0 Gets transformed to: t0 = 1.0 t0_1 = t0 t1 = b + t0_1 t2 = c + t0_1 Call instructions reset the procedure, but uses the same variable, just in case it got a register. We are assuming floating point registers are not calee saved in general. Example, continuing from before: result = call <some function> t3 = d + 1.0 Gets transformed to: result = call <some function> t0_2 = t0 t3 = d + t0_2 BUG= none R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=5bcc6caf4b1890ef678d67fedf905977a2fc8576

Patch Set 1 #

Total comments: 22

Patch Set 2 : Address Comments #

Total comments: 12

Patch Set 3 : Address Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -4 lines) Patch
M src/IceCfg.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/IceCfg.cpp View 1 2 1 chunk +84 lines, -0 lines 0 comments Download
M src/IceRegistersMIPS32.h View 1 2 chunks +2 lines, -4 lines 0 comments Download
M src/IceTargetLoweringX86BaseImpl.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/IceTimerTree.def View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 11 (5 generated)
manasijm
4 years, 4 months ago (2016-08-02 22:27:00 UTC) #2
Jim Stichnoth
https://codereview.chromium.org/2208523002/diff/1/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/2208523002/diff/1/src/IceCfg.cpp#newcode802 src/IceCfg.cpp:802: // Load multiple uses of a floating point constant ...
4 years, 4 months ago (2016-08-03 04:43:02 UTC) #3
manasijm
https://codereview.chromium.org/2208523002/diff/1/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/2208523002/diff/1/src/IceCfg.cpp#newcode802 src/IceCfg.cpp:802: // Load multiple uses of a floating point constant ...
4 years, 4 months ago (2016-08-03 16:32:26 UTC) #5
Jim Stichnoth
otherwise lgtm https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp#newcode811 src/IceCfg.cpp:811: // Call instructions reset the procedure, but ...
4 years, 4 months ago (2016-08-04 01:45:39 UTC) #6
manasijm
Committed patchset #3 (id:40001) manually as 5bcc6caf4b1890ef678d67fedf905977a2fc8576 (presubmit successful).
4 years, 4 months ago (2016-08-04 21:25:03 UTC) #8
manasijm
4 years, 4 months ago (2016-08-04 21:29:45 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp
File src/IceCfg.cpp (right):

https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp#newcode811
src/IceCfg.cpp:811: // Call instructions reset the procedure, but uses the same
variable, just in
On 2016/08/04 01:45:39, stichnot wrote:
> s/uses/use/

Done.

https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp#newcode828
src/IceCfg.cpp:828: llvm::ilist_iterator<Inst> Current =
Node->getInsts().begin();
On 2016/08/04 01:45:39, stichnot wrote:
> I would just use "auto" here, I do that quite often for iterators.
> (and I see you already do it on the next line...)

Done.

https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp#newcode832
src/IceCfg.cpp:832: if (llvm::isa<InstCall>(*Current)) {
On 2016/08/04 01:45:39, stichnot wrote:
> Instead of *Current, please use iteratorToInst(Current) .

Done.

https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp#newcode833
src/IceCfg.cpp:833: Current++;
On 2016/08/04 01:45:39, stichnot wrote:
> ++Current

Done.

https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp#newcode834
src/IceCfg.cpp:834: assert(Current);
On 2016/08/04 01:45:39, stichnot wrote:
> What exactly does this assert?  With a quick search, I can't figure out if
> iterators have some interesting bool() overload, otherwise this seems
> tautological?

Changed to assert(Current != End)
This will be triggered if Nodes start ending with a InstCall.

https://codereview.chromium.org/2208523002/diff/20001/src/IceCfg.cpp#newcode836
src/IceCfg.cpp:836: while (Current != End && !llvm::isa<InstCall>(*Current)) {
On 2016/08/04 01:45:39, stichnot wrote:
> iteratorToInst(Current)

Done.

Powered by Google App Engine
This is Rietveld 408576698