[PATCH] D132202: Split the indirect jump critical edges.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 11:26:09 PDT 2022


MatzeB added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineBasicBlock.cpp:1067
+    MachineInstr &MI = *getFirstTerminator();
+    const MachineOperand &MO = MI.getOperand(3);
+    JTI->ReplaceMBBInJumpTable(MO.getIndex(), Succ, NMBB);
----------------
I thought we had the magic number 3 abstracted away already. This needs to be abstracted in the `findIndirectJumpTable` function as it is X86 specific!


================
Comment at: llvm/lib/CodeGen/MachineBasicBlock.cpp:1275-1278
-bool MachineBasicBlock::canSplitCriticalEdge(
-    const MachineBasicBlock *Succ) const {
-  // Splitting the critical edge to a landing pad block is non-trivial. Don't do
-  // it in this generic function.
----------------
Why was the comment removed?


================
Comment at: llvm/lib/Target/X86/X86InstrInfo.h:332
+  /// Return the pointer to the jump table, if given instr has it.
+  MachineJumpTableInfo *
+  getJumpTableFromIndirectJump(MachineInstr &MI) const override;
----------------
I thought this would return just the jump table for the particular instruction, but `MachineJumpTableInfo` is just the generic interface for all jumptables it seems. So we probably rather something like `llvm::Optional<unsigned>` to return the operand index with the JTI machine operand...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132202



More information about the llvm-commits mailing list