| 359 | } |
| 360 | |
| 361 | std::vector<const HloBuffer*> HloAliasAnalysis::ComputeBuffersAt( |
| 362 | const HloInstruction* instruction, const ShapeIndex& index) const { |
| 363 | std::vector<const HloBuffer*> buffers; |
| 364 | for (const HloValue* value : |
| 365 | dataflow_analysis_->GetValueSet(instruction, index).values()) { |
| 366 | buffers.push_back(&GetBufferContainingValue(*value)); |
| 367 | } |
| 368 | |
| 369 | // Sort and uniquify vector before returning. |
| 370 | absl::c_sort(buffers, HloBuffer::IdLessThan); |
| 371 | buffers.erase(std::unique(buffers.begin(), buffers.end()), buffers.end()); |
| 372 | |
| 373 | return buffers; |
| 374 | } |
| 375 | |
| 376 | bool HloAliasAnalysis::InstructionBuffersAreAmbiguous( |
| 377 | const HloInstruction* instruction) const { |
no test coverage detected