Displaying 2 results from an estimated 2 matches for "arrtest".
Did you mean:
arrest
2013 Feb 09
2
[LLVMdev] C-to-PTX compilation issues
...l -print-after-all
-time-passes
1. Only programs that make no use of arrays appear to always be
processed correctly by llc (nvptx target). Some programs using arrays,
make llc "hang" (runs endlessly).
2. One small C function exposing this behavior is as follows:
// start here
int arrtest (int x, int y) {
unsigned char b[3]={0x10,0x30,0x55};
b[0] = (255 - b[x]) + b[y]; // doesn't work!
// b[0] = (255 - b[0]) + b[1]; // works
b[1] = x - y;
b[2] = x * y;
return b[0];
}
// end here
3. A change that makes this function compilable (also visible in the comments)
Ch...
2013 Feb 09
0
[LLVMdev] C-to-PTX compilation issues
...ess space 0. In the
back-end, address space 0 is the PTX generic address space and global
variables cannot use it. The index computations are not causing this
issue. The following change would work:
// start here
__attribute__((address_space(3)))
static unsigned char b[3]={0x10,0x30,0x55};
int arrtest (int x, int y) {
b[0] = (255 - b[x]) + b[y]; // now it works!
// b[0] = (255 - b[0]) + b[1]; // works
b[1] = x - y;
b[2] = x * y;
return b[0];
}
// end here
If you compile LLVM in debug mode, you would have seen a failure about an
unknown address space. I just committed a change in r17...