From d36410945fc636cafc859df6bec56affe2505557 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 28 Feb 2017 00:33:32 +0000 Subject: Add MIR-level outlining pass This is a patch for the outliner described in the RFC at: http://lists.llvm.org/pipermail/llvm-dev/2016-August/104170.html The outliner is a code-size reduction pass which works by finding repeated sequences of instructions in a program, and replacing them with calls to functions. This is useful to people working in low-memory environments, where sacrificing performance for space is acceptable. This adds an interprocedural outliner directly before printing assembly. For reference on how this would work, this patch also includes X86 target hooks and an X86 test. The outliner is run like so: clang -mno-red-zone -mllvm -enable-machine-outliner file.c Patch by Jessica Paquette! rdar://29166825 Differential Revision: https://reviews.llvm.org/D26872 llvm-svn: 296418 --- llvm/lib/CodeGen/CodeGen.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/CodeGen/CodeGen.cpp') diff --git a/llvm/lib/CodeGen/CodeGen.cpp b/llvm/lib/CodeGen/CodeGen.cpp index da4d7c992b06..6afd9648dd10 100644 --- a/llvm/lib/CodeGen/CodeGen.cpp +++ b/llvm/lib/CodeGen/CodeGen.cpp @@ -57,6 +57,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) { initializeMachineLoopInfoPass(Registry); initializeMachineModuleInfoPass(Registry); initializeMachineOptimizationRemarkEmitterPassPass(Registry); + initializeMachineOutlinerPass(Registry); initializeMachinePipelinerPass(Registry); initializeMachinePostDominatorTreePass(Registry); initializeMachineRegionInfoPassPass(Registry); -- cgit v1.2.3