[PATCH] D36619: [MachineCombiner] Update instruction depths incrementally for large BBs.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 05:36:50 PDT 2017
fhahn added inline comments.
================
Comment at: lib/CodeGen/MachineCombiner.cpp:396
+ if (IncrementalUpdate)
+ for (auto *InstrPtr : InsInstrs)
+ MinInstr->updateDepth(MBB, *InstrPtr, RegUnits);
----------------
Gerolf wrote:
> You could call updateDepths here as well. Also if you had code like if (IncrementalUpdate) MinInstr->updateDepths(...) else MinInstr->invalidate(MBB) you could spare two parameters (at the cost of adding such a line after each call). It feels more natural to me than packing the code inside the insertDelete...() procedure.
This is slightly more difficult, I think, as MachineBasicBlock::iterator iterates over instruction references while InsInstrs contains instruction pointers. I'll leave it as it is for now and will think a bit more if we can make this nicer.
I think it is slightly safer to update the state of the trace here, as this should always be done if we modify the basic block.
https://reviews.llvm.org/D36619
More information about the llvm-commits
mailing list