[PATCH] D123782: [AArch64] Generate AND in place of CSEL for Table Based CTTZ lowering in -O3

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 09:26:35 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:17478
+        (CTTZ.getOpcode() == ISD::TRUNCATE &&
+          CTTZ.getOperand(0).getOpcode() == ISD::CTTZ))) {
+    if (isNullConstant(Zero) &&
----------------
Technically, if you look through a truncate you need to know the truncate didn't drop any bits of the CTTZ result. But maybe AArch64ISD::SUBS and CSEL can only be created after type legalization so the only possible types are i32 and i64? I'm not an AArch64 expert so I don't know.


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

https://reviews.llvm.org/D123782



More information about the llvm-commits mailing list