summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FixupBWInsts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/X86FixupBWInsts.cpp')
-rw-r--r--llvm/lib/Target/X86/X86FixupBWInsts.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/llvm/lib/Target/X86/X86FixupBWInsts.cpp b/llvm/lib/Target/X86/X86FixupBWInsts.cpp
index 045a4ed8dca..ad152824c18 100644
--- a/llvm/lib/Target/X86/X86FixupBWInsts.cpp
+++ b/llvm/lib/Target/X86/X86FixupBWInsts.cpp
@@ -60,7 +60,10 @@
#include "llvm/Target/TargetInstrInfo.h"
using namespace llvm;
-#define DEBUG_TYPE "x86-fixup-bw-insts"
+#define FIXUPBW_DESC "X86 Byte/Word Instruction Fixup"
+#define FIXUPBW_NAME "x86-fixup-bw-insts"
+
+#define DEBUG_TYPE FIXUPBW_NAME
// Option to allow this optimization pass to have fine-grained control.
// This is turned off by default so as not to affect a large number of
@@ -72,12 +75,6 @@ static cl::opt<bool>
namespace {
class FixupBWInstPass : public MachineFunctionPass {
- static char ID;
-
- const char *getPassName() const override {
- return "X86 Byte/Word Instruction Fixup";
- }
-
/// Loop over all of the instructions in the basic block replacing applicable
/// byte or word instructions with better alternatives.
void processBasicBlock(MachineFunction &MF, MachineBasicBlock &MBB);
@@ -94,7 +91,15 @@ class FixupBWInstPass : public MachineFunctionPass {
MachineInstr *tryReplaceLoad(unsigned New32BitOpcode, MachineInstr *MI) const;
public:
- FixupBWInstPass() : MachineFunctionPass(ID) {}
+ static char ID;
+
+ const char *getPassName() const override {
+ return FIXUPBW_DESC;
+ }
+
+ FixupBWInstPass() : MachineFunctionPass(ID) {
+ initializeFixupBWInstPassPass(*PassRegistry::getPassRegistry());
+ }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<MachineLoopInfo>(); // Machine loop info is used to
@@ -130,6 +135,8 @@ private:
char FixupBWInstPass::ID = 0;
}
+INITIALIZE_PASS(FixupBWInstPass, FIXUPBW_NAME, FIXUPBW_DESC, false, false)
+
FunctionPass *llvm::createX86FixupBWInsts() { return new FixupBWInstPass(); }
bool FixupBWInstPass::runOnMachineFunction(MachineFunction &MF) {
OpenPOWER on IntegriCloud