This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix assert from machine verify pass that missing undef register flag
ClosedPublic

Authored by wuzish on Dec 6 2018, 8:52 PM.

Details

Summary

Fix assert about using an undefined physical register in machine instruction verify pass. Following is the error info. The reason is that register flag undef is missing when doing transformation from If Conversion Pass.

llc -verify-machineinstrs llvm/test/CodeGen/PowerPC/zero-not-run.ll

Bad machine code: Using an undefined physical register 
- function:    func_65
- basic block: %bb.0 entry (0x10024740738)
- instruction: BCLR killed $cr5lt, implicit $lr8, implicit $rm, implicit undef $x3
- operand 0:   killed $cr5lt
LLVM ERROR: Found 1 machine code errors.

There are other existing testcases that can show similar issues too. So I add -verify-machineinstrs option to open verifying.

@hfinkel could you please have a look since the last change is related to your part.

Diff Detail

Event Timeline

wuzish created this revision.Dec 6 2018, 8:52 PM
hfinkel accepted this revision.Dec 6 2018, 9:01 PM

@hfinkel could you please have a look since the last change is related to your part.

Sure. LGTM.

This revision is now accepted and ready to land.Dec 6 2018, 9:01 PM
This revision was automatically updated to reflect the committed changes.