|5155 ↗||(On Diff #107168)|
Just use Fn->getName() below directly.
|5157 ↗||(On Diff #107168)|
...and the attribute "..." is not set.
|60 ↗||(On Diff #107168)|
Can you reduce this further?
|29 ↗||(On Diff #107168)|
Since this is a bit fragile when it comes to other optimizations deciding to merge the ranges, can you test the reverse as well? I.e. that it is turned into a lookup table when just the attribute is missing.
For backends with "tightly coupled memory", in scenarios where the data is far away from text pays a good amount of penalty in terms of latency.
Hexagon is one such backend. The tables (both lookup and jump) which are being generated are treated as globals with internal linkage and by default
will be placed in read only data.
Interestingly when programmers specify the command line flag "-fno-jump-tables", they assume there is no data that goes in to other sections.
In case of llvm, the attribute "no-jump-tables" has no effect on simplifyCFG which generates the lookup table. This leads me to introduce "no-lookup-tables"
It looks like TargetTransformInfo already has a hook, shouldBuildLookupTables(), for disabling this optimization. Why not just set that to false for Hexagon?
TCM is often small and you don't want to either enable or disable the table generation for a specific backend. As of today,
hexagon-emit-lookup-tables llvm flag control the generation of lookup tables for hexagon backend.
The real problem here is , I do not want the user to use a combination of front end and backend flags to get the desired result.
We have decided to have this feature under "-fno-jump-tables" clang flag.
To this affect, this patch updates the code to control the generation of
lookup tables based on the attribute "no-jump-tables"
"Generate lookup tables based on a function attribute" is not very descriptive. How about "Make the no-jump-tables attribute also disable switch lookup tables"?
Also it makes me sad that the attribute isn't documented anywhere. Would you like to look into that, possible as a follow-up patch?
|5155 ↗||(On Diff #108516)|
There doesn't seem to be any need to move FuncName up here anymore, since it's not used until further down.