[llvm] [AArch64] Add costs for ROTR and ROTL. (PR #169335)
Hassnaa Hamdi via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 24 07:54:37 PST 2025
================
@@ -921,8 +921,19 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
if (ICA.getArgs().empty())
break;
- // TODO: Add handling for fshl where third argument is not a constant.
const TTI::OperandValueInfo OpInfoZ = TTI::getOperandInfo(ICA.getArgs()[2]);
+
+ // ROTR / ROTL on integer registers can be done in a single instruction. A
----------------
hassnaaHamdi wrote:
I see the codegen for fshl.i32 and fshl.i64 is equivalent to what you wrote here, but on the other side the LLVM documentation doesn't mention specialisation for that transformation, it only mentions this:
`If the first 2 arguments are identical, this is equivalent to a rotate left operation`
https://github.com/llvm/llvm-project/pull/169335
More information about the llvm-commits
mailing list