[PATCH] D127208: MachineSink debug invariance

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 08:52:45 PDT 2022


jmorse added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineBasicBlock.cpp:1622
+  auto R = instructionsWithoutDebug(begin(), end());
+  return std::distance(R.begin(), R.end());
+}
----------------
fhahn wrote:
> One issue with this helper is that it needs to iterate over all instructions in the block to count them and the limit is used to decide whether the block is too big to process.
> 
> Not sure there's a good alternative, but maybe have something like `sizeWIthoutDebugLargerThan(x)` so we can at least bail out once the limit is reached.
IIUC, basic block size is ilist size, which is already linear time anyway, so this wouldn't be a regression. That being said, putting a bound on this would be a neat extension.


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

https://reviews.llvm.org/D127208



More information about the llvm-commits mailing list