[PATCH] D129817: [SelectOpti] Auto-disable other cmov optis when the new select-opti pass is enabled

Sotiris Apostolakis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 17:27:30 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG995b61cdacaa: [SelectOpti] Auto-disable other cmov optis when the new select-opti pass is… (authored by apostolakis).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129817

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/Target/X86/X86CmovConversion.cpp


Index: llvm/lib/Target/X86/X86CmovConversion.cpp
===================================================================
--- llvm/lib/Target/X86/X86CmovConversion.cpp
+++ llvm/lib/Target/X86/X86CmovConversion.cpp
@@ -67,6 +67,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Target/CGPassBuilderOption.h"
 #include <algorithm>
 #include <cassert>
 #include <iterator>
@@ -167,6 +168,10 @@
   if (!EnableCmovConverter)
     return false;
 
+  // If the SelectOptimize pass is enabled, cmovs have already been optimized.
+  if (!getCGPassBuilderOption().DisableSelectOptimize)
+    return false;
+
   LLVM_DEBUG(dbgs() << "********** " << getPassName() << " : " << MF.getName()
                     << "**********\n");
 
Index: llvm/lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -6741,6 +6741,10 @@
   if (DisableSelectToBranch)
     return false;
 
+  // If the SelectOptimize pass is enabled, selects have already been optimized.
+  if (!getCGPassBuilderOption().DisableSelectOptimize)
+    return false;
+
   // Find all consecutive select instructions that share the same condition.
   SmallVector<SelectInst *, 2> ASI;
   ASI.push_back(SI);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129817.449158.patch
Type: text/x-patch
Size: 1359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220802/684b14ff/attachment.bin>


More information about the llvm-commits mailing list