[llvm] [SystemZ] Improve handling of memmoves. (PR #196285)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 07:17:28 PDT 2026


JonPsson1 wrote:

After getting some help (https://discourse.llvm.org/t/using-aliasanalysis-for-memmove-lowering/91036), I tried using the stripAndAccumulateConstantOffsets() function that seems to work as expected, at least in a trivial test case involving a memmove between B and GEP(B, ImmOffs).

However, unless I am still doing something wrong, this doesn't help much on SPEC at least. I looked at the overall lowering of memmove with the current patch:

Memmoves lowering:
loads+stores: 363
mvc/mvcrl expansion: 11  (out of which have common base: 1)
libcall: 1421

So this eliminates some ~350 libcalls with loads+stores sequences, but there are only 11 cases of immediate sizes <= 256 bytes that the MVC/MVCRL expansion can handle. Out of these, only 1 could be improved with this experiment.

@nikic I followed your advice as shown in this post in SystemZSelectionDAGInfo.cpp. Is there anything further I could do (for one thing, I don't know what the ExternalAnalysis would be or if it would help any here).


https://github.com/llvm/llvm-project/pull/196285


More information about the llvm-commits mailing list