[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
Thu Apr 14 08:46:40 PDT 2022
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:17460
+ SDValue N2 = N->getOperand(2);
+ bool isZero = cast<ConstantSDNode>(N2.getNode())->isZero();
+ if (N1.getOpcode() == ISD::CTTZ && isZero) {
----------------
rahular-rrlogic wrote:
> dmgreen wrote:
> > As far as I can tell this is checking that the condition code is 0? It would be better to check that it is equal to AArch64CC::EQ.
> No, this is a mistake. I was intending to check if the operands are 0 and cttz. I will change that. Is a check for the condition being EQ really required, though?
There's a function called `isNullConstant` that can be used here.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123782/new/
https://reviews.llvm.org/D123782
More information about the llvm-commits
mailing list