[PATCH] D89872: [SVE][AArch64] Fix TypeSize warning in GEP cost analysis

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 02:32:48 PDT 2020


sdesmalen added inline comments.


================
Comment at: llvm/test/Analysis/CostModel/AArch64/gep-cost-scalable-vector-typesize-warning.ll:1
+; RUN: opt -S -O2 -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s
+; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t
----------------
Sorry, just one more suggestion. You can test this more easily by invoking the cost-model directly on the GEP, like this:

```RUN: opt -cost-model -analyze -mtriple=aarch64--linux-gnu -mattr=+sve 2>%t
RUN: FileCheck --check-prefix=WARN --allow-empty %s < %t

; WARN-NOT: warning: {{.*}}TypeSize is not scalable

define <vscale x 16 x i8>* @gep_scalable_vector(<vscale x 16 x i8>* %ptr) {
  %retval = getelementptr <vscale x 16 x i8>, <vscale x 16 x i8>* %ptr, i32 2
  ret <vscale x 16 x i8>* %retval
}```

If you also add a CHECK line for the cost of the GEP itself, you can rename the test to `cost-scalable-vector-gep.ll`. We're about to start work on the vectorizer and the cost-model more broadly, so we'll be adding more similar(ly named) tests like this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89872



More information about the llvm-commits mailing list