[llvm-branch-commits] LowerTypeTests: Set small code model on imported globals. (PR #141324)

Peter Collingbourne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue May 27 12:24:09 PDT 2025


================
@@ -1019,8 +1019,14 @@ LowerTypeTestsModule::importTypeId(StringRef TypeId) {
     return C;
   };
 
-  if (TIL.TheKind != TypeTestResolution::Unsat)
-    TIL.OffsetedGlobal = ImportGlobal("global_addr");
+  if (TIL.TheKind != TypeTestResolution::Unsat) {
+    auto *GV = ImportGlobal("global_addr");
+    // This is either a vtable (in .data.rel.ro) or a jump table (in .text).
+    // Either way it's expected to be in the low 2 GiB, so set the small code
----------------
pcc wrote:

Added comment with an explanation.

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


More information about the llvm-branch-commits mailing list