[PATCH] D42948: [SelectionDAG] Support some SimplifySetCC cases for comparing against vector splats of constants.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 6 16:04:43 PST 2018
craig.topper added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:1891
if (C1 == MinVal)
- return DAG.getConstant(1, dl, VT);
-
- // X >= C0 --> X > (C0 - 1)
- APInt C = C1 - 1;
- ISD::CondCode NewCC = (Cond == ISD::SETGE) ? ISD::SETGT : ISD::SETUGT;
- if ((DCI.isBeforeLegalizeOps() ||
- isCondCodeLegal(NewCC, VT.getSimpleVT())) &&
- (!N1C->isOpaque() || (N1C->isOpaque() && C.getBitWidth() <= 64 &&
- isLegalICmpImmediate(C.getSExtValue())))) {
- return DAG.getSetCC(dl, VT, N0,
- DAG.getConstant(C, dl, N1.getValueType()),
- NewCC);
+ return DAG.getBooleanTrueConstant(dl, VT);
+
----------------
spatel wrote:
> Is this (and similar diffs below) currently wrong for ZeroOrNegativeOneBooleanContent targets?
> I'm having a hard time seeing all the pre-conditions in this 900 line monster of a function...
I suspect it is. I believe there are other lines in here that I didn't touch that are probably also wrong.
I can split out the getBooleanTrueConstant function and fix this up for scalar types first if you want?
Repository:
rL LLVM
https://reviews.llvm.org/D42948
More information about the llvm-commits
mailing list