[PATCH] D107541: [AArch64] Cost-model vector concatenation

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 07:38:25 PDT 2021


SjoerdMeijer added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2105
+    auto SubLT = TLI->getTypeLegalizationCost(DL, SubTp);
+    int NumSubElts = SubLT.second.getVectorNumElements();
+    if (Index + NumSubElts == NumElts && SubLT.second.isVector())
----------------
david-arm wrote:
> I think that getVectorNumElements will assert if SubLT.second is not a vector, so the additional isVector() call below is redundant here. If you specifically want to guard against the case where it isn't a vector it's probably better to write this as:
> 
>   if (SubLT.second.isVector() && (Index + SubLT.second.getVectorNumElements()) == NumElts)
Ah yeah, thanks, you're right about that. I was a bit too enthusiastic hoisting that getVectorNumElements() out of the if. Will fix this.

Will also fix the failing sve-intrinsics.ll that I forgot to update.


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

https://reviews.llvm.org/D107541



More information about the llvm-commits mailing list