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

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 08:23:03 PDT 2023


MaskRay added inline comments.
Herald added subscribers: jobnoorman, luke, pcwang-thead, eopXD, VincentWu, vkmr, frasercrmck, arichardson.
Herald added a project: All.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1970
+  // Get small data limitation.
+  if (Args.getLastArg(options::OPT_shared, options::OPT_fpic,
+                      options::OPT_fPIC)) {
----------------
There are multiple issues. With `-fpic -fpic`, this will give a warning when `-msmall-data-limit=N` is specified, which is undesired.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1978
+  } else if (Args.getLastArgValue(options::OPT_mcmodel_EQ)
+                 .equals_lower("large") &&
+             (Triple.getArch() == llvm::Triple::riscv64)) {
----------------
`-mcmodel=Large` is rejected. We don't need to use `equals_lower`.


================
Comment at: clang/test/CodeGen/riscv-sdata-module-flag.c:1
+// RUN: %clang -target riscv32-unknown-elf %s -S -emit-llvm -o - \
+// RUN:   | FileCheck %s -check-prefix=RV32-DEFAULT
----------------
test/CodeGen tests usually use `%clang_cc1`, not `%clang`.

Many tests here test the driver behavior and should be placed into `test/Driver`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57497



More information about the cfe-commits mailing list