Chris Lattner | cf3056d | 2003-10-13 03:32:08 +0000 | [diff] [blame] | 1 | //===-- ModuloScheduling.cpp - Software Pipeling Approach - SMS -----------===// |
John Criswell | b576c94 | 2003-10-20 19:43:21 +0000 | [diff] [blame^] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Guochun Shi | f1c154f | 2003-03-27 17:57:44 +0000 | [diff] [blame] | 9 | // |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 10 | // The is a software pipelining pass based on the Swing Modulo Scheduling |
Misha Brukman | aa41c3c | 2003-10-10 17:41:32 +0000 | [diff] [blame] | 11 | // algorithm (SMS). |
Guochun Shi | f1c154f | 2003-03-27 17:57:44 +0000 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Misha Brukman | 8baa01c | 2003-04-09 21:51:34 +0000 | [diff] [blame] | 15 | #include "ModuloSchedGraph.h" |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 16 | #include "llvm/Function.h" |
Misha Brukman | aa41c3c | 2003-10-10 17:41:32 +0000 | [diff] [blame] | 17 | #include "llvm/Pass.h" |
Guochun Shi | f1c154f | 2003-03-27 17:57:44 +0000 | [diff] [blame] | 18 | |
| 19 | namespace { |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 20 | |
| 21 | class ModuloScheduling : public FunctionPass { |
Guochun Shi | 8f1d4ab | 2003-06-08 23:16:07 +0000 | [diff] [blame] | 22 | |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 23 | public: |
| 24 | virtual bool runOnFunction(Function &F); |
Guochun Shi | f1c154f | 2003-03-27 17:57:44 +0000 | [diff] [blame] | 25 | }; |
Guochun Shi | f1c154f | 2003-03-27 17:57:44 +0000 | [diff] [blame] | 26 | |
Misha Brukman | aa41c3c | 2003-10-10 17:41:32 +0000 | [diff] [blame] | 27 | RegisterOpt<ModuloScheduling> X("modulo-sched", |
| 28 | "Modulo Scheduling/Software Pipelining"); |
Guochun Shi | f1c154f | 2003-03-27 17:57:44 +0000 | [diff] [blame] | 29 | } |
| 30 | |
Misha Brukman | aa41c3c | 2003-10-10 17:41:32 +0000 | [diff] [blame] | 31 | /// Create Modulo Scheduling Pass |
| 32 | /// |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 33 | Pass *createModuloSchedPass() { |
| 34 | return new ModuloScheduling(); |
Guochun Shi | f1c154f | 2003-03-27 17:57:44 +0000 | [diff] [blame] | 35 | } |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 36 | |
Misha Brukman | aa41c3c | 2003-10-10 17:41:32 +0000 | [diff] [blame] | 37 | /// ModuloScheduling::runOnFunction - main transformation entry point |
| 38 | /// |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 39 | bool ModuloScheduling::runOnFunction(Function &F) { |
| 40 | bool Changed = false; |
Tanya Lattner | 4f839cc | 2003-08-28 17:12:14 +0000 | [diff] [blame] | 41 | return Changed; |
| 42 | } |