[PATCH 1/1] R600: Use TargetConstant in LowerConstantInitializer

Matt Arsenault arsenm2 at gmail.com
Wed May 21 09:30:28 PDT 2014


On May 21, 2014, at 2:28 AM, Matt Arsenault <arsenm2 at gmail.com> wrote:

> 
> 
> So I think this is sort of correct, but I don’t know why this function is doing what it’s doing. I’m pretty sure you don’t want to use TargetConstant to fix this. It’s copying the constant initializer onto the “stack”, but expanding it into a legal type so the private memory copy doesn’t have the exact same layout as in the constant. I don’t know if that’s OK or not since I don’t know why this is copying it.
> 
> Besides that, I think it would be better to get the type to use with TLI.getRegisterType() rather than using getSmallestLegalIntType. You should also keep the variable as MVT since you’re trying to only use legal types here.
> 

I think the copying is a workaround for not supporting really setting up the constant buffer. The constant initializer should really be copied into some data section of the binary, and the runtime should load the data into a buffer the kernel will read from, but that seems to not be implemented.

- Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140521/f08e2a3c/attachment.html>


More information about the llvm-commits mailing list