This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add G_ABS
ClosedPublic

Authored by foad on Aug 11 2020, 2:58 AM.

Details

Summary

This is a direct equivalent of the new llvm.abs intrinsic added by
D84125.

Diff Detail

Event Timeline

foad created this revision.Aug 11 2020, 2:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2020, 2:58 AM
foad requested review of this revision.Aug 11 2020, 2:58 AM
arsenm added inline comments.Aug 11 2020, 6:59 AM
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
1505

This is losing the immediate field. Does the DAG do the same?

foad added inline comments.Aug 11 2020, 7:12 AM
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
1505
foad updated this revision to Diff 284705.Aug 11 2020, 7:14 AM

Add a TODO.

arsenm accepted this revision.Aug 11 2020, 7:36 AM

LGTM. I guess it would make sense to directly preserve the operand. I guess the sticking point would be should this be a separate opcode, similar to CTLZ/CTTZ + zero undef, or an operand

This revision is now accepted and ready to land.Aug 11 2020, 7:36 AM
This revision was automatically updated to reflect the committed changes.