This is an archive of the discontinued LLVM Phabricator instance.

Upgrade TypePromotionTransaction to be able to report changes in CodeGenPrepare
ClosedPublic

Authored by serge-sans-paille on Jun 5 2020, 5:20 AM.

Details

Summary

optimizeMemoryInst was reporting no change while still modifying the IR.
Inspect the status of TypePromotionTransaction to get a better status.

Related to https://reviews.llvm.org/D80916

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2020, 5:20 AM
foad added a comment.Jun 5 2020, 5:37 AM

"advocating" should be "reporting" (or perhaps "advertising"?).

serge-sans-paille edited the summary of this revision. (Show Details)Jun 5 2020, 7:14 AM

@foad / @nikic does that look good to you?

foad added inline comments.Jun 18 2020, 7:16 AM
llvm/lib/CodeGen/CodeGenPrepare.cpp
2952

You don't need the outer parens.

4963

The commit message suggests you're just fixing the return value from optimizeMemoryInst, but this change (not rolling back) looks like a change in behaviour. Can you explain?

Address reviewer comment.

serge-sans-paille marked an inline comment as done.

Apply fix suggested in review

serge-sans-paille marked 2 inline comments as done.Jun 24 2020, 3:01 AM
serge-sans-paille added inline comments.
llvm/lib/CodeGen/CodeGenPrepare.cpp
4963

Thanks for spotting this - it was an error.

serge-sans-paille marked an inline comment as done.Jun 26 2020, 1:06 PM

@foad should look better now, right?

@foad / @jdoerfert up ? This is the last missing piece before I can land the pass return status expensive check, aka https://reviews.llvm.org/D80916

foad added inline comments.Jul 6 2020, 3:45 AM
llvm/lib/CodeGen/CodeGenPrepare.cpp
2950

Maybe changedSince would be a better name?

4962

I still don't really understand whether this is an intentional change in behaviour, or just fixing the return value from optimizeMemoryInst.

serge-sans-paille marked 2 inline comments as done.

Stick to original API for easier maintenance.

llvm/lib/CodeGen/CodeGenPrepare.cpp
2950

I've reworked the patch to make it closer to the original code, making that change no longer necessary.

foad accepted this revision.Jul 7 2020, 2:48 AM

Looks good to me now - though it would still be nice to hear from @qcolombet as the author of TypePromotionTransaction.

This revision is now accepted and ready to land.Jul 7 2020, 2:48 AM

Looks good to me now - though it would still be nice to hear from @qcolombet as the author of TypePromotionTransaction.

Thanks! I'll leave another day before I merge it if we don't hear from @qcolombet

This revision was automatically updated to reflect the committed changes.