| 77 | } |
| 78 | |
| 79 | StatusOr<Analysis::Array*> IndexedArrayAnalysis::GetArrayFor( |
| 80 | const HloInstruction* instr) { |
| 81 | auto it = cache_.find(instr); |
| 82 | if (it != cache_.end()) { |
| 83 | return it->second; |
| 84 | } |
| 85 | |
| 86 | TF_RETURN_IF_ERROR(TraverseAndPopulateCache(instr)); |
| 87 | return FindOrDie(cache_, instr); |
| 88 | } |
| 89 | |
| 90 | Status IndexedArrayAnalysis::TraverseAndPopulateCache( |
| 91 | const HloInstruction* root) { |