This is an archive of the discontinued LLVM Phabricator instance.

[X86] Lower ISD::UADDO to use the Z flag instead of C flag when the RHS is a constant 1 to encourage INC formation.
ClosedPublic

Authored by craig.topper on Feb 1 2019, 11:44 PM.

Details

Summary

Add an additional combine to combineCarryThroughADD to reverse it back to the C flag.

I believe this catches the cases that D57547 got.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 1 2019, 11:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2019, 11:44 PM
Herald added a subscriber: javed.absar. · View Herald Transcript
spatel accepted this revision.Feb 2 2019, 4:26 PM

LGTM. Just checking if I'm seeing this correctly: the 2 changes are independent and have their own shares of the test diffs?

This revision is now accepted and ready to land.Feb 2 2019, 4:26 PM

The combineCarryThroughADD prevents some regressions from the getX86XALUOOp change. But I think it picked up a change to at least codegen-prepare-uaddo.ll by itself. I can commit the combineCarryThroughADD separately first if you want.

spatel added a comment.Feb 2 2019, 4:54 PM

The combineCarryThroughADD prevents some regressions from the getX86XALUOOp change. But I think it picked up a change to at least codegen-prepare-uaddo.ll by itself. I can commit the combineCarryThroughADD separately first if you want.

No need to intro regressions - I noticed regressions to the alternate proposal in D57547 when I extended that to handle COND_B --> COND_E, so I was just wondering if this was avoiding that. Might be a potential follow-up for a USUBO / dec sibling to this? Not sure if we have as much test coverage for those.

This revision was automatically updated to reflect the committed changes.