RFR: 8253734: C2: Optimize Move nodes
Tobias Hartmann
thartmann at openjdk.java.net
Fri Oct 23 09:22:38 UTC 2020
On Fri, 23 Oct 2020 08:27:50 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> Introduce the following transformations for Move nodes:
> 1. `MoveI2F (MoveF2I x) => x`
>
> 1. `MoveI2F (LoadI mem) => LoadF mem`
>
> 1. `StoreI mem (MoveF2I x) => StoreF mem x`
>
> (The same applies to MoveL2D/MoveD2L.)
>
> №1 eliminates redundant operations and №2/№3 avoid reg-to-reg moves in generated code:
> 0x000000010d09964c: vmovss 0x20(%rsi),%xmm1
> 0x000000010d099651: vmovd %xmm1,%eax ;*invokestatic floatToRawIntBits
> vs
> 0x0000000110c5a6cc: mov 0x20(%rsi),%eax ;*invokestatic floatToRawIntBits
>
>
> (№2 and №3 are performed late (after loop opts are over) to avoid high-level optimizations passes to handle newly introduced mismatched accesses.)
>
> Testing: tier1-5.
Maybe add some comments with examples to the reinterpret methods.
src/hotspot/share/opto/movenode.hpp line 126:
> 124: public:
> 125: MoveL2DNode(Node* value) : MoveNode(value) {
> 126: init_class_id(Class_Move);
Shouldn't `init_class_id` be moved to the `MoveNode` constructor?
src/hotspot/share/opto/movenode.hpp line 108:
> 106: virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
> 107: virtual Node* Identity(PhaseGVN* phase);
> 108: // virtual const Type* Value(PhaseGVN* phase) const;
Can be removed.
-------------
Changes requested by thartmann (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/826
More information about the hotspot-compiler-dev
mailing list