CreateElementBitcast doesn’t seem to do what the name suggested. If you give it 
VTy, it doesn’t grab the element type to generate bitcast. Is this by-design? 
If so, I need to do this:
PtrOp0 = Builder.CreateElementBitCast(PtrOp0, VTy->getElementType()); 

Steven

>> On Sep 8, 2015, at 5:14 PM, Steven Wu <steve...@apple.com 
>> <mailto:steve...@apple.com>> wrote:
>> Hi John
>> 
>> It seems this commit breaks arm “vld1_lane” intrinsics. When emitting 
>> “vld1_lane” Ops[0] gets updated so PtrOp0 no longer have the same type as 
>> Ops[0].
> 
> Sorry about that.
> 
>> Here a patch for the fix. Can you review it?
> 
> Slight tweak:
> 
>> From daea3a26c6df07530407318e4f0819e6e2ff9aea Mon Sep 17 00:00:00 2001
>> From: Steven Wu <steve...@apple.com <mailto:steve...@apple.com>>
>> Date: Tue, 8 Sep 2015 17:10:25 -0700
>> Subject: [PATCH] Fix assertion when emiting NEON builtin
>> 
>> ---
>> lib/CodeGen/CGBuiltin.cpp | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
>> index 729c0a1..ed3f9f6 100644
>> --- a/lib/CodeGen/CGBuiltin.cpp
>> +++ b/lib/CodeGen/CGBuiltin.cpp
>> @@ -3772,6 +3772,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned 
>> BuiltinID,
>>    Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
>>    Ty = llvm::PointerType::getUnqual(VTy->getElementType());
>>    Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
> 
> Please remove these two lines and replace them with:
>  PtrOp0 = Builder.CreateElementBitCast(PtrOp0, VTy);
> 
> You then shouldn’t need this line:
> 
>> +    PtrOp0 = Address(Ops[0], PtrOp0.getAlignment());
> 
> Thanks!
> 
> John.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to