[PATCH] D25987: [DAG] Match USUBSAT patterns through zext/trunc

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 17:46:02 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9875
+          // Look for a general sub with unsigned saturation first.
+          // zext(x) >= y ? x - trunc(y) : 0 --> usubsat x, y
+          // zext(x) >  y ? x - trunc(y) : 0 --> usubsat x, y
----------------
x and y don't have the same bitwidth so the result of the fold isn't usubsat x, y.  Is it usubsat x, trunc(umin(y, SatLimit))?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D25987



More information about the llvm-commits mailing list