[llvm] [AArch64][LV][SLP] Vectorizers use getFRemInstrCost for frem costs (PR #82488)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 09:17:27 PST 2024


alexey-bataev wrote:

> Currently,`frem` relies on `ReplaceWithVeclib` pass, so if for whatever reason that pass does not ran, then codegen would crash.

Same applies to the newly introduced function

> If we encapsulate this functionality in `getArithmeticInstrCost`, we are adding existing callers into this 'contract'.
> What this means, is that they could potentially pass at some point in the future a TLI object, returning the updated costs in a scenario where `ReplaceWithVeclib` happens to **not** ran.

This is not the problem of this patch, it is the issue of future patches and the authors of these patches should handle it correctly.

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


More information about the llvm-commits mailing list