[PATCH] D122539: [SelectionDAG][DAGCombiner] Reuse exist node by reassociate

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 06:02:13 PDT 2022


RKSimon added a comment.

Use getMinSignedBits instead of getBitwidth - fixes for Issue #56170



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1028
+    if (C1APIntVal.getBitWidth() > 64 || C2APIntVal.getBitWidth() > 64)
+      return false;
+
----------------
Are these redundant? CombinedValueIntVal handles this better below


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1031
+    const APInt CombinedValueIntVal = C1APIntVal + C2APIntVal;
+    if (CombinedValueIntVal.getBitWidth() > 64)
+      return false;
----------------
getBitWidth() -> getMinSignedBits()


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1059
+        return false;
+
+    for (SDNode *Node : N->uses()) {
----------------
    if (C2APIntVal.getMinSignedBits() > 64)
      return false;


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122539



More information about the llvm-commits mailing list