[PATCH] D101062: [AArch64][SVE] Better utilisation of unpredicated forms of arithmetic intrinsics

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 6 03:42:22 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:13856
+  // Look through cast.
+  SDValue &Op = N;
+  while (Op.getOpcode() == AArch64ISD::REINTERPRET_CAST) {
----------------
peterwaller-arm wrote:
> sdesmalen wrote:
> > peterwaller-arm wrote:
> > > Potential surprise: because it's a ref, updating Op is going to update N. So, why not just update N in the first place, or avoid using a reference? Might be surprising behaviour - I'd expect that if you're using an extra variable, it's to preserve N's original value, which isn't happening here.
> > or just make it a `const SDValue &Op` ?
> Not sure I understand, If it were a const ref wouldn't that disallow updating it with `Op = Op.getOperand(0);`?
<insert facepalm here> you're right, for a second there I got confused with pointers, where the first `const` applies to the object, not the pointer itself. For references, that's different.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101062



More information about the llvm-commits mailing list