[PATCH] D57497: [RISCV] Passing small data limitation value to RISCV backend

Shiva Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 28 06:39:16 PDT 2019


shiva0217 marked an inline comment as done.
shiva0217 added inline comments.


================
Comment at: lib/Driver/ToolChains/Clang.cpp:1813
+    }
+  } else if (Arg *A = Args.getLastArg(options::OPT_G)) {
+    SmallDataLimit = A->getValue();
----------------
apazos wrote:
> Why do you we need to set a default? It will cause the optimization to be on now, and I thought we want to first prioritize the globals we want to consider for the optimization.
> I think you should check for msmall-data-limit flag occurring with G,  fpic and mcmodel flags and print warning in all cases.
Hi Ana,
It seems that RISC-V GCC will set 8 as default value even with -mno-relax.
Another issue is that the sorting scope will be a compile unit. So when linker link the .sdata from objects, it will get globals from object A with usage times from high to low and then the globals from object B with usage times from high to low which probably not we want. The sorting might make sense when the LTO enabled.
I have added the warning message, thanks for the suggestion.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57497/new/

https://reviews.llvm.org/D57497





More information about the cfe-commits mailing list