[all-commits] [llvm/llvm-project] e8b83f: [RDA] Only store most recent reaching def from pre...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Apr 6 09:39:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e8b83f7ddc5d0c4ac89f18e024562d0e70bcc40c
      https://github.com/llvm/llvm-project/commit/e8b83f7ddc5d0c4ac89f18e024562d0e70bcc40c
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-04-06 (Mon, 06 Apr 2020)

  Changed paths:
    M llvm/lib/CodeGen/ReachingDefAnalysis.cpp

  Log Message:
  -----------
  [RDA] Only store most recent reaching def from predecessors (NFCI)

When entering a basic block, RDA inserts reaching definitions coming
from predecessor blocks (which will be negative numbers) in a rather
peculiar way. If you have incoming reaching definitions -4, -3, -2, -1,
it will insert those. If you have incoming reaching definitions
-1, -2, -3, -4, it will insert -1, -1, -1, -1, as the max is taken
at each step. That's probably not what was intended...

However, RDA only actually cares about the most recent reaching
definition from a predecessor (to calculate clearance), so this
ends up working fine as far as behavior is concerned. It does
waste memory on unnecessary reaching definitions though.

This patch changes the implementation to first compute the most
recent reaching definition in one loop, and then insert only that
one in a separate loop.

Differential Revision: https://reviews.llvm.org/D77508




More information about the All-commits mailing list