On 11/20/2013 11:37 PM, Erik Schnetter wrote:
> Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function 
> Create, file /Users/eschnett/src/llvm-3.4/lib/IR/Instructions.cpp, line 2352.

In fact, looking at this assertion several double espressos
later, it seems to be related to casting pointers between
address spaces instead of the -ffake-address-space-map itself.

There has been some activity regarding to this in LLVM trunk.
In OpenCL 2.0 it is possible to cast between ASs (to and from
the 'generic' address space).

Thus, perhaps there are now better checks that catch this
case which was previously ignored silently.

The pointer parameter to __atomic_exchange_n is
probably in AS 0 so it tries to cast the __global ptr to
it and fails.

int atomic_xchg(volatile __global int *p, int val)
{
   return __atomic_exchange_n(p, val, __ATOMIC_RELAXED);
}

Therefore, it's not the -ffake-address-space-map itself, but it
just exposes the casting problem. Without it, the __global will
map also to AS0 and hides the cast issue. Thus, this might
affect only the built-ins that call the LLVM-built-ins with
AS0 pointers.

-- 
Pekka

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to