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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 19:10:25 PST 2020


arsenm added a comment.

This will be useful for AMDGPU, we currently have a set of _term mov instructions for this purpose.



================
Comment at: llvm/include/llvm/Support/TargetOpcodes.def:101
+/// COPY_BR - This instruction is the terminal version of COPY. The purpose is
+/// to allow copies from terminals to be properly represented (e.g. an
+/// INLINEASM_BR that defines a physical register) without having
----------------
s/terminal/terminator


================
Comment at: llvm/include/llvm/Target/Target.td:1124-1125
+  let isTerminator = 1;
+  let isBranch = 1;
+  let isIndirectBranch = 1;
+}
----------------
This shouldn't need isBranch or isIndirectBranch


================
Comment at: llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:179
+    const MachineBasicBlock::iterator Term = MBB->getFirstTerminator();
+    if (Term != MBB->end() && Term->getOpcode() == TargetOpcode::INLINEASM_BR)
+      TgtOpc = TargetOpcode::COPY_BR;
----------------
I would expect this to not special case INLINEASM_BR. This should be any value defined by a terminator instruction


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