This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Peephole] Check if `extsw`'s second operand is a virtual register
ClosedPublic

Authored by lkail on Jul 25 2019, 7:55 PM.

Details

Summary

When combining extsw and sldi in PPCMIPeephole, we have to check if extsw's second operand is a virtual register, otherwise we might get miscompile. For now, I haven't find a real world case, so I posted a MIR test case.

Diff Detail

Repository
rL LLVM

Event Timeline

lkail created this revision.Jul 25 2019, 7:55 PM
jsji accepted this revision.Aug 1 2019, 7:59 AM

LGTM.

This revision is now accepted and ready to land.Aug 1 2019, 7:59 AM
lkail requested review of this revision.EditedAug 1 2019, 6:47 PM
lkail updated this revision to Diff 212948.

Updated patch to use Register::isVirtualRegister, a replacement of TargetRegisterInfo::isVirtualRegister.

commit 2bea69bf6503ffc9f3cde9a52b5dac1a25e94e1c
Author: Daniel Sanders <daniel_l_sanders@apple.com>
Date:   Thu Aug 1 23:27:28 2019 +0000

Finish moving TargetRegisterInfo::isVirtualRegister() and friends to llvm::Register as started by r367614. NFC

  llvm-svn: 367633
steven.zhang accepted this revision.Aug 1 2019, 8:10 PM

LGTM with the update.

This revision is now accepted and ready to land.Aug 1 2019, 8:10 PM
This revision was automatically updated to reflect the committed changes.