Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Mathieu Chartier | b666f48 | 2015-02-18 14:33:14 -0800 | [diff] [blame] | 17 | #include "base/arena_allocator.h" |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 18 | #include "builder.h" |
| 19 | #include "dex_instruction.h" |
| 20 | #include "nodes.h" |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 21 | #include "optimizing_unit_test.h" |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 22 | |
| 23 | #include "gtest/gtest.h" |
| 24 | |
| 25 | namespace art { |
| 26 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 27 | static void TestCode(const uint16_t* data, const uint32_t* blocks, size_t blocks_length) { |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 28 | ArenaPool pool; |
| 29 | ArenaAllocator allocator(&pool); |
Nicolas Geoffray | 0a23d74 | 2015-05-07 11:57:35 +0100 | [diff] [blame] | 30 | HGraph* graph = CreateGraph(&allocator); |
David Brazdil | 5e8b137 | 2015-01-23 14:39:08 +0000 | [diff] [blame] | 31 | HGraphBuilder builder(graph); |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 32 | const DexFile::CodeItem* item = reinterpret_cast<const DexFile::CodeItem*>(data); |
David Brazdil | 5e8b137 | 2015-01-23 14:39:08 +0000 | [diff] [blame] | 33 | bool graph_built = builder.BuildGraph(*item); |
| 34 | ASSERT_TRUE(graph_built); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 35 | graph->BuildDominatorTree(); |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 36 | ASSERT_EQ(graph->GetBlocks().size(), blocks_length); |
Nicolas Geoffray | 804d093 | 2014-05-02 08:46:00 +0100 | [diff] [blame] | 37 | for (size_t i = 0, e = blocks_length; i < e; ++i) { |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 38 | if (blocks[i] == kInvalidBlockId) { |
Vladimir Marko | ec7802a | 2015-10-01 20:57:57 +0100 | [diff] [blame] | 39 | if (graph->GetBlocks()[i] == nullptr) { |
Nicolas Geoffray | f776b92 | 2015-04-15 18:22:45 +0100 | [diff] [blame] | 40 | // Dead block. |
| 41 | } else { |
| 42 | // Only the entry block has no dominator. |
Vladimir Marko | ec7802a | 2015-10-01 20:57:57 +0100 | [diff] [blame] | 43 | ASSERT_EQ(nullptr, graph->GetBlocks()[i]->GetDominator()); |
| 44 | ASSERT_TRUE(graph->GetBlocks()[i]->IsEntryBlock()); |
Nicolas Geoffray | f776b92 | 2015-04-15 18:22:45 +0100 | [diff] [blame] | 45 | } |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 46 | } else { |
Vladimir Marko | ec7802a | 2015-10-01 20:57:57 +0100 | [diff] [blame] | 47 | ASSERT_NE(nullptr, graph->GetBlocks()[i]->GetDominator()); |
| 48 | ASSERT_EQ(blocks[i], graph->GetBlocks()[i]->GetDominator()->GetBlockId()); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | TEST(OptimizerTest, ReturnVoid) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 54 | const uint16_t data[] = ZERO_REGISTER_CODE_ITEM( |
| 55 | Instruction::RETURN_VOID); // Block number 1 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 56 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 57 | const uint32_t dominators[] = { |
| 58 | kInvalidBlockId, |
| 59 | 0, |
| 60 | 1 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 61 | }; |
| 62 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 63 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | TEST(OptimizerTest, CFG1) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 67 | const uint16_t data[] = ZERO_REGISTER_CODE_ITEM( |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 68 | Instruction::GOTO | 0x100, // Block number 1 |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 69 | Instruction::RETURN_VOID); // Block number 2 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 70 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 71 | const uint32_t dominators[] = { |
| 72 | kInvalidBlockId, |
| 73 | 0, |
| 74 | 1, |
| 75 | 2 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 76 | }; |
| 77 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 78 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | TEST(OptimizerTest, CFG2) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 82 | const uint16_t data[] = ZERO_REGISTER_CODE_ITEM( |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 83 | Instruction::GOTO | 0x100, // Block number 1 |
| 84 | Instruction::GOTO | 0x100, // Block number 2 |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 85 | Instruction::RETURN_VOID); // Block number 3 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 86 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 87 | const uint32_t dominators[] = { |
| 88 | kInvalidBlockId, |
| 89 | 0, |
| 90 | 1, |
| 91 | 2, |
| 92 | 3 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 93 | }; |
| 94 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 95 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | TEST(OptimizerTest, CFG3) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 99 | const uint16_t data1[] = ZERO_REGISTER_CODE_ITEM( |
| 100 | Instruction::GOTO | 0x200, // Block number 1 |
| 101 | Instruction::RETURN_VOID, // Block number 2 |
| 102 | Instruction::GOTO | 0xFF00); // Block number 3 |
| 103 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 104 | const uint32_t dominators[] = { |
| 105 | kInvalidBlockId, |
| 106 | 0, |
| 107 | 3, |
| 108 | 1, |
| 109 | 2 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 110 | }; |
| 111 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 112 | TestCode(data1, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 113 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 114 | const uint16_t data2[] = ZERO_REGISTER_CODE_ITEM( |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 115 | Instruction::GOTO_16, 3, |
| 116 | Instruction::RETURN_VOID, |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 117 | Instruction::GOTO_16, 0xFFFF); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 118 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 119 | TestCode(data2, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 120 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 121 | const uint16_t data3[] = ZERO_REGISTER_CODE_ITEM( |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 122 | Instruction::GOTO_32, 4, 0, |
| 123 | Instruction::RETURN_VOID, |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 124 | Instruction::GOTO_32, 0xFFFF, 0xFFFF); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 125 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 126 | TestCode(data3, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | TEST(OptimizerTest, CFG4) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 130 | const uint16_t data1[] = ZERO_REGISTER_CODE_ITEM( |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 131 | Instruction::NOP, |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 132 | Instruction::GOTO | 0xFF00); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 133 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 134 | const uint32_t dominators[] = { |
| 135 | kInvalidBlockId, |
| 136 | 0, |
| 137 | kInvalidBlockId |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 138 | }; |
| 139 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 140 | TestCode(data1, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 141 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 142 | const uint16_t data2[] = ZERO_REGISTER_CODE_ITEM( |
| 143 | Instruction::GOTO_32, 0, 0); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 144 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 145 | TestCode(data2, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | TEST(OptimizerTest, CFG5) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 149 | const uint16_t data[] = ZERO_REGISTER_CODE_ITEM( |
| 150 | Instruction::RETURN_VOID, // Block number 1 |
| 151 | Instruction::GOTO | 0x100, // Dead block |
| 152 | Instruction::GOTO | 0xFE00); // Block number 2 |
| 153 | |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 154 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 155 | const uint32_t dominators[] = { |
| 156 | kInvalidBlockId, |
| 157 | 0, |
| 158 | kInvalidBlockId, |
| 159 | 1 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 160 | }; |
| 161 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 162 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | TEST(OptimizerTest, CFG6) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 166 | const uint16_t data[] = ONE_REGISTER_CODE_ITEM( |
Nicolas Geoffray | 788aaad | 2014-03-10 12:00:43 +0000 | [diff] [blame] | 167 | Instruction::CONST_4 | 0 | 0, |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 168 | Instruction::IF_EQ, 3, |
| 169 | Instruction::GOTO | 0x100, |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 170 | Instruction::RETURN_VOID); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 171 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 172 | const uint32_t dominators[] = { |
| 173 | kInvalidBlockId, |
| 174 | 0, |
| 175 | 1, |
| 176 | 1, |
| 177 | 3, |
| 178 | 1, // Synthesized block to avoid critical edge. |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 179 | }; |
| 180 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 181 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | TEST(OptimizerTest, CFG7) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 185 | const uint16_t data[] = ONE_REGISTER_CODE_ITEM( |
Nicolas Geoffray | 788aaad | 2014-03-10 12:00:43 +0000 | [diff] [blame] | 186 | Instruction::CONST_4 | 0 | 0, |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 187 | Instruction::IF_EQ, 3, // Block number 1 |
| 188 | Instruction::GOTO | 0x100, // Block number 2 |
| 189 | Instruction::GOTO | 0xFF00); // Block number 3 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 190 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 191 | const uint32_t dominators[] = { |
| 192 | kInvalidBlockId, |
| 193 | 0, |
| 194 | 1, |
| 195 | 1, |
| 196 | kInvalidBlockId, // exit block is not dominated by any block due to the spin loop. |
| 197 | 1, // block to avoid critical edge. |
| 198 | 1 // block to avoid critical edge. |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 199 | }; |
| 200 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 201 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | TEST(OptimizerTest, CFG8) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 205 | const uint16_t data[] = ONE_REGISTER_CODE_ITEM( |
Nicolas Geoffray | 788aaad | 2014-03-10 12:00:43 +0000 | [diff] [blame] | 206 | Instruction::CONST_4 | 0 | 0, |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 207 | Instruction::IF_EQ, 3, // Block number 1 |
| 208 | Instruction::GOTO | 0x200, // Block number 2 |
| 209 | Instruction::GOTO | 0x100, // Block number 3 |
| 210 | Instruction::GOTO | 0xFF00); // Block number 4 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 211 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 212 | const uint32_t dominators[] = { |
| 213 | kInvalidBlockId, |
| 214 | 0, |
| 215 | 1, |
| 216 | 1, |
| 217 | 1, |
| 218 | kInvalidBlockId, // exit block is not dominated by any block due to the spin loop. |
| 219 | 1 // block to avoid critical edge. |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 220 | }; |
| 221 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 222 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | TEST(OptimizerTest, CFG9) { |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 226 | const uint16_t data[] = ONE_REGISTER_CODE_ITEM( |
Nicolas Geoffray | 788aaad | 2014-03-10 12:00:43 +0000 | [diff] [blame] | 227 | Instruction::CONST_4 | 0 | 0, |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 228 | Instruction::IF_EQ, 3, // Block number 1 |
| 229 | Instruction::GOTO | 0x200, // Block number 2 |
| 230 | Instruction::GOTO | 0x100, // Block number 3 |
| 231 | Instruction::GOTO | 0xFE00); // Block number 4 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 232 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 233 | const uint32_t dominators[] = { |
| 234 | kInvalidBlockId, |
| 235 | 0, |
| 236 | 1, |
| 237 | 1, |
| 238 | 1, |
| 239 | kInvalidBlockId, // exit block is not dominated by any block due to the spin loop. |
| 240 | 1 // block to avoid critical edge. |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 241 | }; |
| 242 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 243 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | TEST(OptimizerTest, CFG10) { |
Nicolas Geoffray | 788aaad | 2014-03-10 12:00:43 +0000 | [diff] [blame] | 247 | const uint16_t data[] = ONE_REGISTER_CODE_ITEM( |
| 248 | Instruction::CONST_4 | 0 | 0, |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 249 | Instruction::IF_EQ, 6, // Block number 1 |
| 250 | Instruction::IF_EQ, 3, // Block number 2 |
| 251 | Instruction::GOTO | 0x100, // Block number 3 |
| 252 | Instruction::GOTO | 0x100, // Block number 4 |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 253 | Instruction::RETURN_VOID); // Block number 5 |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 254 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 255 | const uint32_t dominators[] = { |
| 256 | kInvalidBlockId, |
| 257 | 0, |
| 258 | 1, |
| 259 | 2, |
| 260 | 2, |
| 261 | 1, |
| 262 | 5, // Block number 5 dominates exit block |
| 263 | 1, // block to avoid critical edge. |
| 264 | 2 // block to avoid critical edge. |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 265 | }; |
| 266 | |
Nicolas Geoffray | 3ff386a | 2014-03-04 14:46:47 +0000 | [diff] [blame] | 267 | TestCode(data, dominators, sizeof(dominators) / sizeof(int)); |
Nicolas Geoffray | be9a92a | 2014-02-25 14:22:56 +0000 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | } // namespace art |