This is an archive of the discontinued LLVM Phabricator instance.

StructurizeCFG: Directly invert cmp instructions
ClosedPublic

Authored by arsenm on Mar 10 2017, 4:00 PM.

Details

Reviewers
nhaehnle
Summary

The most common case for a branch condition is
a single use compare. Directly invert the branch
predicate rather than adding a lot of xor i1 true
which the DAG will have to fold later.

This produces nicer to read structurizer output.

This produces some random changes in codegen
due to the DAG swapping branch conditions itself,
and then does a poor job of dealing with those
inverts.

Diff Detail

Event Timeline

arsenm created this revision.Mar 10 2017, 4:00 PM
arsenm updated this revision to Diff 91453.Mar 10 2017, 10:05 PM

Forgot to add new file

This revision is now accepted and ready to land.Apr 19 2017, 9:07 AM
arsenm closed this revision.Apr 19 2017, 11:42 AM

r300732