[PATCH] D95292: [AArch64] Add vector saturating add intrinsic costs

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 24 13:13:31 PST 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:249
+    unsigned Instrs =
+        LT.second.getScalarSizeInBits() == RetTy->getScalarSizeInBits() ? 1 : 4;
+    if (any_of(ValidSatTys, [&LT](MVT M) { return M == LT.second; }))
----------------
are there test cases for that? 


================
Comment at: llvm/test/Analysis/CostModel/AArch64/arith-ssat.ll:79
+; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32I8 = call <32 x i8> @llvm.sadd.sat.v32i8(<32 x i8> undef, <32 x i8> undef)
+; SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V64I8 = call <64 x i8> @llvm.sadd.sat.v64i8(<64 x i8> undef, <64 x i8> undef)
 ; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
----------------
perhaps throw in an odd number of vector elements as well?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95292/new/

https://reviews.llvm.org/D95292



More information about the llvm-commits mailing list