This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Remove unnecessary getNode() for SDValue type. NFC
ClosedPublic

Authored by shchenz on Feb 17 2022, 6:16 AM.

Details

Summary

SDValue overloads operator ->, so SDValue.getNode()->func() can be written as SDValue->func()?

Grep .getNode()-> in llvm code base, there are many such usages.
I remove the unnecessary usage in the file DAGCombiner.cpp to get some feedback first.

Diff Detail

Event Timeline

shchenz created this revision.Feb 17 2022, 6:16 AM
shchenz requested review of this revision.Feb 17 2022, 6:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2022, 6:16 AM

This seems fine to me.

All of the calls to dump() can probably use . instead of ->

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
19739

This one can be In.getConstantOperandVal(1) since we have a forwarding method for that.

RKSimon retitled this revision from [DAG-ISEL]remove unnecessary getNode() for SDValue type. NFC to [DAG] Remove unnecessary getNode() for SDValue type. NFC.Feb 17 2022, 12:28 PM
shchenz updated this revision to Diff 409831.Feb 17 2022, 6:27 PM

address comments

  • use . for forwarding methods
  • lint error fix
RKSimon accepted this revision.Feb 18 2022, 2:39 AM

LGTM

This revision is now accepted and ready to land.Feb 18 2022, 2:39 AM
This revision was landed with ongoing or failed builds.Feb 20 2022, 6:10 PM
This revision was automatically updated to reflect the committed changes.