[llvm] [X86] Place data in large sections for large code model (PR #70265)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 15:17:17 PST 2023


================
@@ -42,9 +42,8 @@ TargetMachine::~TargetMachine() = default;
 bool TargetMachine::isLargeData(const GlobalVariable *GV) const {
   if (getTargetTriple().getArch() != Triple::x86_64 || GV->isThreadLocal())
     return false;
-  // Large data under the large code model still needs to be thought about, so
-  // restrict this to medium.
-  if (getCodeModel() != CodeModel::Medium)
+
+  if (getCodeModel() != CodeModel::Medium && getCodeModel() != CodeModel::Large)
----------------
rnk wrote:

What controls the default for the large data size threshold, under the large code model? I think we discussed making it zero, so effectively all globals will be large data under the large code model, which sounds like the right behavior. I don't know which way GCC went on that.

I think we want to keep the .bss/.data/.rodata prefix checks, even under the large code model. I expect folks to mix large and small code, and we don't want to accidentally make small sections large.

https://github.com/llvm/llvm-project/pull/70265


More information about the llvm-commits mailing list