[PATCH] D129757: [RISCV] Optimize SELECT_CC when condition is eq and the true value of select is zero
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 16 22:50:52 PDT 2022
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:3894
SDValue TargetCC = DAG.getCondCode(CCVal);
+ if (isa<ConstantSDNode>(TrueV) && CCVal == ISD::SETEQ) {
+ auto *ConstNode = cast<ConstantSDNode>(TrueV);
----------------
craig.topper wrote:
> This transform is equally valid to turn SETNE into SETEQ right?
This is valid for any condition code isn't it? We just need to invert the condition code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129757/new/
https://reviews.llvm.org/D129757
More information about the llvm-commits
mailing list