[PATCH] D100684: [X86][CostModel] X86TTIImpl::getMemoryOpCost(): rewrite vector handling again

Tyurin, Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 08:13:09 PDT 2021


etyurin added inline comments.


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:3273
+  const int EltTyBits = DL.getTypeSizeInBits(EltTy);
+  assert(((EltTyBits > 0) && (EltTyBits % 8 == 0)) &&
+         "Expected byte-size types");
----------------
fhahn wrote:
> This assert triggers if a vector of `i1` (e.g. `<16 x i1>`) is passed. `EltTyBits` will be `1`. 
> 
> The assert can be triggered by running `opt -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu` on
> ```
> define void @foo(<16 x i1> %v, <16 x i1>* %ptr) {
>   store <16 x i1> %v, <16 x i1>* %ptr
>   ret void
> }
> ```
> 
> See https://llvm.godbolt.org/z/jxPvdGEW4 for a run-able version.
> 
> 
> 
> 
Perhaps, DL.getTypeStoreSizeInBits should be used instead of getTypeSizeInBits.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100684



More information about the llvm-commits mailing list