replacements and getHostProviders
Deneau, Tom
tom.deneau at amd.com
Wed Nov 20 05:26:05 PST 2013
Doug --
OK, to solve this particular problem, we will not delegate certain lowerings back to the host.
But regarding the ReplacementUtils being only for host-only snippets, I remember the previous discussion but can't say I understood the reason.
Back then you said:
"The only way to do this is to pass all relevant configuration information into this snippets as @ConstantParameter arguments. This means every snippet that directly or indirectly uses a @Fold method (e.g., in HotSpotReplacementUtils) needs to be modified."
However, in some of our allocation experiments, which we have not pushed back to trunk yet, we were able to reuse some of the utils without problem (we did have to override the threadRegister routine). Were we just lucky? How does the @Fold annotation figure into this?
Also, is there a way to have an assert to catch if some backend does accidentally try to use one of the host-only snippets so we catch it at compile time?
-- Tom
-----Original Message-----
From: graal-dev-bounces at openjdk.java.net [mailto:graal-dev-bounces at openjdk.java.net] On Behalf Of Doug Simon
Sent: Tuesday, November 19, 2013 6:15 PM
To: graal-dev at openjdk.java.net
Subject: Re: replacements and getHostProviders
On 11/20/2013 12:30 AM, Deneau, Tom wrote:
> 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?
No - these utils are for host-only snippets. This is why I explained previously that for HSAIL you cannot re-use the snippets that use these utils.
-Doug
More information about the graal-dev
mailing list