[PATCH] D147532: [MachineLateInstrsCleanup] Improve compile time for huge functions.

Valery Pykhtin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 00:20:41 PDT 2023


vpykhtin added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineLateInstrsCleanup.cpp:236
+      if (MI.modifiesRegister(Reg, TRI)) {
+        MBBDefs.erase(Reg);
+        MBBKills.erase(Reg);
----------------
vpykhtin wrote:
> Sorry, I didn't notice this change first.
> 
> You can still use erase by iterator (it's slightly faster than another lookup) because you're using make_early_inc_range.
bad advice - DefI is already incremented after Register Reg = DefI.first. 

May be you can leave previous variant of iteration, you can increment the iterator like this:

MBBDefs.erase(DefI++) instead of DefI = MBBDefs.erase(DefI)




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

https://reviews.llvm.org/D147532



More information about the llvm-commits mailing list