From 52a6d47ada7269a6cc9c9031cdc412f0fc369954 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 28 Apr 2020 23:31:28 -0700 Subject: [PATCH] [X86] Add initialize function for X86FixupSetCC so that it will show up in print-after-all. --- llvm/lib/Target/X86/X86.h | 1 + llvm/lib/Target/X86/X86FixupSetCC.cpp | 8 +++++--- llvm/lib/Target/X86/X86TargetMachine.cpp | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/X86/X86.h b/llvm/lib/Target/X86/X86.h index 52dec39..cf2f674 100644 --- a/llvm/lib/Target/X86/X86.h +++ b/llvm/lib/Target/X86/X86.h @@ -156,6 +156,7 @@ void initializeX86CondBrFoldingPassPass(PassRegistry &); void initializeX86DomainReassignmentPass(PassRegistry &); void initializeX86ExecutionDomainFixPass(PassRegistry &); void initializeX86ExpandPseudoPass(PassRegistry &); +void initializeX86FixupSetCCPassPass(PassRegistry &); void initializeX86FlagsCopyLoweringPassPass(PassRegistry &); void initializeX86LoadValueInjectionRetHardeningPassPass(PassRegistry &); void initializeX86OptimizeLEAPassPass(PassRegistry &); diff --git a/llvm/lib/Target/X86/X86FixupSetCC.cpp b/llvm/lib/Target/X86/X86FixupSetCC.cpp index 924f429..09668d7 100644 --- a/llvm/lib/Target/X86/X86FixupSetCC.cpp +++ b/llvm/lib/Target/X86/X86FixupSetCC.cpp @@ -36,6 +36,8 @@ STATISTIC(NumSubstZexts, "Number of setcc + zext pairs substituted"); namespace { class X86FixupSetCCPass : public MachineFunctionPass { public: + static char ID; + X86FixupSetCCPass() : MachineFunctionPass(ID) {} StringRef getPassName() const override { return "X86 Fixup SetCC"; } @@ -47,12 +49,12 @@ private: const X86InstrInfo *TII = nullptr; enum { SearchBound = 16 }; - - static char ID; }; +} // end anonymous namespace char X86FixupSetCCPass::ID = 0; -} + +INITIALIZE_PASS(X86FixupSetCCPass, DEBUG_TYPE, DEBUG_TYPE, false, false) FunctionPass *llvm::createX86FixupSetCC() { return new X86FixupSetCCPass(); } diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index b2551b6..93d727b 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -73,6 +73,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeX86Target() { initializeEvexToVexInstPassPass(PR); initializeFixupLEAPassPass(PR); initializeFPSPass(PR); + initializeX86FixupSetCCPassPass(PR); initializeX86CallFrameOptimizationPass(PR); initializeX86CmovConverterPassPass(PR); initializeX86ExpandPseudoPass(PR); -- 2.7.4