<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>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[1].</div><div><br></div><div>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[2] store the flag as a module metadata to pass through LTO.  </div><div><br></div><div>We’d like to get your feedback, in how to pass through the flag.</div><div>1. LTO interface</div><div>2. Module metadata</div><div>3. Other way represented in IR? <br></div><div><br></div><div>Thanks,</div><div>Shiva</div><div><br></div><div>References</div><div>[1] [RISCV] Passing small data limitation value to RISCV backend  <a href="https://reviews.llvm.org/D57497">https://reviews.llvm.org/D57497</a></div><div>[2] Pass -mglobal-merge as a module flag metadata.  <a href="https://reviews.llvm.org/D7968">https://reviews.llvm.org/D7968</a></div><div class="gmail-phui-header-col2" style="margin:0px;padding:0px;border:0px;display:table-cell;vertical-align:middle;word-break:break-word;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:700"></div><br class="gmail-Apple-interchange-newline"><div class="gmail-phui-header-col2" style="margin:0px;padding:0px;border:0px;display:table-cell;vertical-align:middle;word-break:break-word"><br></div></div></div></div></div>