This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Eliminate compares - add i64 sext/zext handling for equality
ClosedPublic

Authored by nemanjai on May 19 2017, 2:29 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

nemanjai created this revision.May 19 2017, 2:29 PM
inouehrs added inline comments.
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
2860

Do you mean CA bit by addc.1?
IMO, {addc.reg, addc.CA} = (addcarry (xor %a, %b), -1) or similar is clearer.
Someone may misunderstand that we need to execute addcarry twice with the current pseudo-code.

nemanjai added inline comments.May 23 2017, 5:14 AM
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
2860

The idea was to use similar notation to that of the SDAG (i.e. result 0, result 1). But I do like your notation better. I'll change it as you suggested.

echristo accepted this revision.May 23 2017, 11:53 AM

A few cosmetic changes in addition to the notation change that was mentioned (I also like that).

Otherwise LGTM.

-eric

lib/Target/PowerPC/PPCISelDAGToDAG.cpp
2833

Seems to be unused at the moment?

2855

Ditto.

2928

Can you move this down to just before the first use?

This revision is now accepted and ready to land.May 23 2017, 11:53 AM
nemanjai marked 3 inline comments as done.May 31 2017, 1:03 AM
nemanjai added inline comments.
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
2833

It's actually used in deciding whether we use the LHS or (xor LSH, RHS) as the operand to count leading zeros.

2855

Same as above, but as input to add-immediate-with-carry instead of count leading zeros.

This revision was automatically updated to reflect the committed changes.
nemanjai marked 2 inline comments as done.