[llvm] [BOLT] hugify: fix conflict with --no-huge-pages (PR #205497)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 04:19:29 PDT 2026


================
@@ -158,7 +158,16 @@ BinaryContext::BinaryContext(std::unique_ptr<MCContext> Ctx,
       MIA(std::move(MIA)), MIB(std::move(MIB)), MRI(std::move(MRI)),
       DisAsm(std::move(DisAsm)), Logger(Logger), InitialDynoStats(isAArch64()) {
   RegularPageSize = isAArch64() ? RegularPageSizeAArch64 : RegularPageSizeX86;
-  PageAlign = opts::NoHugePages ? RegularPageSize : HugePageSize;
+  if (opts::Hugify) {
+    PageAlign = HugePageSize;
+    if (opts::NoHugePages) {
+      this->errs() << "BOLT-WARNING: a conflict between --hugify and "
----------------
DmitriiMartynov wrote:

@paschalis-mpeis @aaupov I also thought about `adjustCommandLineOptions()`. However, the function is executed after the first usage of `BC->PageAlign` in `discoverStorage()`.

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


More information about the llvm-commits mailing list