This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use CMOVNS for abs instead of CMOVGE.
ClosedPublic

Authored by craig.topper on Oct 14 2021, 11:27 AM.

Details

Summary

CMOVGE reads SF and OF. CMOVNS only reads SF. This matches with
other recent changes to use a single flag where possible. It also
matches gcc codegen.

I believe this technically changes whether the conditioanl move happens
on INT_MIN, but for INT_MIN both registers are the same so it doesn't
matter.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 14 2021, 11:27 AM
craig.topper requested review of this revision.Oct 14 2021, 11:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2021, 11:27 AM
RKSimon accepted this revision.Oct 14 2021, 12:26 PM

LGTM - cheers

This revision is now accepted and ready to land.Oct 14 2021, 12:26 PM
This revision was automatically updated to reflect the committed changes.