[LLVMdev] [NVPTX] llc -march=nvptx64 -mcpu=sm_20 generates invalid zero align for device function params

Duncan Sands
Fri, 09 Nov 2012 12:55:17 -0000

Hi Dmitry,

 > I'm attaching a patch that should fix the issue mentioned above.
It
> simply makes the same check seen in the same file for global
> variables:
>
>    emitPTXAddressSpace(PTy->getAddressSpace(), O);
>    if (GVar->getAlignment() == 0)
>      O << " .align " << (int)
TD->getPrefTypeAlignment(ETy);
>    else
>      O << " .align " << GVar->getAlignment();

it's not quite the same because your patch uses the ABI alignment, while
in this snippet it is the preferred alignment (which is usually the same
as the ABI alignment, but may be bigger).

> Could you please review and commit? Do you think it needs a test case?

Yes, it needs a testcase.

Ciao, Duncan.