Prepared by: | goetz on Thu Nov 14 09:06:38 CET 2013 |
---|---|
Workspace: | /net/usr.work/d045726/oJ/lateExp-2-hotspot |
Compare against: | http://hg.openjdk.java.net/ppc-aix-port/stage/hotspot |
Compare against version: | 5660 |
Summary of changes: | 690 lines changed: 597 ins; 0 del; 93 mod; 64531 unchg |
Changeset: | lateExp-2-hotspot.changeset |
Author comments: | This change extends C2 by what we call lateExpand. LateExpand expands nodes after register allocation. Some nodes can not be expanded during matching. E.g., register allocation might not be able to deal with the resulting pattern. To allow better scheduling in such cases, we introduce lateExpand which runs after register allocation. Whether and how nodes are expanded is specified in the ad-file. See block.cpp for a detailed documentation. We use this for some nodes on ppc, and extensively on ia64. You can test this feature on sparc by applying this patch in addition to the webrev: Patch for sparc.ad file. encode %{ enc_class lateExpandIdiv_reg_reg(iRegI dst, iRegIsafe src1, iRegIsafe src2) %{ MachNode *m1 = new (C) divI_reg_reg_SRANode(); MachNode *m2 = new (C) divI_reg_reg_SRANode(); MachNode *m3 = new (C) divI_reg_reg_SDIVXNode(); m1->add_req(n_region, n_src1); m2->add_req(n_region, n_src2); m3->add_req(n_region, m1, m2); m1->_opnds[0] = _opnds[1]->clone(C); m1->_opnds[1] = _opnds[1]->clone(C); m2->_opnds[0] = _opnds[2]->clone(C); m2->_opnds[1] = _opnds[2]->clone(C); m3->_opnds[0] = _opnds[0]->clone(C); m3->_opnds[1] = _opnds[1]->clone(C); m3->_opnds[2] = _opnds[2]->clone(C); ra_->set1(m1->_idx, ra_->get_reg_first(n_src1)); ra_->set1(m2->_idx, ra_->get_reg_first(n_src2)); ra_->set1(m3->_idx, ra_->get_reg_first(this)); nodes->push(m1); nodes->push(m2); nodes->push(m3); %} %} instruct divI_reg_reg_SRA(iRegIsafe dst) %{ effect(USE_DEF dst); size(4); format %{ "SRA $dst,0,$dst\n\t" %} ins_encode %{ __ sra($dst$$Register, 0, $dst$$Register); %} ins_pipe(ialu_reg_reg); %} instruct divI_reg_reg_SDIVX(iRegI dst, iRegIsafe src1, iRegIsafe src2) %{ effect(DEF dst, USE src1, USE src2); size(4); format %{ "SDIVX $src1,$src2,$dst\n\t" %} ins_encode %{ __ sdivx($dst$$Register, 0, $dst$$Register); %} ins_pipe(sdiv_reg_reg); %} instruct divI_reg_reg_Ex(iRegI dst, iRegIsafe src1, iRegIsafe src2) %{ match(Set dst (DivI src1 src2)); predicate(UseNewCode); ins_cost((2+71)*DEFAULT_COST); format %{ "SRA $src2,0,$src2\n\t" "SRA $src1,0,$src1\n\t" "SDIVX $src1,$src2,$dst" %} lateExpand( lateExpandIdiv_reg_reg(src1, src2, dst) ); %} Adlc will generate the following code: class divI_reg_reg_ExNode : public MachNode { // ... virtual bool requires_late_expand() const { return true; } virtual void lateExpand(GrowableArray |
Legend: |
Modified file Deleted file New file |
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/cpu/sparc/vm/sparc.ad
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.8 lines changed: 8 ins; 0 del; 0 mod; 10956 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/cpu/x86/vm/x86_32.ad
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.8 lines changed: 8 ins; 0 del; 0 mod; 13299 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/cpu/x86/vm/x86_64.ad
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.8 lines changed: 8 ins; 0 del; 0 mod; 11810 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/adlc/adlparse.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.181 lines changed: 161 ins; 0 del; 20 mod; 5060 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/adlc/adlparse.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.3 lines changed: 2 ins; 0 del; 1 mod; 288 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/adlc/archDesc.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.2 lines changed: 2 ins; 0 del; 0 mod; 404 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/adlc/formssel.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.48 lines changed: 7 ins; 0 del; 41 mod; 4189 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/adlc/formssel.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.26 lines changed: 3 ins; 0 del; 23 mod; 1063 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/adlc/output_c.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.119 lines changed: 116 ins; 0 del; 3 mod; 4253 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/adlc/output_h.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.6 lines changed: 5 ins; 0 del; 1 mod; 2254 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/block.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.227 lines changed: 226 ins; 0 del; 1 mod; 1463 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/block.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.6 lines changed: 5 ins; 0 del; 1 mod; 875 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/c2_globals.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.3 lines changed: 3 ins; 0 del; 0 mod; 657 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/compile.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.6 lines changed: 6 ins; 0 del; 0 mod; 3886 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/machnode.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.4 lines changed: 4 ins; 0 del; 0 mod; 764 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/machnode.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.18 lines changed: 17 ins; 0 del; 1 mod; 920 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/matcher.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.4 lines changed: 4 ins; 0 del; 0 mod; 494 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/node.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.7 lines changed: 6 ins; 0 del; 1 mod; 1595 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/phase.cpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.5 lines changed: 5 ins; 0 del; 0 mod; 176 unchg
Cdiffs
Udiffs
Wdiffs
Sdiffs
Frames
Old
New
-----
Raw
src/share/vm/opto/phase.hpp
rev 5661 : 8003854: PPC64 (part 115): Introduce lateExpand that expands nodes after register allocation.1 line changed: 1 ins; 0 del; 0 mod; 125 unchg
This code review page was prepared using /sapmnt/home1/d045726/bin/webrev.ksh (vers 24.0-hg+jbs).