041d737d3f
Sometimes SpillStack and Call end up storing onto the stack a value that was just loaded from the same stack location. There was already code in cgSpillStack to avoid the extra stores in some cases, but that still kept the LdStack alive. This diff detects some of those cases with SpillStack in the Simplifier, which allows the LdStack to be eliminated by DCE. This diff also adds similar support for Call. The operands that don't need to be store onto the stack are replaced with None. Note that the optimization in cgSpillStack is not subsumed by this diff. In the Simplifier, we cannot chase through IncRefs as done in cgSpillStack -- that would result in an IncRef that is not consumed.