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

[CostModel][AArch64] Make extractelement, with fmul user, free whenev… #111479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 6, 2024

  1. [CostModel][AArch64] Make extractelement, with fmul user, free whenev…

    …er possible
    
    In case of Neon, if there exists extractelement from lane != 0 such that
      1. extractelement does not necessitate a move from vector_reg -> GPR.
      2. extractelement result feeds into fmul.
      3. Other operand of fmul is a scalar or extractelement from lane 0 or lane equivalent to 0.
      then the extractelement can be merged with fmul in the backend and it incurs no cost.
      e.g.
      define double @foo(<2 x double> %a) {
        %1 = extractelement <2 x double> %a, i32 0
        %2 = extractelement <2 x double> %a, i32 1
        %res = fmul double %1, %2    ret double %res
      }
      %2 and %res can be merged in the backend to generate:
      fmul    d0, d0, v0.d[1]
    
    The change was tested with SPEC FP(C/C++) on Neoverse-v2.
    Compile time impact: None
    Performance impact: Observing 1.3-1.7% uplift on lbm benchmark with -flto depending upon the config.
    sushgokh committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    5205ae1 View commit details
    Browse the repository at this point in the history