[PATCH] D75098: Add TCOPY, a terminator form of the COPY instr

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 07:59:48 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:312-342
+  // A block with INLINEASM_BR has extra information associated with it. The
+  // indirect targets need to be identified as does the default target.
+  DenseMap<const BasicBlock *, MachineBasicBlock *> BBToMBB;
+
+  for (auto &mbb : MF)
+    if (const auto *bb = mbb.getBasicBlock())
+      BBToMBB[bb] = &mbb;
----------------
This is an unrelated change


================
Comment at: llvm/lib/CodeGen/MachineSink.cpp:857-860
+  // The copy no longer needs to be a terminator, so convert it to a normal
+  // COPY.
+  if (MI.getOpcode() == TargetOpcode::TCOPY)
+    MI.setDesc(TII->get(TargetOpcode::COPY));
----------------
I don't see this captured in a test?


================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:616-634
+  unsigned NumIndirectTargetSuccs = 0;
+  const MachineBasicBlock *IAB = MBB;
+  if (IAB->pred_size() == 1 &&
+      llvm::any_of((*IAB->pred_begin())->terminators(),
+                   [](const MachineInstr &MI){
+                     return MI.getOpcode() == TargetOpcode::INLINEASM_BR;
+                   }))
----------------
This also looks like a separate change


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75098





More information about the llvm-commits mailing list