opto: How to use MachConstantBase with Call nodes -- needed for ppc port

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon Oct 7 02:54:20 PDT 2013


This is part of the ppc port, but I would like some advice before I open a
bug and prepare a webrev.

The next change I would like to prepare will be based on this patch:
The method introduced there is later filled with code on ppc:

This introduces a walk over the IR after matching, before gcm. In that walk
we add MachConstantBaseNode to the call nodes (CallDynamicJava, CallLeaf and
There are two problems why we need this:

-          The functionality to automatically generate an input of MachConstantBaseNode
only works with subclasses of MachConstantNode.

-          Call nodes can not have ordinary operands with ins.

We decided to implement this additional walk over the IR because it was the solution
with the least change to shared code.

Actually I would prefer a solution that gets along without this walk.
This would be possible by adding support for ordinary ins/operands in Call nodes.
The ins could be:
  [[The 5 basic operands] [the params] [new: the ordinary ins as specified by operands] [the jvms ins] [oop_map ins]]

oper_input_base() would have to return something like 'TypeFunc::Parms + tf()->_domain->_cnt',
and we would have to add oper_input_end() which does a loop over the opers
and counts the ins required:
  oper_input_end() {
   int end = oper_input_base()
   for (uint i = 1; i < num_opnds(); ++i) {  end += _opnds[i]->num_edges();  }
   return end;
Also, jvms->locoff() etc would have to depend on oper_input_end() in some way.

Alternatively, one could put the ordinary ins behind jvms, then
oper_input_base() would have to return jvms->endoff(),
and oop_maps would have to use oper_input_end() to locate their first in.

Further, I would have to add a new MachOperand that represents the

What do you think?  Would you rather prefer the existing solution,
or should I try to implement what I described?  Do you have a better
idea how to add the ConstantBase to Calls?

Best regards,

More information about the hotspot-dev mailing list