[PATCH] D19501: Add LoadStoreVectorizer pass

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 11:59:58 PDT 2016


jlebar added a comment.

Not done going through this, but I tried your branch at https://github.com/arsenm/llvm/tree/ls-vectorizer, and I'm still ICE'ing when compiling thrust.

  $ git clone https://github.com/thrust/thrust.git
  $ cd thrust
  $ CLANG_PATH=/abs/path/to/dir/containing/clang/binary scons arch=sm_35 Wall=no Werror=no mode=release cuda_compiler=clang std=c++11 cuda_path=/usr/local/cuda-7.0 -j48 unit_tests
  
  Range types must match instruction type!
    %wide.load = load <16 x i8>, <16 x i8>* %60, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load544 = load <16 x i8>, <16 x i8>* %62, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load.1 = load <16 x i8>, <16 x i8>* %66, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load544.1 = load <16 x i8>, <16 x i8>* %68, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load.2 = load <16 x i8>, <16 x i8>* %72, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load544.2 = load <16 x i8>, <16 x i8>* %74, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load.3 = load <16 x i8>, <16 x i8>* %78, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load544.3 = load <16 x i8>, <16 x i8>* %80, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load.epil = load <16 x i8>, <16 x i8>* %84, align 1, !tbaa !61, !range !63, !alias.scope !64
  Range types must match instruction type!
    %wide.load544.epil = load <16 x i8>, <16 x i8>* %86, align 1, !tbaa !61, !range !63, !alias.scope !64
  fatal error: error in backend: Broken function found, compilation aborted!

Interestingly, this is happening during *host* compilation.  It happens even if I don't add a patch to enable the load/store vectorizer for nvptx.

Smaller steps to reproduce:

  $ curl https://gist.githubusercontent.com/anonymous/5c8863562db1dda94a821c51e3ad001a/raw/b8f3e3cc9b0995ab89d5e8c3840dcea30dc96d0b/- | llvm-run opt -O2
  (same ICE)


================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:38
@@ +37,3 @@
+#define DEBUG_TYPE "load-store-vectorizer"
+STATISTIC(NumVectorInstructions, "Number of vector instructions generated");
+
----------------
Nit, number of scalar instructions removed might be a more interesting metric, because it's notable whether we manage to vectorize in groups of 2 vs 4.

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:77-78
@@ +76,4 @@
+  /// Returns the first and the last instructions in Chain.
+  std::pair<BasicBlock::iterator, BasicBlock::iterator>
+  getBoundaryInstrs(ArrayRef<Value *> Chain);
+
----------------
mzolotukhin wrote:
> I think the second line should be indented here.
clang-format formats it for me as-is.


http://reviews.llvm.org/D19501





More information about the llvm-commits mailing list