replacements and getHostProviders
Deneau, Tom
tom.deneau at amd.com
Tue Nov 19 15:30:05 PST 2013
Doug or others --
Currently the HSAIL backend lazily delegates all replacements to the host.
And in HSAILHotSpotBackendFactory we also define our backend registers to be
HotSpotRegisters registers = new HotSpotRegisters(Register.None, Register.None, Register.None);
expecting that to hit an assert if anything tries to get the threadRegister, heapBaseRegister or stackPointerRegister.
But if the method we are compiling in the HSAIL backend starts expanding a snippet that might use the threadRegister,
I see that HotSpotReplacementsUtil defines threadRegister() as
public static Register threadRegister() {
return runtime().getHostProviders().getRegisters().getThreadRegister();
}
which always goes to the host rather than the backend's registers. So we don't catch an error at compile time but
instead at runtime.
Is it a mistake that HotSpotReplacementsUtil goes thru the HostProviders?
I realize that in a real solution we should not delegate all replacements to the host, just the ones we know we
can implement, but just wondering about the above question.
-- Tom
More information about the graal-dev
mailing list