[llvm-dev] [RFC] Passing target module flag with LTO enabled
Shiva Chen via llvm-dev
llvm-dev at lists.llvm.org
Wed Feb 13 00:58:20 PST 2019
We would like to implement -msmall-data-limit=<arg> flag for RISC-V target.
The flag will set the small data limitation for global and static
variables. If the data is equal or smaller than the limitation, it will put
into the small data section. But the flag will be no effect when the LTO
enabled. The patch is under review.
One possible solution is passing target flag through the LTO plugin
interface, the other could be storing the flag in IR and then read by the
backend. Given that the flag influences the global variables, Eli pointed
out that it should not be a function flag. Arm and AArch64 have a similar
flag -mglobal-merge which will influence global variables. The relative
patch store the flag as a module metadata to pass through LTO.
We’d like to get your feedback, in how to pass through the flag.
1. LTO interface
2. Module metadata
3. Other way represented in IR?
 [RISCV] Passing small data limitation value to RISCV backend
 Pass -mglobal-merge as a module flag metadata.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev