[PATCH] D124231: [RISCV] Merge addi into load/store as there is a ADD between them

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 20:34:52 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2173
 
+  if (Add)
+    CurDAG->UpdateNodeOperands(Add.getNode(), Add.getOperand(AddBaseIdx),
----------------
I'm a little concerned about the use of UpdateNodeOperands in this function. If the update matches an existing node, it will delete the original node and return a new node. If that happens here, `Add` will no longer point to a valid node after the call.

I'm going to do some experiments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124231



More information about the llvm-commits mailing list