This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering] Simplify the interface for expandCTPOP/expandCTLZ/expandCTTZ.
ClosedPublic

Authored by craig.topper on Oct 21 2021, 1:55 PM.

Details

Summary

There is no need to return a bool and have an SDValue output
parameter. Just return the SDValue and let the caller check if it
is null.

I have another patch to add more callers of these so I thought
I'd clean up the interface first.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 21 2021, 1:55 PM
craig.topper requested review of this revision.Oct 21 2021, 1:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2021, 1:55 PM
RKSimon accepted this revision.Oct 21 2021, 2:05 PM

LGTM

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
2687

Another candidate?

This revision is now accepted and ready to land.Oct 21 2021, 2:05 PM
craig.topper added inline comments.Oct 21 2021, 2:07 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
2687

Yeah. There several others in TargetLowering like expandROT and expandFunnelShift.