[PATCH] D141970: [Clang][LLD] Add --lto-CGO[0-3] option

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 11:49:52 PST 2023


pcc added inline comments.


================
Comment at: lld/Common/Args.cpp:20
 
-// TODO(sbc): Remove this once CGOptLevel can be set completely based on bitcode
-// function metadata.
----------------
This is still the preferred approach.


================
Comment at: lld/ELF/Driver.cpp:1143
+  config->ltocgo =
+      *CodeGenOpt::getLevel(args::getInteger(args, OPT_lto_CGO, config->ltoo));
   config->ltoObjPath = args.getLastArgValue(OPT_lto_obj_path_eq);
----------------
It looks like this is setting the CG opt level based on the LTO opt level, which is undesirable for the reasons mentioned in D57422. Let's keep the existing logic for determining the default CG opt level.


================
Comment at: llvm/include/llvm/ADT/Unwrap.h:1
+//===- llvm/ADT/Unwrap.h - Function to assert-and-deref ---------*- C++ -*-===//
+//
----------------
It doesn't look like you're using this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141970



More information about the llvm-commits mailing list