[PATCH] D38355: [X86][NFC] Add X86CmovConverterPass to the pass registry
Amjad Aboud via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 2 10:03:36 PDT 2017
aaboud updated this revision to Diff 117380.
aaboud added a comment.
Addressed Craig comment.
https://reviews.llvm.org/D38355
Files:
lib/Target/X86/X86CmovConversion.cpp
lib/Target/X86/X86TargetMachine.cpp
Index: lib/Target/X86/X86CmovConversion.cpp
===================================================================
--- lib/Target/X86/X86CmovConversion.cpp
+++ lib/Target/X86/X86CmovConversion.cpp
@@ -53,13 +53,17 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-#define DEBUG_TYPE "x86-cmov-converter"
+#define DEBUG_TYPE "x86-cmov-conversion"
STATISTIC(NumOfSkippedCmovGroups, "Number of unsupported CMOV-groups");
STATISTIC(NumOfCmovGroupCandidate, "Number of CMOV-group candidates");
STATISTIC(NumOfLoopCandidate, "Number of CMOV-conversion profitable loops");
STATISTIC(NumOfOptimizedCmovGroups, "Number of optimized CMOV-groups");
+namespace llvm {
+ void initializeX86CmovConverterPassPass(PassRegistry &);
+}
+
namespace {
// This internal switch can be used to turn off the cmov/branch optimization.
static cl::opt<bool>
@@ -87,10 +91,11 @@
bool runOnMachineFunction(MachineFunction &MF) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
-private:
/// Pass identification, replacement for typeid.
static char ID;
+private:
+
MachineRegisterInfo *MRI;
const TargetInstrInfo *TII;
const TargetRegisterInfo *TRI;
@@ -125,8 +130,6 @@
void convertCmovInstsToBranches(SmallVectorImpl<MachineInstr *> &Group) const;
};
-char X86CmovConverterPass::ID = 0;
-
void X86CmovConverterPass::getAnalysisUsage(AnalysisUsage &AU) const {
MachineFunctionPass::getAnalysisUsage(AU);
AU.addRequired<MachineLoopInfo>();
@@ -797,6 +800,14 @@
} // End anonymous namespace.
+char X86CmovConverterPass::ID = 0;
+
+INITIALIZE_PASS_BEGIN(X86CmovConverterPass, DEBUG_TYPE, "X86 cmov Conversion",
+ false, false)
+INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
+INITIALIZE_PASS_END(X86CmovConverterPass, DEBUG_TYPE, "X86 cmov Conversion",
+ false, false)
+
FunctionPass *llvm::createX86CmovConverterPass() {
return new X86CmovConverterPass();
}
Index: lib/Target/X86/X86TargetMachine.cpp
===================================================================
--- lib/Target/X86/X86TargetMachine.cpp
+++ lib/Target/X86/X86TargetMachine.cpp
@@ -58,6 +58,7 @@
void initializeWinEHStatePassPass(PassRegistry &);
void initializeFixupLEAPassPass(PassRegistry &);
+void initializeX86CmovConverterPassPass(PassRegistry &);
void initializeX86ExecutionDepsFixPass(PassRegistry &);
} // end namespace llvm
@@ -73,6 +74,7 @@
initializeFixupBWInstPassPass(PR);
initializeEvexToVexInstPassPass(PR);
initializeFixupLEAPassPass(PR);
+ initializeX86CmovConverterPassPass(PR);
initializeX86ExecutionDepsFixPass(PR);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38355.117380.patch
Type: text/x-patch
Size: 2697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171002/67950115/attachment.bin>
More information about the llvm-commits
mailing list