[PATCH] D59514: [PGO] Profile guided code size optimization.

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 10:55:07 PDT 2019


eraman accepted this revision.
eraman added a comment.
This revision is now accepted and ready to land.

LGTM after making the hasProfileSummary check consistent in both flavors of shouldOptimizeForSize



================
Comment at: lib/Transforms/Utils/SizeOpts.cpp:34
+  assert(BB);
+  if (!PSI || !BFI || !PSI->hasProfileSummary())
+    return false;
----------------
The previous flavor of this function doesn't check !PSI->hasProfileSummary(). In both the versions, it is not necessary as isColdBlock and isFunctionColdInCallGraph return false if there is no summary. But if you choose to add the check, then do it in both the flavors of this function. 


================
Comment at: test/Transforms/ConstantHoisting/ARM/const-addr-no-neg-offset.ll:3
+; RUN: opt -mtriple=arm-arm-none-eabi -consthoist -pgso -S < %s | FileCheck %s -check-prefix=PGSO
+; RUN: opt -mtriple=arm-arm-none-eabi -consthoist -pgso=false -S < %s | FileCheck %s -check-prefix=NPGSO
 
----------------
You don't need a separate run with explicit -pgso=false. You can use the first run and use CHECK and CHECK-LABEL where you use NPGSO and NPGO-LABEL . That's what I had in mind, but if you prefer this, it's fine.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59514





More information about the llvm-commits mailing list