[llvm-dev] Look up table in function section

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Thu May 4 11:10:18 PDT 2017


On 5/4/2017 11:08 AM, Friedman, Eli via llvm-dev wrote:
> On 5/4/2017 10:36 AM, Sumanth Gundapaneni via llvm-dev wrote:
>>
>> I have legit requirement to keep the switch generated lookup table in 
>> function section.
>>
>> The lookup table is being generated in SimplifyCFG pass and is 
>> treated as a global.
>>
>> Is there a good way to mark these lookup tables and recognize them 
>> later to keep them in function sections.
>>
>
> There are target hooks to suppress the generation of lookup tables, if 
> you need that.  See shouldBuildLookupTables and 
> shouldBuildLookupTablesForConstant in TargetTransformInfo.  If you 
> need something beyond that, you'll have to modify the transform. You 
> can set a section on a global, but it sounds like that isn't what you 
> want?
>
> In terms of putting IR globals into a function, the only precedent I 
> can think of is the arm-constant-promote transform.

Err, sorry, I meant "arm-promote-constant"; see promoteToConstantPool in 
ARMISelLowering.cpp.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170504/80ee9c05/attachment.html>


More information about the llvm-dev mailing list