On Wed, 1 Oct 2025 05:40:25 GMT, Tobias Hartmann <[email protected]> wrote:
>> I wouldn't fight too hard for it, but when trying things, it was necessary
>> (since I wanted different types for `uin`), but I also think it helps to see
>> that it is not useful too long, and I can mess with it without having to
>> look at what comes after. In this case, indeed, it feels a bit coming out of
>> nowhere at the end...
>>
>> In C++17, I'd do:
>> ```c++
>> if (Node* uin = unique_constant_input_recursive(phase); uin != nullptr) {
>> return uin;
>> }
>>
>> one could also do
>> ```c++
>> if (Node* uin = unique_constant_input_recursive(phase)) {
>> return uin;
>> }
>>
>> if we are not afraid of implicit conditions (but we are, and I'm fine with
>> it!).
>
> Right but now that both `uin` have the same type, the scoping seems
> unnecessary.
Unnecessary to make it compile. But I still think it's helpful: each block can
be rearranged since it doesn't change the semantics of an outer-living
variable. It makes explicit that `uin` isn't used after... But I said I won't
fight too hard, so I reverted!
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/1640#discussion_r2393981991