For those watching, we were leaving some ssa.copy around and those arrived to the backend where we failed to lower.
The comment in the code contains the whole story, for those interested :)
Details
Diff Detail
Event Timeline
lib/Transforms/Scalar/NewGVN.cpp | ||
---|---|---|
2798–2800 | I think I could probably just forcefully cast to CallInst as we're always guaranteed that PredicateInfo will insert calls in the map, FWIW. |
(You forgot the testcase :P)
lib/Transforms/Scalar/NewGVN.cpp | ||
---|---|---|
2784 | This isn't quite right. In most cases, we are able to eliminate the ssa.copy intrinsics in eliminateInstructions.
This is the vast majority of cases. In these cases, we will end up with some ssa.copy left after and need to eliminate them. | |
2795 | I realized there's an easier way to accomplish this. // Don't replace our existing users with ourselves. if (U->get() == DominatingLeader) continue; right before this, add if (DominatingLeader is a PredicateInfo copy) DominatingLeader = copy argument |
This isn't quite right.
Let me try to rewrite what i wrote in the bug report better here:
In most cases, we are able to eliminate the ssa.copy intrinsics in eliminateInstructions.
The two cases we are able to eliminate them are:
This is the vast majority of cases.
However, we are not guaranteed that any of the equivalents we come up with if we use the predicateinfo dominates it.
This is particularly true when the used predicateinfo is an and/or of two conditions.
In these cases, we will end up with some ssa.copy left after and need to eliminate them.