[PATCH] D93191: [PowerPC] Fold select_cc constants when comparing zero into trivial ops

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 9 03:15:54 PDT 2021


lkail marked 2 inline comments as done.
lkail added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:16726
+  if (!N2C || !N3C || !VT.isInteger() || !CmpOpVT.isInteger() ||
+      !isNullConstant(N1) || CC != ISD::SETLT || !CmpOpVT.bitsGE(VT))
+    return SDValue();
----------------
shchenz wrote:
> Can we handle `CmpOpVT.bitsLT(VT)` case by using extend operation?
I don't think it's always profitable. I've updated the comment to make it clearer. The transformation involves in arithmetic shift and `SIGN_EXTEND` looks not zero overhead under some circumstances.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93191



More information about the llvm-commits mailing list