Attached patch backports r215629 of trunk to the
3.5 release branch.
It fixes a regression with multiple address spaces in
OpenCL and blocks.
Is this OK to commit?
On 08/18/2014 08:30 AM, Bill Wendling wrote:
Please do a back port and get it approved.
-bw
On Aug 14, 2014, at 2:47 AM, Pekka Jääskeläinen <[email protected]>
wrote:
Thanks, modified to use only i8p and committed in
r215629.
Should I backport this to the LLVM 3.5 myself or what is the
current procedure?
On 08/13/2014 06:59 PM, Anastasia Stulova wrote:
Looks good to me. Although, I was just wondering if adding extra constCstr
variable could be avoided? It seems to be fine to just use i8p everywhere.
Anastasia
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Pekka Jääskeläinen
Sent: 13 August 2014 12:59
To: llvm cfe
Subject: Re: [PATCH] OpenCL: blocks crash Clang when using multiple address
spaces
Ping?
It would be nice to get this in to 3.5 to avoid a pocl regression.
Perhaps this was too trivial for a review, but I thought to be extra careful as
I haven't worked on Clang so much.
On 08/07/2014 12:04 PM, Pekka Jääskeläinen wrote:
Hi,
This patch fixes a crash when compiling blocks in OpenCL with multiple
address spaces.
OK to commit this to both trunk and the 3.5 branch?
--
Pekka
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-- IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in
England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2548782
--
Pekka
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
--
--Pekka
Index: lib/CodeGen/CGBlocks.cpp
===================================================================
--- lib/CodeGen/CGBlocks.cpp (revision 215886)
+++ lib/CodeGen/CGBlocks.cpp (working copy)
@@ -78,7 +78,13 @@
ASTContext &C = CGM.getContext();
llvm::Type *ulong = CGM.getTypes().ConvertType(C.UnsignedLongTy);
- llvm::Type *i8p = CGM.getTypes().ConvertType(C.VoidPtrTy);
+ llvm::Type *i8p = NULL;
+ if (CGM.getLangOpts().OpenCL)
+ i8p =
+ llvm::Type::getInt8PtrTy(
+ CGM.getLLVMContext(), C.getTargetAddressSpace(LangAS::opencl_constant));
+ else
+ i8p = CGM.getTypes().ConvertType(C.VoidPtrTy);
SmallVector<llvm::Constant*, 6> elements;
Index: test/CodeGen/blocks-opencl.cl
===================================================================
--- test/CodeGen/blocks-opencl.cl (revision 0)
+++ test/CodeGen/blocks-opencl.cl (revision 0)
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -O0 %s -ffake-address-space-map -emit-llvm -o - -fblocks -triple x86_64-unknown-unknown | FileCheck %s
+// This used to crash due to trying to generate a bitcase from a cstring
+// in the constant address space to i8* in AS0.
+
+void dummy(float (^op)(float))
+{
+}
+
+// CHECK: i8 addrspace(3)* getelementptr inbounds ([9 x i8] addrspace(3)* @.str, i32 0, i32 0)
+
+kernel void test_block()
+{
+ float (^X)(float) = ^(float x) { return x + 42.0f; };
+ dummy(X);
+}
+
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits