This is an archive of the discontinued LLVM Phabricator instance.

[DAG] select Cond, C, -1 --> or (sext (not Cond)), C when C is MVT::i1
ClosedPublic

Authored by deadalnix on Sep 27 2022, 6:28 AM.

Details

Summary

In the spirit of D130765 . Get rid of cbranches and/or cmov. Usually shorter, but sometime not, becaus eit's hard to prededict when dependency breaking xor will be introduced.

Diff Detail

Event Timeline

deadalnix created this revision.Sep 27 2022, 6:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2022, 6:28 AM
deadalnix requested review of this revision.Sep 27 2022, 6:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2022, 6:28 AM
RKSimon added inline comments.Sep 27 2022, 6:34 AM
llvm/test/CodeGen/X86/cmov-promotion.ll
124

Some of these test need duplicating as we need to retain test coverage for the cases where cmov will still be used (i.e. the RHS select != -1) , but also keep these tests for the cmov-less coverage.

deadalnix updated this revision to Diff 463338.Sep 27 2022, 2:29 PM

Add a test case for this spercifically in select_const and modify cmov-promotion so that this optimization doesn't kick in.

RKSimon accepted this revision.Sep 29 2022, 5:18 AM

LGTM

This revision is now accepted and ready to land.Sep 29 2022, 5:18 AM