[llvm] [CostModel][AArch64] Make extractelement, with fmul user, free whenev… (PR #111479)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 01:24:06 PDT 2024


================

----------------
david-arm wrote:

Do we also need a test when there are multiple uses of extractelement, i.e. something like

```
define double @extract_multiple_use(<2 x double> %a) {
entry:
  %1 = extractelement <2 x double> %a, i32 0
  %2 = extractelement <2 x double> %a, i32 1
  %res1 = fmul double %1, %2
  %res2 = fadd double %1, %2
  %res3 = fadd double %res1, %res2
  ret double %res3
}
```

In this case it's not immediately obvious that we will end up with the efficient form of fmul so I'm hoping the cost model deals with multiple use cases correctly.

https://github.com/llvm/llvm-project/pull/111479


More information about the llvm-commits mailing list