[PATCH] D71014: [AArc64][SVE] Fold constant multiply of element count

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 01:45:21 PST 2019


sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks @c-rhodes



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:163
+  // Returns a suitable CNT/INC/DEC/RDVL multiplier to calculate VSCALE*N.
+  template<signed Low, signed High, signed Scale, bool Shift>
+  bool SelectCntImm(SDValue N, SDValue &Imm) {
----------------
nit: Low/High -> Min/Max ?


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:9476
 
+  // There's nothing to do if the immediate can be packed into an instruction.
+  if (IsSVECntIntrinsic(N0) ||
----------------
nit:
```There's nothing to do if the immediate can be packed into an instruction```
->
```Allow the scaling to be folded into the `cnt` instruction by preventing
the scaling to be obscured here. That makes it easier to pattern match.```


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

https://reviews.llvm.org/D71014





More information about the llvm-commits mailing list