[PATCH] D141829: [AArch64] fold subs ugt/ult to ands when the second operand is a mask

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 05:43:35 PST 2023


bcl5980 added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:19898
+  SmallVector<SDValue, 8> Ops;
+  for (unsigned i = 0; i != N->getNumOperands(); ++i) {
+    if (i == CCIndex)
----------------
samtebbs wrote:
> Do you know if CCIndex and CmpIndex always have consistent values? If so it would be cleaner and faster to not use a loop and instead initialise the Ops vector with the correct values in the correct places.
Based on current code, CCIndex should be always 2, CmpIndex should be always 3. I'm not sure it will change or not in the future. But I can try to use the cleaner way and add a assert here.


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

https://reviews.llvm.org/D141829



More information about the llvm-commits mailing list