[PATCH] D151449: [RISCV] Add DAG combine for CTTZ in the case of input 0

Mikhail Gudim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 13:52:09 PDT 2023


mgudim added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:11430
+
+  if (Op3.getOpcode() == ISD::TRUNCATE || Op3.getOpcode() == ISD::ZERO_EXTEND) {
+    CTTZ = Op3.getOperand(0);
----------------
craig.topper wrote:
> ```
> SDValue CTTZ = N->getOperand(2);
> if (CTTZ.getOpcode() == ISD::TRUNCATE || CTTZ.getOpcode() == ISD::ZERO_EXTEND)
>   CTTZ = CTTZ.getOperand(0);
> ```
can you please give the example IR when we see `ZERO_EXTEND` or `TRUNCATE`?


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

https://reviews.llvm.org/D151449



More information about the llvm-commits mailing list