[PATCH] D36619: [MachineCombiner] Update instruction depths incrementally for large BBs.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 14:35:45 PDT 2017


fhahn updated this revision to Diff 113156.
fhahn marked an inline comment as done.
fhahn added a comment.

I really appreciate you taking time to review this change!

As a sanity check for the incremental update I did the following:

1. check-llvm-codegen passes with only using incremental depth computation (the full trace is computed before the main loop and IncremenalUpdate is initialized with true.

2. As you suggested, I compiled the MultiSource/Benchmarks programs from the LLVM test suite with 2 version of LLVM, one only using incremental depth computations and the other only using the existing mechanics. I printed the depths of all instructions of changed basic blocks and compared them. The depths are the same for both versions, with a few exceptions. The minor differences in heights are caused by nodes that depend on the depths of instructions in previous basic blocks (PHI nodes). In a few cases, the previous basic block has been invalidated, but is not in the set of basic blocks for which the depths are re-computed in getTrace(). If we do not invalidate the trace, all depths match. Maybe it would be worth to only invalidate the traces for all basic block we changed, at the end of `MachineCombiner::runOnMachineFunction`


https://reviews.llvm.org/D36619

Files:
  include/llvm/CodeGen/MachineTraceMetrics.h
  lib/CodeGen/MachineCombiner.cpp
  lib/CodeGen/MachineTraceMetrics.cpp
  test/CodeGen/AArch64/machine-combiner.ll
  test/CodeGen/X86/machine-combiner.ll
  test/CodeGen/X86/mul-constant-result.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36619.113156.patch
Type: text/x-patch
Size: 13218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170829/cec0401d/attachment.bin>


More information about the llvm-commits mailing list