[PATCH] D93191: [PowerPC] Fold select_cc constants when comparing zero into trivial ops
ChenZheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 2 02:06:33 PDT 2021
shchenz 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();
----------------
Can we handle `CmpOpVT.bitsLT(VT)` case by using extend operation?
================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:16748
+
+ unsigned LastOp = FalseVal.slt(TrueVal) ? ISD::ADD : ISD::SUB;
+ // In general, select_cc x, 0, y, z, lt ->
----------------
Is it better to check `Diff.isNegative()`?
================
Comment at: llvm/test/CodeGen/PowerPC/select.ll:7
; RUN: -mtriple=powerpc-linux-gnu < %s | FileCheck \
; RUN: -check-prefix=CHECK-32 %s
----------------
Could you please add some run lines for AIX too?
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