This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Use add instead of addReg in ppc-early-ret pass
ClosedPublic

Authored by ZhangKang on Apr 12 2020, 9:51 PM.

Details

Summary

The ppc-early-ret pass use the addReg() to add operand to the new instruction.

106               BuildMI(
107                   **PI, J, J->getDebugLoc(),
108                   TII->get(J->getOpcode() == PPC::BC ? PPC::BCLR : PPC::BCLRn))
109                   .addReg(J->getOperand(0).getReg())
110                   .copyImplicitOps(*I);

For example:

BC undef renamable $cr5lt, %bb.4
BLR implicit $lr, implicit $rm

Above case will be converted to:

BCLR $cr5lt, implicit $lr, implicit $rm

It;s obvious that the BCLR $cr5lt, implicit $lr, implicit $rm should be BCLR undef renamable $cr5lt, implicit $lr, implicit $rm.

Diff Detail

Event Timeline

ZhangKang created this revision.Apr 12 2020, 9:51 PM
ZhangKang retitled this revision from [PowerPC] Reserve the MachineOperand for ppc-early-ret pass to [PowerPC] Use add instead of addReg in ppc-early-ret pass.Apr 12 2020, 9:55 PM
ZhangKang planned changes to this revision.Apr 13 2020, 12:08 AM
This revision is now accepted and ready to land.May 12 2020, 6:46 PM

I notice that this revision has dependency with D76042. Can we break the dependency ?

Break the dependency for D76042.

I notice that this revision has dependency with D76042. Can we break the dependency ?

Have broken the dependency for D76042 and updated the patch.

This revision was automatically updated to reflect the committed changes.