Open Quuxplusone opened 10 years ago
Bugzilla Link | PR18605 |
Status | NEW |
Importance | P normal |
Reported by | Jasper Neumann (jn@sirrida.de) |
Reported on | 2014-01-24 11:47:52 -0800 |
Last modified on | 2014-02-12 20:05:28 -0800 |
Version | trunk |
Hardware | PC Linux |
CC | atrick@apple.com, chandlerc@gmail.com, echristo@gmail.com, geek4civic@gmail.com, grosbach@apple.com, hfinkel@anl.gov, jn@sirrida.de, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also | PR18602, PR18603, PR18604 |
I think the "problem" here is that the 2-address pass does not know how to stretch the source live range of a copy. A use of the copy that immediately follows always ends of using the result of the copy. I think there are cases where it would be useful to use the copy's source instead and reduce the critical path. However, in general we would avoid doing that because it potentially increases register pressure/constraints scheduling.
So it's tricky, and there is no motivation for improving it when the optimization target makes copies free.
It seems like it would be easy enough to adjust for this use-after-copy hazard, for those targets that need it, with a simple late MI pass.
I would be glad if such a peephole optimization were present.
IMHO it should be active as default at least for x86.