[PATCH] D149288: [X86] Introduce a large data threshold for the medium code model

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 08:27:58 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/lib/CodeGen/CommandFlags.cpp:168
+      cl::desc("Choose large data threshold for x86_64 medium code model"),
+      cl::init(0));
+  CGBINDOPT(LargeDataThreshold);
----------------
To match GCC, we can use 65536

Consider applying this to large code model as well.

https://gcc.gnu.org/pipermail/gcc-patches/2023-May/619695.html


================
Comment at: llvm/lib/Target/TargetMachine.cpp:51
+  uint64_t Size = DL.getTypeSizeInBits(GV->getValueType()) / 8;
+  return Size == 0 || Size >= LargeDataThreshold;
 }
----------------
I think GCC's condition is `>` instead of `>=`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149288



More information about the llvm-commits mailing list