This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Add combine for (not (strict_fsetcc)) to create a strict_fsetcc with the opposite condition.
ClosedPublic

Authored by craig.topper on Dec 22 2019, 11:32 AM.

Details

Summary

Unlike the existing code that I modified here, I only handle the
case where the strict_fsetcc has a single use. Not sure exactly
how to handle multiples uses.

Testing this on X86 is hard because we already have a other
combines that rid of lowered version of the integer setcc that
this xor will eventually become. So this combine really just
saves a bunch of extra nodes being created. Not sure about other
targets.

Diff Detail

Event Timeline

craig.topper created this revision.Dec 22 2019, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2019, 11:32 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
pengfei added inline comments.Dec 22 2019, 6:38 PM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
7087

Why we need consider cases more than one use? Isn't xor + setcc better that 2 setccs?

craig.topper marked an inline comment as done.Dec 22 2019, 7:26 PM
craig.topper added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
7087

We generally try to increase parallelism and reduce latency. Two setccs can be done in parallel, while setcc+xor serializes the xor behind the setcc.

uweigand accepted this revision.Jan 24 2020, 6:34 AM

LGTM.

This revision is now accepted and ready to land.Jan 24 2020, 6:34 AM
This revision was automatically updated to reflect the committed changes.