[PATCH] D12559: Fix IRBuilder CreateBitOrPointerCast for vector types

silviu.baranga@arm.com via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 04:42:12 PDT 2015


sbaranga added inline comments.

================
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:
> silviu.baranga wrote:
> > 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.
> I think we don't need to change this condition, as it only introduces unneeded ambiguity (like in the case above). And, actually, we don't get anything from it, right?
Yes, I think you are right. I've removed that change from the final diff.


Repository:
  rL LLVM

http://reviews.llvm.org/D12559





More information about the llvm-commits mailing list