The SystemZ backend can do arithmetic of memory by loading and then extending one of the operands. Similarly, a load + truncate can be folded into an operand.
This was not recognized by the SystemZ TTI cost functions. I found a loop where this was obvious and decided to do a more full-fledged version of the check for folding of memory operands.
As it turned out, this seems to be the only case where this triggered, so it does not seem to be of much use to apply this patch at the moment - not even on z14 which has the 16->64 bit memory operands also.
I suppose then we don't use this at least for the moment, but save it here for the record.