This is an archive of the discontinued LLVM Phabricator instance.

[Instcombine] Add patterns to generate fneg(fabs(x)) instead of fcmp/selects
Changes PlannedPublic

Authored by mnadeem on Oct 25 2021, 8:42 PM.

Diff Detail

Event Timeline

mnadeem created this revision.Oct 25 2021, 8:42 PM
mnadeem requested review of this revision.Oct 25 2021, 8:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2021, 8:42 PM

Please commit the tests as a preliminary NFC patch, so it's easier to see the diffs.

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
2931–2932

Can we remove this match as a preliminary cleanup?

2947–2948

Can we remove this match as a preliminary cleanup?

mnadeem updated this revision to Diff 382390.Oct 26 2021, 10:29 AM
mnadeem marked 2 inline comments as done.

precommitted the tests and some cleanup as suggested

This seems ok, but I'm having a hard time keeping all of the variations straight (predicates, fsub vs fneg, FMF propagation).

Can you make a patch for just the first code block (that's 4 variations by itself?) and include Alive2 links to show it agrees?

This seems ok, but I'm having a hard time keeping all of the variations straight (predicates, fsub vs fneg, FMF propagation).

Can you make a patch for just the first code block (that's 4 variations by itself?) and include Alive2 links to show it agrees?

Here: https://reviews.llvm.org/D112675

lebedev.ri resigned from this revision.Jan 12 2023, 5:24 PM

This review seems to be stuck/dead, consider abandoning if no longer relevant.

Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 5:24 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
mnadeem planned changes to this revision.Feb 27 2023, 11:54 AM

Removing from reviewer's ready to review list for now. Will come back to this patch when/if time permits.