[PATCH] D35498: [LoopVectorizer] Use two step casting for float to pointer types.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 02:06:35 PDT 2017


Ayal added a comment.

> 3. Moved tests to Codegen/ARM. The crash disappears without arm tuple so can't remove it

Is that because the stores don't get interleaved?



================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:3307
+  assert(SrcVecTy);
+  assert(VF == SrcVecTy->getNumElements());
+  Type *SrcElemTy = SrcVecTy->getElementType();
----------------
Remove the first assert by turning dyn_cast<> into cast<>.

Add a message to the second assert.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:3310
+  Type *DstElemTy = DstVTy->getElementType();
+  assert(DL.getTypeSizeInBits(SrcElemTy) == DL.getTypeSizeInBits(DstElemTy));
+
----------------
Add a message to the assert.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:3321
+  assert(DstElemTy->isPointerTy() != SrcElemTy->isPointerTy());
+  assert(DstElemTy->isFloatingPointTy() != SrcElemTy->isFloatingPointTy());
+  Type *IntTy = IntegerType::getIntNTy(V->getContext(),
----------------
ditto


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:3323
+  Type *IntTy = IntegerType::getIntNTy(V->getContext(),
+                                   DL.getTypeSizeInBits(SrcElemTy));
+  VectorType *VecIntTy = VectorType::get(IntTy, VF);
----------------
check clang-format indentation.


================
Comment at: test/CodeGen/ARM/loopvectorize_pr33804.ll:17
+; CHECK: vector.body
+; CHECK: store <8 x %struct.CvNode1D*>
+define void @cvCalcEMD2() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
----------------
Best force vectorization width to 8 if that's the VF we expect; or expect a vector store of any width.


================
Comment at: test/CodeGen/ARM/loopvectorize_pr33804.ll:38
+; This checks we don't crash when vectorizing if vectorizer ends up
+; requiring casting pointer to a float type.
+
----------------
Explain how the second test differs from the first; i.e., the first requires casting the float value to be stored, into a pointer, and the second requires casting the pointer value into a float.


================
Comment at: test/CodeGen/ARM/loopvectorize_pr33804.ll:63
+}
+
+declare i32 @__gxx_personality_v0(...)
----------------
What about tests for float<->pointer conversions on interleaved groups of loads?


https://reviews.llvm.org/D35498





More information about the llvm-commits mailing list