aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorEllis Hoag <ellis.sparky.hoag@gmail.com>2024-10-28 09:45:03 -0700
committerGitHub <noreply@github.com>2024-10-28 09:45:03 -0700
commit6ab26eab4f1e06f2da7b3183c55666ad57f8866e (patch)
tree8d58cecc95cfea7a335f12e325e952263cb3db3e /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parent92412c106f5275b4b385f7c2d882008181de2854 (diff)
downloadllvm-6ab26eab4f1e06f2da7b3183c55666ad57f8866e.zip
llvm-6ab26eab4f1e06f2da7b3183c55666ad57f8866e.tar.gz
llvm-6ab26eab4f1e06f2da7b3183c55666ad57f8866e.tar.bz2
Check hasOptSize() in shouldOptimizeForSize() (#112626)
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index dd5220b..d1dced9 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -2189,9 +2189,7 @@ MachineBlockPlacement::findBestLoopTop(const MachineLoop &L,
// i.e. when the layout predecessor does not fallthrough to the loop header.
// In practice this never happens though: there always seems to be a preheader
// that can fallthrough and that is also placed before the header.
- bool OptForSize = F->getFunction().hasOptSize() ||
- llvm::shouldOptimizeForSize(L.getHeader(), PSI, MBFI.get());
- if (OptForSize)
+ if (llvm::shouldOptimizeForSize(L.getHeader(), PSI, MBFI.get()))
return L.getHeader();
MachineBasicBlock *OldTop = nullptr;
@@ -3511,7 +3509,6 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
initTailDupThreshold();
const bool OptForSize =
- MF.getFunction().hasOptSize() ||
llvm::shouldOptimizeForSize(&MF, PSI, &MBFI->getMBFI());
// Determine whether to use ext-tsp for perf/size optimization. The method
// is beneficial only for instances with at least 3 basic blocks and it can be