[PowerPC] Use add instead of addReg in ppc-early-ret pass
authorKang Zhang <shkzhang@cn.ibm.com>
Wed, 13 May 2020 05:59:52 +0000 (05:59 +0000)
committerKang Zhang <shkzhang@cn.ibm.com>
Wed, 13 May 2020 05:59:52 +0000 (05:59 +0000)
commit782a4dd1a478e41857744b483b104b5e66857fbf
tree6e21213dbf8ece13edf9e7cd40af0d7e5aa4bd67
parent085234bedc3803699e58a8c9e6bbace3388efee2
[PowerPC] Use add instead of addReg in ppc-early-ret pass

Summary:
The ppc-early-ret pass use the addReg() to add operand to the new
instruction, it can't reserve the flag of old operand. This has caused
machine verfications failed.
This patch use add() to instead of addReg().

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D77997
llvm/lib/Target/PowerPC/PPCEarlyReturn.cpp
llvm/test/CodeGen/PowerPC/early-ret-verify.mir
llvm/test/CodeGen/PowerPC/early-ret.mir