[PATCH] D102755: [AArch64] Add cost tests for bitreverse
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 04:56:36 PDT 2021
dmgreen added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:259
+ auto LT = TLI->getTypeLegalizationCost(DL, RetTy);
+ if (any_of(ValidBitTys, [<](MVT M) { return M == LT.second; }))
+ return LT.first;
----------------
I think that these types should have a slightly higher cost than just 1 (or 1*LT.first, the legalization cost).
It's common in these cost functions to have a table of operand and type, giving a cost to each. That way they can be controlled a little better. Like the getShuffleCost at the end of this file. Would it be worth adding something similar here?
(We could also maybe optimize the v4i32 case better using a vrev32. But it's probably best to use the current cost over what we expect it could be later).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102755/new/
https://reviews.llvm.org/D102755
More information about the llvm-commits
mailing list