Custom lower the setcc/select_cc as libcall if power9 vector is not enabled.
Thanks for the work! I thought code to 'unfold' SELECT_CC and BR_CC should exist in generic code..
|4475 ↗||(On Diff #307548)|
Will this okay if IsStrict == true?
This early return isn't about P8 or P9?
Please explain in the description of the review (and subsequent commit message) why custom lowering is needed. I suppose for SELECT_CC, it is needed because using setOperationAction() uses the result type which is only guaranteed to match the true/false value but not the comparison types. However, it is not immediately obvious to me why we need custom lowering for BR_CC.
Update the description. The reason why we need to custom lower the BR_CC has been explained in the code comment. The legalizer tries its best to expand the BR_CC which is not what we want.
// Lower the br_cc as follows for fp128 as we didn't have native // instruction to lower the setcc on fp128. // br_cc cc, x, y, dest -> // z = setcc x, y, cc (expand as libcall) // br_cc NE, z, 0, dest
The description isn't really adequate - it does not answer my question at all really. The question is why not set the legalization action for BR_CC as Expand? Namely, what does the legalizer do that we don't want it to do if we let it expand the node? You just answered the question with the equivalent of "The legalizer does its job and that's not what we want." So please explain why that is not what we want.
Hmm, we will hit assertion with legalizer as it tries to swap the operand and cc to see if target support it, and assertion otherwise. Basicly, we have two options. One is to enhance the legalizer and another one is to do it inside PowerPC target as what this patch did. I am swing between them. Thank you for bringing this up and I will update the patch to go with direction on enhancing the legalizer and it might answer your question directly.