RFR: 8051725: Improve expansion of Conv2B nodes in the middle-end [v8]
Jasmine Karthikeyan
jkarthikeyan at openjdk.org
Fri May 26 05:49:16 UTC 2023
On Thu, 25 May 2023 01:20:56 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:
>> Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Cleanup from code review
>
> src/hotspot/share/opto/addnode.cpp line 902:
>
>> 900: return new CMoveINode(in1->in(CMoveNode::Condition), phase->intcon(l_val ^ in2_val), phase->intcon(r_val ^ in2_val), TypeInt::INT);
>> 901: }
>> 902: }
>
> An isa_int() check is needed before doing is_int()->get_con(). Something like below:
> ```
> const TypeInt* in2type = phase->type(in2)->isa_int();
> const TypeInt* ltype = phase->type(in1->in(CMoveNode::IfFalse))->isa_int();
> const TypeInt* rtype = phase->type(in1->in(CMoveNode::IfTrue))->isa_int();
>
> if (in2type && ltype && rtype) {
> int in2_val = in2type->get_con();
> int l_val = ltype->get_con();
> int r_val = rtype->get_con();
>
> if (cmp_op == Op_CmpI || cmp_op == Op_CmpP) {
> return new CMoveINode(in1->in(CMoveNode::Condition),
> phase->intcon(l_val ^ in2_val),
> phase->intcon(r_val ^ in2_val), TypeInt::INT);
> }
> }
>
> This should fix the crash seen in vectorapi test.
Ah yep, I missed that when writing the function, and it's a simple fix. Thanks for helping diagnose the issue!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13345#discussion_r1206262828
More information about the hotspot-compiler-dev
mailing list