Open manuranga opened 3 years ago
Generated bir looks like below
%0 Color;
%6 string;
…
bb4 {
%6 = ConstLoad green;
%0 = <Color> %6;
GOTO bb18;
}
If the %6
's type is green
backend can optimize this check, in the current state the backend can't do it without data analisis.
Therefore I am assigning this to frontend team, but some changes in runtime may also be needed.
Consider the following code.
In this there is no need to check each given constant (eg "red") is a subtype of
Color
since it's known at compile time.