Return the set of locations accessed by |stores| and |loads|.
| 37 | |
| 38 | // Return the set of locations accessed by |stores| and |loads|. |
| 39 | std::set<Instruction*> GetLocationsAccessed( |
| 40 | const std::map<Instruction*, std::vector<Instruction*>>& stores, |
| 41 | const std::map<Instruction*, std::vector<Instruction*>>& loads) { |
| 42 | std::set<Instruction*> locations{}; |
| 43 | |
| 44 | for (const auto& kv : stores) { |
| 45 | locations.insert(std::get<0>(kv)); |
| 46 | } |
| 47 | |
| 48 | for (const auto& kv : loads) { |
| 49 | locations.insert(std::get<0>(kv)); |
| 50 | } |
| 51 | |
| 52 | return locations; |
| 53 | } |
| 54 | |
| 55 | // Append all dependences from |sources| to |destinations| to |dependences|. |
| 56 | void GetDependences(std::vector<DistanceVector>* dependences, |