Walter's talk on D backend

claptrap clap at trap.com
Mon Sep 23 08:23:33 UTC 2024


On Monday, 23 September 2024 at 05:36:18 UTC, Walter Bright wrote:
> On 9/22/2024 3:55 AM, claptrap wrote:
>> Can more than one elem reference the same (lvalue) variable? 
>> Eg..
>> 
>> int x = 100;
>> x = x+1;
>> x = y+1;
>
> Yes.
>
>> That's three different elem, but do they all have the same 'x' 
>> as their target?
>
> The single assignment refers to the value of the elem tree 
> node, not the value of the variables.

Then it's not SSA, the whole point of SSA is that **variables** 
are only ever assigned once. So it'd be like...

int x0 = 100;
x1 = x0+1;
x2 = y1+1;

Thats why OP asked about phi instructions, you need them to merge 
the versions of a variable that reach the start of a basic block. 
Or at least you need to have some mechanism for it.





More information about the Digitalmars-d mailing list