RFR: 8287794: Reverse*VNode::Identity problem [v2]

Tobias Hartmann thartmann at openjdk.org
Mon Jul 25 14:25:49 UTC 2022


On Mon, 25 Jul 2022 13:38:59 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/opto/vectornode.cpp line 1864:
>> 
>>> 1862:     // OperationV (OperationV X) =>  X
>>> 1863:     } else if (!n->is_predicated_vector() && !in1->is_predicated_vector())  {
>>> 1864:       return in1->in(1);
>> 
>> But this will still trigger the SonarCloud warning originally reported by @shipilev because both if and else branch contain the same code, right? Shouldn't the conditions be merged?
>
> I don't think it would trigger a warning. The original warning, as I understand it, was to say that the *unpredicated* `else` branch is the same. So we were guaranteed to take either of branches, and thus the same code, irrelevant of the predicate. It is not the same here: we now have a third path, going out without entering either branch :)

Ah, right. That makes sense. I still think the branches could me merged but I don't have a strong opinion.

-------------

PR: https://git.openjdk.org/jdk/pull/9623


More information about the hotspot-compiler-dev mailing list