This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Combine for eliminating redundant operand negations
ClosedPublic

Authored by mbrkusanin on Oct 7 2021, 8:36 AM.

Diff Detail

Event Timeline

mbrkusanin created this revision.Oct 7 2021, 8:36 AM
mbrkusanin requested review of this revision.Oct 7 2021, 8:36 AM
foad added inline comments.Oct 7 2021, 8:52 AM
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
632–634

Are these definitely safe. even with signed zeros? Does SelectionDAG do the same?

637

Typo "fma".

mbrkusanin updated this revision to Diff 378165.Oct 8 2021, 4:36 AM
  • Fix comments + rebase
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
632–634

SelectionDAG does not have any extra checks for these specific combines (unlike for some others) so I assume it's safe.
Equivalent SDAG combines are in DAGCombiner::visitFADD and DAGCombiner::visitFSUB.

foad accepted this revision.Oct 8 2021, 5:06 AM

LGTM.

This revision is now accepted and ready to land.Oct 8 2021, 5:06 AM
This revision was landed with ongoing or failed builds.Oct 8 2021, 5:30 AM
This revision was automatically updated to reflect the committed changes.