[PATCH] D124374: [RISCV][TargetLowering] Special case overflow expansion for (uaddo X, C).

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 17:26:41 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:8826
     // the live range of X. We assume comparing with 0 is cheap.
-    // TODO: This generalizes to (X + C) < C.
+    // The general case (X + C) < C is not necessary benefits. Although we
+    // reduce the live range of X, we may introduce the materialization of
----------------
"necessary benefits" -> "necessarily beneficial"


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:6974
       // Special case uaddo X, 1 overflowed if the addition result is 0.
-      // FIXME: We can do this for any constant RHS by using (X + C) < C.
+      // The general case (X + C) < C is not necessary benefits. Although we
+      // reduce the live range of X, we may introduce the materialization of
----------------
Here too


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:6976
+      // reduce the live range of X, we may introduce the materialization of
+      // constant C, especially the setcc result is used by branch. We have no
+      // compare with constant and branch instructions.
----------------
"especially the setcc" -> "especially when the setcc"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124374



More information about the llvm-commits mailing list