[PATCH] D135843: [AArch64][NFC][1/4]Refactor 'isBitfieldPositioningOp' so that DAG nodes with different Opcode are handled with separate helper functions

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 00:42:09 PDT 2022


dmgreen added reviewers: t.p.northover, efriedma.
dmgreen added a comment.

You can link patches together with the "Edit Related Revision", allowing them to be stacked together to show they are dependant on one another.

These do seems to end up quite different, even if some of the differences here could be reduced.



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:2510
 
-  KnownBits Known = CurDAG->computeKnownBits(Op);
+  SDNode *OpNode = Op.getNode();
 
----------------
If this only has a single use it may be better to inline, so there is only a single variable pointing to Op.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:2562-2564
+  EVT VT = N->getValueType(0);
+  assert((VT == MVT::i32 || VT == MVT::i64) &&
+         "Caller guarantees that type is i32 or i64");
----------------
This can go at the start of the function, and use Op.getValueType().


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:2570
+  Width = countTrailingOnes(NonZeroBits >> DstLSB);
+  Src = ShlOp0;
+
----------------
This needn't set Src.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:2606-2607
+
+  const SDNode *N = Op.getNode();
+  switch (N->getOpcode()) {
+  default:
----------------
Op.getOpcode()


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135843/new/

https://reviews.llvm.org/D135843



More information about the llvm-commits mailing list