United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6460965 C2 does not match an instruction with swaped operands of commutative operation.
JDK-6460965 : C2 does not match an instruction with swaped operands of commutative operation.

Details
Type:
Bug
Submit Date:
2006-08-17
Status:
Resolved
Updated Date:
2011-12-23
Project Name:
JDK
Resolved Date:
2006-11-14
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
6,7
Fixed Versions:
hs10 (b03)

Related Reports
Backport:
Backport:

Sub Tasks

Description
C2 does not match an instruction with swaped operands of commutative operation.
For example, the next instruction will not be matched if a LoadI node
is the first operand:

instruct addI_rReg_mem(rRegI dst, memory src, rFlagsReg cr)
%{
  match(Set dst (AddI dst (LoadI src)));

So instead of generating one instruction "add reg, mem" C2 will generate 2:
"mov reg1, mem"
"add reg, reg1"

                                    

Comments
EVALUATION

See Description.
                                     
2006-08-17
SUGGESTED FIX

Modify ADLC to generate duplicated instructions with swapped
subtree operands of commutative operations in match rules.
Also allow to specify more than one match rule per instruction
in .ad files by generating duplicated instructions for each match rule.
Remove not needed duplicated instruction from .ad files.

Webrev:                 http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2006/20060829100548.kvn.6460965/workspace/webrevs/webrev-2006.08.29/index.html
                                     
2006-08-29



Hardware and Software, Engineered to Work Together