In MachineCopyPropagation, when propagating the source of a copy into
the operand of a later instruction, bail if a destination overlaps the
copy source. If the instruction where the substitution is happening is
also a copy, allowing the propagation confuses the tracking mechanism.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/lib/CodeGen/MachineCopyPropagation.cpp | ||
|---|---|---|
| 439–442 | Good idea. Makes the code simpler too. | |
| llvm/test/CodeGen/AMDGPU/mcp-overlap-after-propagation.mir | ||
| 21 | I don't think I can test that. The bug only actually has an effect if the instruction that the copy is being folded into is itself a copy, and I can't think of a way then of there being an implicit def that overlaps the source of the first copy. | |
LGTM
| llvm/lib/CodeGen/MachineCopyPropagation.cpp | ||
|---|---|---|
| 440 | I'm pretty sure the << MI already includes the newline, so you can drop the extra one here | |
| llvm/lib/CodeGen/MachineCopyPropagation.cpp | ||
|---|---|---|
| 438–439 | Maybe should have a partiallyModifiesRegister? | |
Maybe should have a partiallyModifiesRegister?