| 24 | namespace opt { |
| 25 | |
| 26 | Pass::Status CodeSinkingPass::Process() { |
| 27 | bool modified = false; |
| 28 | for (Function& function : *get_module()) { |
| 29 | cfg()->ForEachBlockInPostOrder(function.entry().get(), |
| 30 | [&modified, this](BasicBlock* bb) { |
| 31 | if (SinkInstructionsInBB(bb)) { |
| 32 | modified = true; |
| 33 | } |
| 34 | }); |
| 35 | } |
| 36 | return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; |
| 37 | } |
| 38 | |
| 39 | bool CodeSinkingPass::SinkInstructionsInBB(BasicBlock* bb) { |
| 40 | bool modified = false; |
nothing calls this directly
no test coverage detected