[PATCH] D44868: [SLP] Distinguish "demanded and shrinkable" from "demanded and not shrinkable" values when determining the minimum bitwidth

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 07:11:35 PDT 2018


ABataev added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4336
+  if (MaxBitWidth == DL->getTypeSizeInBits(TreeRoot[0]->getType()) &&
+      llvm::all_of(TreeRoot, [&](Value *R) {
+        return isa<GetElementPtrInst>(*R->user_begin());
----------------
You don't capture anything in lambda, so remove `&` from the capture list.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4337
+      llvm::all_of(TreeRoot, [&](Value *R) {
+        return isa<GetElementPtrInst>(*R->user_begin());
+      })) {
----------------
What if only begin use is GEP and others are not?


================
Comment at: test/Transforms/SLPVectorizer/AArch64/ext-trunc.ll:1
+; RUN: opt -S -slp-vectorizer -instcombine < %s | FileCheck %s
+
----------------
1. Commit this test separately as NFC with checks for the current version of the compiler.
2. Generate test checks using `utils/update_test_checks.py`


================
Comment at: test/Transforms/SLPVectorizer/AArch64/ext-trunc.ll:3-4
+
+target datalayout = "e-m:e-i32:64-i128:128-n32:64-S128"
+target triple = "aarch64--linux-gnu"
+
----------------
Pass this data as test arguments.


Repository:
  rL LLVM

https://reviews.llvm.org/D44868





More information about the llvm-commits mailing list