[llvm-branch-commits] [llvm] [AArch64] SLP can vectorize frem (PR #82488)

Paschalis Mpeis via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 22 07:49:14 PST 2024


paschalis-mpeis wrote:

The benefits of having`getFRemInstrCost` in my view are the below:
1. frem is a special case anyway:
It's an IR instruction that is not supported by all hw and targets have to specialize.
Handling it in a dedicated switch case with a dedicated TTI function call, clearly exposes that information to anyone who reads the code in both vectorizers (and not obscuring it away). 
Plus it won't add any `if (TLI hasVecLib) doThis else doThat` logic to the vectorizers.

2. This won't be a significant API change.
It won't force any other user of the `getArithmeticInstrCost` to go through that change.

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


More information about the llvm-branch-commits mailing list