[PATCH] D141043: [AArch64][SVE] Avoid AND operation if both side are splat of i1 or PTRUE

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 08:36:45 PST 2023


david-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:16217
 
+static SDValue findRootNonReinterpretNode(SDValue Op) {
+  if (Op.getNode()->getOpcode() != AArch64ISD::REINTERPRET_CAST)
----------------
Rather than use a recursive function call you could just do:

  static SDValue findRootNonReinterpretNode(SDValue Op) {
    while (Op.getOpcode() == AArch64ISD::REINTERPRET_CAST)
      Op = Op->getOperand(0);
    return Op;
  }

Perhaps that's a bit friendlier to the compiler too?


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

https://reviews.llvm.org/D141043



More information about the llvm-commits mailing list