This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][Legalizer] LegalizerInfo verifier: Follow Up
ClosedPublic

Authored by rtereshin on May 1 2018, 4:11 PM.

Details

Summary

This is a follow up on https://reviews.llvm.org/D46338, the patch contains the following commits:

[GlobalISel][AArch64] LegalizerInfo verifier: Fixing bugs exposed by LegalizerInfo::verify(...)

[GlobalISel][Legalizer] LegalizerInfo verifier: Making LegalizerInfo::verify(...) errors fatal

[GlobalISel][X86] LegalizerInfo verifier: Adding LegalizerInfo::verify(...) call and fixing bugs exposed

[GlobalISel][ARM] LegalizerInfo verifier:  Adding LegalizerInfo::verify(...) call and fixing bugs exposed

[GlobalISel][AMDGPU] LegalizerInfo verifier: Adding LegalizerInfo::verify(...) call for AMDGPU

[GlobalISel][Mips] LegalizerInfo verifier: Adding LegalizerInfo::verify(...) call for Mips

Diff Detail

Repository
rL LLVM

Event Timeline

rtereshin created this revision.May 1 2018, 4:11 PM
qcolombet added inline comments.
lib/Target/AArch64/AArch64LegalizerInfo.cpp
228 ↗(On Diff #144811)

Haha, nice!

test/CodeGen/AArch64/GlobalISel/legalize-inttoptr-xfail-2.mir
1 ↗(On Diff #144811)

Should be converted into a not llc with a comment explaining why it is incorrect.
(Already said it in the other review.)

rtereshin added inline comments.May 3 2018, 5:04 PM
test/CodeGen/AArch64/GlobalISel/legalize-inttoptr-xfail-2.mir
1 ↗(On Diff #144811)

What's the policy here to decide between XFAIL and not llc (or not opt etc)?

rtereshin updated this revision to Diff 145132.May 3 2018, 6:50 PM
rtereshin marked an inline comment as done.

Updated the xfail tests to make their purpose clearer.

With not llc you can still check specifics in FileCheck whereas with XFAIL you usually don't put checks at all.
In this case, I would expect a not llc + filecheck of some error message.

With not llc you can still check specifics in FileCheck whereas with XFAIL you usually don't put checks at all.
In this case, I would expect a not llc + filecheck of some error message.

Yes! I've done exactly that, apparently :)

nhaehnle removed a subscriber: nhaehnle.May 7 2018, 12:35 AM
qcolombet added inline comments.May 7 2018, 12:48 PM
test/CodeGen/AArch64/GlobalISel/legalize-inttoptr-xfail-1.mir
6 ↗(On Diff #145132)

Could you put the comment back and describe it in a more useful way?
Basically, call out that we are catching a type mismatch, expecting pointer but got scalar.

test/CodeGen/AArch64/GlobalISel/legalize-inttoptr-xfail-2.mir
3 ↗(On Diff #145132)

Ditto

1 ↗(On Diff #144811)

I don't think there are any.
Personally I tend to avoid XFAIL at all, because you can have crashes and whatnot and it will still happily pass!

rtereshin updated this revision to Diff 145698.May 8 2018, 8:49 AM
rtereshin marked 2 inline comments as done.

Adding comments to the tests as requested.

qcolombet accepted this revision.May 11 2018, 12:50 PM
qcolombet added inline comments.
test/CodeGen/AArch64/GlobalISel/legalize-inttoptr-xfail-1.mir
1 ↗(On Diff #145698)

Out-of-curiosity, why is the simplify-mir option required here?

test/CodeGen/AArch64/GlobalISel/legalize-inttoptr-xfail-2.mir
1 ↗(On Diff #145698)

Ditto

This revision is now accepted and ready to land.May 11 2018, 12:50 PM
rtereshin added inline comments.May 11 2018, 1:18 PM
test/CodeGen/AArch64/GlobalISel/legalize-inttoptr-xfail-1.mir
1 ↗(On Diff #145698)

It's not required, but I find it useful: if a test fails I often just copy-paste the command line used as reported by llvm-lit quite mechanically to see a broader context than FileCheck included in the error message, and it's nice if it happens to produce a shorten output.

I can stop committing these of course.

Yes, please remove these.

Simplify-mir may get smarter and eliminate more stuff and we don't
want to have to patch the check lines.

rtereshin updated this revision to Diff 146423.May 11 2018, 3:20 PM

Removing -simplify-mir command line options from run-lines.

This revision was automatically updated to reflect the committed changes.