[PATCH] D94355: [Passes] Add relative lookup table converter pass

Jessica Clarke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 10 14:52:03 PST 2021


jrtc27 added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:395
+    /// in 64-bit achitectures where 32-bit offsets might not be enough.
+    if (TM.getCodeModel() == CodeModel::Medium ||
+        TM.getCodeModel() == CodeModel::Large)
----------------
The meanings of code models isn't really portable across targets... e.g. RISC-V's medium (underlying LLVM name for -mcmodel=medany) assumes 32-bit PC-relative offsets, and thus using a 32-bit table-relative offset is safe


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94355



More information about the cfe-commits mailing list