[llvm-commits] Patch to generalize .weak_definition directive in MCAsmStreamer

Jim Grosbach grosbach at apple.com
Fri Oct 19 10:13:01 PDT 2012


Keeping the patches separate is a good thing. It looks like XCore redefines the directive using the same hook you're doing here. Perhaps you could use that for the test case for the general patch?

Alternatively, the NVPTX specific patch could go in first, with a test case for the code-paths that go through emitLinkageDirective(). Then you could add the target-independent patch to fix the generic asm streamer and the necessary support for NVPTX's weak directive will be there to use.

-Jim

On Oct 18, 2012, at 5:19 PM, Dmitry N. Mikushin <maemarcus at gmail.com> wrote:

> Hi Jim,
> 
> I was about to send another small patch containing necessary changes
> on NVPTX side:
> 
> ===
> [NVPTX] Adding support for .weak directive (PTX ISA 3.1)
> 
> Dear all,
> 
> This patch aims to add basic support for .weak directive in NVPTX
> backend. The PTX version string is changed from 3.0 to 3.1, .weak is
> added to function header, and the default placement of weak directive
> is commented out in the same way as it is already done for
> .globl/.global.
> 
> Note this change also depends on the patch
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121015/153758.html
> 
> Please see the patch attached.
> 
> - D.
> ===
> 
> Should I combine these two patches into one, along with tests?
> 
> Thanks,
> - D.
> 
> 2012/10/19 Jim Grosbach <grosbach at apple.com>:
>> Seems reasonable, but please make sure there's existing test cases for the default format (to make sure this doesn't regress those) and add a new test case for NVPTX to make sure we do it right for that (probably in test/CodeGen/NVPTX).
>> 
>> -Jim
>> 
>> On Oct 18, 2012, at 4:47 PM, "Dmitry N. Mikushin" <maemarcus at gmail.com> wrote:
>> 
>>> Dear all,
>>> 
>>> In NVPTX backend it is illegal to generate .weak_definition directive
>>> in its default format. In order to let the target provide its own
>>> implementation of this directive, MCAsmStreamer should emit
>>> MAI.getWeakDefDirective() instead of hard-coded
>>> "\t.weak_definition\t", in the same way as it is already done for
>>> .globl/.global.
>>> 
>>> Please see the attached patch.
>>> 
>>> Thanks,
>>> - D.
>>> <weak_definition.patch>_______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
> <nvptx.weak.patch>




More information about the llvm-commits mailing list