Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LegalizeVectorTypes] Always widen fabs #111298

Merged
merged 2 commits into from
Oct 7, 2024
Merged

[LegalizeVectorTypes] Always widen fabs #111298

merged 2 commits into from
Oct 7, 2024

Commits on Oct 7, 2024

  1. [LegalizeVectorTypes] Always widen fabs

    fabs and fneg are similar nodes in that they can always be expanded to integer ops, but currently they diverge when widened.
    
    If the widened vector fabs is marked as expand (and the corresponding scalar type is too), LegalizeVectorTypes thinks that it may be turned into a libcall and so will unroll it to avoid the overhead on the undef elements.
    
    However unlike the other ops in that list like fsin, fround, flog etc., an fabs marked as expand will never be legalized into a libcall. Like fneg, it can always be expanded into an integer op.
    
    This moves it below unrollExpandedOp to bring it in line with fneg, which fixes an issue on RISC-V with f16 fabs being unexpectedly scalarized when there's no zfhmin.
    lukel97 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    5d1bb5d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f11f82c View commit details
    Browse the repository at this point in the history