[RISCV][MCP] Remove redundant move from tail duplication (#89865)
commit2def1c445826be77a11926b89f901c0cd6d571d7
authorPiyou Chen <piyou.chen@sifive.com>
Wed, 28 Aug 2024 00:32:54 +0000 (28 08:32 +0800)
committerGitHub <noreply@github.com>
Wed, 28 Aug 2024 00:32:54 +0000 (28 08:32 +0800)
treee43a2fc3ddeacb5d4d225c209b961193e09f402c
parent32abe5d49b758edef0f0c19090361a6fe85c4092
[RISCV][MCP] Remove redundant move from tail duplication  (#89865)

Tail duplication will generate the redundant move before return. It is
because the MachineCopyPropogation can't recognize COPY after post-RA
pseudoExpand.

This patch make MachineCopyPropogation recognize `%0 = ADDI %1, 0` as
COPY
llvm/lib/CodeGen/MachineCopyPropagation.cpp
llvm/test/CodeGen/RISCV/redundant-copy-from-tail-duplicate.ll [new file with mode: 0644]