[all-commits] [llvm/llvm-project] 39beee: [LVI] Don't use dominator tree in isValidAssumeFor...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sun May 17 12:39:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 39beeeff205caf75ee56ff8967e2b12e7b3fb644
      https://github.com/llvm/llvm-project/commit/39beeeff205caf75ee56ff8967e2b12e7b3fb644
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-05-17 (Sun, 17 May 2020)

  Changed paths:
    M llvm/lib/Analysis/LazyValueInfo.cpp

  Log Message:
  -----------
  [LVI] Don't use dominator tree in isValidAssumeForContext()

LVI and its consumers currently have quite a bit of complexity
related to dominator tree management. However, it doesn't look
like it is actually needed...

The only use of the dominator tree is inside isValidAssumeForContext().
However, due to the way LVI queries work, it is not needed:
If we query a value for some block, we will first get the edge values
from all predecessor blocks, which also includes an intersection with
assumptions that apply to the terminator of the predecessor. As such,
we will already have processed all assumptions from predecessor blocks
(this is actually stronger than what isValidAssumeForContext() does
with a DT, because this is capable of combining non-dominating
assumptions). The only additional assumptions we need to take into
account are those in the block being queried. And we don't need a
dominator tree for that.

This patch only removes the use of DT, I will drop the machinery
around it in a followup.

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




More information about the All-commits mailing list