[PATCH] D68092: [AMDGPU] Invert the handling of skip insertion.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 02:33:27 PST 2019


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp:63-75
+static bool isForwardBranch(MachineBasicBlock *StartMBB,
+                            MachineBasicBlock *EndMBB) {
+  MachineFunction::const_iterator MBBI = StartMBB->getIterator();
+  MachineFunction::const_iterator MBBE = StartMBB->getParent()->end();
+  MachineFunction::const_iterator MBBToI = EndMBB->getIterator();
+
+  while (++MBBI != MBBE) {
----------------
You're already doing a forward scan through the blocks in mustRetainExeczBranch, so it seems like this should just be checked there 


================
Comment at: lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp:82-84
+  // analyzeBranch doesn't update the FalseMBB when it is the fallthrough block.
+  if (!From)
+    From = SrcMBB.getNextNode();
----------------
I was thinking this would go in a separate wrapper function along with the analyzeBranch call. The connection to analyzeBranch isn't obvious at this point


Repository:
  rL LLVM

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

https://reviews.llvm.org/D68092





More information about the llvm-commits mailing list