Files
swift-mirror/lib/SILOptimizer/Transforms/CopyForwarding.cpp
Andrew Trick b39de959fa Fix a theoretical copy forwarding bug.
Reviewing the code with Arnold revealed a corner case where forward propagating
a copy into multiple operands of the same instruction wasn't properly detected.
I don't think this case was possible given the language rules, but nonetheless
it is valid SIL and needs to be handled.

This is confusing because in some cases we optimize that situation correctly,
and in other cases we try to assert that it doesn't happen. So, I simplified the
code to bailout anywhere that we see multiple operands of the same value. This
isn't an expected situation that needs to be optimized.
2017-12-14 09:37:12 -08:00

59 KiB