[PATCH] D18321: Add support for no-jump-tables

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 15:46:26 PDT 2016


The GCC doc for the option is: 



Sent from my iPhone

> On Mar 23, 2016, at 3:10 PM, Hans Wennborg <hans at chromium.org> wrote:
> 
> hans added a comment.
> 
> In http://reviews.llvm.org/D18321#381998, @echristo wrote:
> 
>> So having it as a function attribute was my idea :)
>> 
>> Otherwise, it's a good question. What should happen in LTO when you ask for one translation unit to be compiled without jump table support and the other one to be compiled with jump table support? Which one wins here? For some things it's more obvious, I'm not sure here.
> 
> 
> I suppose it depends on the motivation for this patch. Why would one be compiling with -no-jump-tables? Is it just an optimization thing, or could there be a situation where a jump table would actually not work, despite the target supporting it in general? (Apologies if this is obvious, but it would be great to have it explained in the description of this patch.)

The doc for this option in GCC says:


-fno-jump-tables
Do not use jump tables for switch statements even where it would be more efficient than other code generation strategies. This option is of use in conjunction with -fpic or -fPICfor building code that forms part of a dynamic linker and cannot reference the address of a jump table. On some targets, jump tables do not require a GOT and this option is not needed. 


> 
> 
> http://reviews.llvm.org/D18321
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160323/d72dbacd/attachment.html>


More information about the llvm-commits mailing list