[llvm] Use sizeWithoutDebugLargerThan when considering outlining (PR #85539)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 16 09:47:54 PDT 2024


https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/85539

>From ad9e03b3632711f53821c03744305010d944a9f8 Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Sat, 16 Mar 2024 12:00:40 -0400
Subject: [PATCH] Use sizeWithoutDebugLargerThan when considering outlining

---
 llvm/lib/CodeGen/MachineOutliner.cpp                        | 2 +-
 llvm/test/CodeGen/AArch64/machine-outliner-mapper-stats.mir | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index dc2f5ef15206e8..22352776fab0ec 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1032,7 +1032,7 @@ void MachineOutliner::populateMapper(InstructionMapper &Mapper, Module &M,
       // contain something worth outlining.
       // FIXME: This should be based off of the maximum size in B of an outlined
       // call versus the size in B of the MBB.
-      if (MBB.size() < MinMBBSize) {
+      if (!MBB.sizeWithoutDebugLargerThan(MinMBBSize - 1)) {
         LLVM_DEBUG(dbgs() << "    SKIP: MBB size less than minimum size of "
                           << MinMBBSize << "\n");
         continue;
diff --git a/llvm/test/CodeGen/AArch64/machine-outliner-mapper-stats.mir b/llvm/test/CodeGen/AArch64/machine-outliner-mapper-stats.mir
index 4cb8e8c10c2414..22bd61d65275fe 100644
--- a/llvm/test/CodeGen/AArch64/machine-outliner-mapper-stats.mir
+++ b/llvm/test/CodeGen/AArch64/machine-outliner-mapper-stats.mir
@@ -3,7 +3,7 @@
 
 # CHECK: 2 machine-outliner - Unoutlinable instructions mapped + number of sentinel values
 # CHECK: 2 machine-outliner - Invisible instructions skipped during mapping
-# CHECK: 4 machine-outliner - Outlinable instructions mapped
+# CHECK: 3 machine-outliner - Outlinable instructions mapped
 # CHECK: 1 machine-outliner - Sentinel values inserted during mapping
 # CHECK: 5 machine-outliner - Total number of instructions mapped and saved to mapping vector
 



More information about the llvm-commits mailing list