[PATCH] D67151: [SystemZ] Recognize INLINEASM_BR in backend

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 06:03:57 PDT 2019


uweigand added inline comments.


================
Comment at: lib/Target/SystemZ/SystemZInstrInfo.cpp:1550
+  case SystemZ::INLINEASM_BR:
+    return SystemZII::Branch(SystemZII::AsmGoto, 0, 0, nullptr);
+
----------------
Please add a comment why we're not registering any branch targets.


================
Comment at: lib/Target/SystemZ/SystemZInstrInfo.h:128
+
+  bool isRelative() { return Target != nullptr && Target->isReg(); }
+  bool hasMBBTarget() { return Target != nullptr && Target->isMBB(); }
----------------
The name seems weird.  If the branch target is a register operand, we have an **indirect** branch, not a relative branch.  (In fact, relative branches are those that have an MBB target operand!)

As I'm not sure there's anything we can ever do to optimize an indirect branch, I'm not sure why we even need this.


================
Comment at: lib/Target/SystemZ/SystemZMachineScheduler.cpp:112
+                        (TII->getBranchInfo(*I).isRelative() ||
+                         TII->getBranchInfo(*I).getMBBTarget() == MBB));
     HazardRec->emitInstruction(&*I, TakenBranch);
----------------
Aha, here's the user.  But I don't understand it -- what is supposed to be testing?  Why would we want to handle indirect branches here?


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

https://reviews.llvm.org/D67151





More information about the llvm-commits mailing list