[GlobalISel] Translate memset/memmove/memcpy from undef ptrs into nops

If the source is undef, then just don't do anything.

This matches SelectionDAG's behaviour in SelectionDAG.cpp.

Also add a test showing that we do the right thing here.
(irtranslator-memfunc-undef.ll)

Differential Revision: https://reviews.llvm.org/D63095

llvm-svn: 362989
GitOrigin-RevId: b22954384e34eebb761db342dbad0b08dfb57856
2 files changed