[PATCH] D96703: [DAG] foldSubToUSubSat - fold sub(a,trunc(umin(zext(a),b))) -> usubsat(a,trunc(umin(b,c)))
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 11:00:06 PST 2021
craig.topper added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3156
RHS = DAG.getNode(ISD::UMIN, DL, SrcVT, RHS, SatLimit);
RHS = DAG.getZExtOrTrunc(RHS, DL, DstVT);
LHS = DAG.getZExtOrTrunc(LHS, DL, DstVT);
----------------
Is this always a truncate and never a ZExt?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3192
+ // sub(a,trunc(umin(zext(a),b))) -> usubsat(a,trunc(umin(b,c)))
+ if (Op1.getOpcode() == ISD::TRUNCATE &&
----------------
craig.topper wrote:
> What is 'c' here? It doesn't appear in the sub(a,trunc(umin(zext(a),b))) pattern
Or is 'c' a constant which I think we usually write as capital C?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96703/new/
https://reviews.llvm.org/D96703
More information about the llvm-commits
mailing list