[llvm] Check hasOptSize() in shouldOptimizeForSize() (PR #112626)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 19 00:45:49 PDT 2024


================
@@ -44,7 +48,9 @@ bool llvm::shouldOptimizeForSize(const MachineBasicBlock *MBB,
                                  MBFIWrapper *MBFIW,
                                  PGSOQueryType QueryType) {
   assert(MBB);
-  if (!PSI || !MBFIW)
+  if (MBB->getParent()->getFunction().hasOptSize())
+    return true;
+  if (!MBFIW)
----------------
nikic wrote:

Was dropping `!PSI` here intentional?

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


More information about the llvm-commits mailing list