From bf5e3e4391077fbb44867d8e5adfa123a828a19d Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 13 Mar 2017 19:47:53 +0000 Subject: AMDGPU: Make 0 the private nullptr value We can't actually pretend that 0 is valid for address space 0. r295877 added a workaround to stop allocating user objects there, so we can use 0 as the invalid pointer. Some of the tests seemed to be using private as the non-0 null test address space, so add copies using local to make sure this is still stressed. llvm-svn: 297659 --- clang/lib/Basic/Targets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib') diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index e23ff3cc380..21d9ea13ea9 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -2298,7 +2298,7 @@ public: // address space has value 0 but in private and local address space has // value ~0. uint64_t getNullPointerValue(unsigned AS) const override { - return AS != LangAS::opencl_local && AS != 0 ? 0 : ~0; + return AS == LangAS::opencl_local ? ~0 : 0; } }; -- cgit v1.2.3