On 04/10/10 23:32, [email protected] wrote:
> def transform(op):
> from pypy.jit.metainterp.history import AbstractDescr
> - # Rename CALL_PURE to CALL.
> + # Rename CALL_PURE and CALL_INVARIANT to CALL.
> # Simplify the VIRTUAL_REF_* so that they don't show up in the backend.
> - if op.getopnum() == rop.CALL_PURE:
> + if (op.getopnum() == rop.CALL_PURE or
> + op.getopnum() == rop.CALL_LOOPINVARIANT):
> op = ResOperation(rop.CALL, op.getarglist()[1:], op.result,
> op.getdescr())
> elif op.getopnum() == rop.VIRTUAL_REF:
Hi,
I just wanted to tell that since the resoperation-refactoring, there is now a
nice "copy_and_change" method to be used exactly for the case where you want
to replace an operation with a "similar" one.
So, the code above should be written like:
op = op.copy_and_change(rop.CALL, args=op.getarglist()[1:])
ciao,
Anto
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev