[PATCH] D59795: [DAGCombine] Improve Lifetime node chains.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 00:59:37 PDT 2019


courbet added a comment.

Nice !



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15575
+SDValue DAGCombiner::visitLIFETIME_START(SDNode *N) {
+  auto Chain = N->getOperand(0);
+  auto NewChain = FindBetterChain(N, Chain);
----------------
Please refactor with the code in `visitLIFETIME_END`


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15585
-    Chains.pop_back();
-    if (!Chain.hasOneUse())
-      continue;
----------------
I have a hard time convincing myself that we can omit this check. Can you add a comment to the code to explain why ?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15594
+    SDNode *N2 = DAG.UpdateNodeOperands(N, NewChain, N->getOperand(1));
+    //Make sure users of new n still depend on Chain
+    auto TF = DAG.getNode(ISD::TokenFactor, SDLoc(N2), MVT::Other, Chain, SDValue(N2,0));
----------------
please clang-format the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59795





More information about the llvm-commits mailing list