[PATCH] D102493: [RISCV] Expand unaligned fixed-length vector memory accesses

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 10:05:07 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h:107
 
+    if (Alignment < DL.getTypeStoreSize(DataType->getScalarType()))
+      return false;
----------------
Does the project intend to eventually remove the implicit cast to unsigned from TypeSize? If so should this call getFixedSize() before doing the compare?


================
Comment at: llvm/test/Analysis/CostModel/RISCV/fixed-vector-gather.ll:8
 ; CHECK-LABEL: 'masked_gather'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8F64 = call <8 x double> @llvm.masked.gather.v8f64.v8p0f64(<8 x double*> undef, i32 1, <8 x i1> undef, <8 x double> undef)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4F64 = call <4 x double> @llvm.masked.gather.v4f64.v4p0f64(<4 x double*> undef, i32 1, <4 x i1> undef, <4 x double> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %V8F64 = call <8 x double> @llvm.masked.gather.v8f64.v8p0f64(<8 x double*> undef, i32 1, <8 x i1> undef, <8 x double> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %V4F64 = call <4 x double> @llvm.masked.gather.v4f64.v4p0f64(<4 x double*> undef, i32 1, <4 x i1> undef, <4 x double> undef)
----------------
frasercrmck wrote:
> I just updated these tests naively, @craig.topper, but since I suspect the intention was only to test well-aligned values, perhaps we should add additional cases?
Yeah I think we should have additional tests. I'm not sure why I got the alignment right on some tests but not others.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102493



More information about the llvm-commits mailing list