This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fixed the crash due to early if conversion with fixed CR fields.
ClosedPublic

Authored by NeHuang on Aug 18 2021, 7:41 AM.

Details

Summary

This patch adds a fix to do early if conversion to select when conditional branch not using physical register to prevent the crash when expanding ISEL instruction.

Diff Detail

Event Timeline

NeHuang created this revision.Aug 18 2021, 7:41 AM
NeHuang requested review of this revision.Aug 18 2021, 7:42 AM
lei requested changes to this revision.Aug 25 2021, 6:22 AM
lei added a subscriber: lei.

I think there is something wrong with this diff cause there is no context available for PPCInstrInfo.cpp.

llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
1548

nit: no need for braces

llvm/test/CodeGen/PowerPC/ifcvt_cr_field.ll
2

I believe this affects AIX as well.

This revision now requires changes to proceed.Aug 25 2021, 6:22 AM
amyk added a subscriber: amyk.Aug 26 2021, 8:39 AM

Please update the patch with full context.

llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
1546

nit: uses a physical register

llvm/test/CodeGen/PowerPC/ifcvt_cr_field.ll
3

Are the target datalayout and target triple necessary?

NeHuang updated this revision to Diff 369531.Aug 30 2021, 1:39 PM

Address review comment.

kamaub accepted this revision as: kamaub.Sep 2 2021, 1:32 PM
kamaub added a subscriber: kamaub.

This LGTM, small nit on the comment, but that can be fixed on commit

llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
1544

nit

NeHuang updated this revision to Diff 370428.Sep 2 2021, 3:19 PM

Address review comments

  • typo update
  • use proper mcpu in the test case.
NeHuang marked 5 inline comments as done.Sep 2 2021, 3:21 PM
lei accepted this revision.Sep 7 2021, 6:47 AM

LGTM
Thx!

This revision is now accepted and ready to land.Sep 7 2021, 6:47 AM
This revision was landed with ongoing or failed builds.Sep 7 2021, 8:51 AM
This revision was automatically updated to reflect the committed changes.