[PATCH] D12559: Fix IRBuilder CreateBitOrPointerCast for vector types

Silviu Baranga via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 15:51:48 PDT 2015


silviu.baranga added a subscriber: silviu.baranga.
silviu.baranga added a comment.

Hi,

Thanks for the reduced testcase!

The assertion was caused by a call to this function (CreateBitOrPointerCast) from a <4 x struct.. *> to  <4 x i32> (which is similar with this case). I don't think it should assert in this case.

I didn't see these problems in my testing. The benchmark was compiling fine and producing valid results. The fact that we are seeing these issues is strange. Could it be caused by some parallel commit?

The testing results should still be valid.

I don't have access to my testing setup at the moment. I'll try to fix this as soon as I can (in about 9 hours?).

Thanks,
Silviu


================
Comment at: include/llvm/IR/IRBuilder.h:1355
@@ -1354,3 +1354,3 @@
                                 const Twine &Name = "") {
-    if (V->getType() == DestTy)
+    if (V->getType()->getScalarType() == DestTy->getScalarType())
       return V;
----------------
mzolotukhin wrote:
> This doesn't look right. What if we have vectors of different sizes (i.e. `V` is `<8 x i32>` and `DestTy` is `<4 x i32>`)?
Would calling this function to create a cast from <8 x i32> to <4 xi32> be valid? Perhaps we should add an assert here.


http://reviews.llvm.org/D12559





More information about the llvm-commits mailing list