[PATCH] D140160: [llvm][SelectionDAGBuilder] codegen callbr.landingpad intrinsic

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 09:38:33 PST 2023


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM with a couple minor comments.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:11623
+// landingpad would not even be able to refer to such a callbr.
+static Register FollowCopyChain(MachineRegisterInfo &MRI, Register Reg) {
+  MachineOperand *MO = &*MRI.def_begin(Reg);
----------------
The structure of this function seems more flexible than its actual purpose... I'd prefer to assert if the code has an unexpected structure.  So maybe llvm_unreachable instead of `return {};`, and don't use recursion/a loop when you're expecting exactly one or two COPY instructions.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:11673
+    // TODO: should we mark the copied-from register as killed by this COPY (if
+    // physreg)?
+    SDValue V = DAG.getCopyFromReg(Chain, getCurSDLoc(), Output, ResultVTs[i]);
----------------
You shouldn't need to explicitly mark kills at this point; they'll get inferred later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140160



More information about the llvm-commits mailing list