OSDN Git Service

CVP: Make CVP iterate in an order that maximizes reuse of LVI cache
authorDaniel Berlin <dberlin@dberlin.org>
Wed, 8 Feb 2017 02:35:07 +0000 (02:35 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Wed, 8 Feb 2017 02:35:07 +0000 (02:35 +0000)
commite8cf5cb2ee75e610d661eb595bafee5e3b9a9c9a
tree6d7b542c5de7e2cce66913be5cfe327fce282a1f
parent8eea5ab6a2e98f5b7f02b9c8f9f3e8be94f060b1
CVP: Make CVP iterate in an order that maximizes reuse of LVI cache

Summary:
After the DFS order change for LVI, i have a few testcases that now
take forever.

The TL;DR - This is mainly due to the overdefined cache, but that
requires predicateinfo to fix[1]

In order to maximize reuse of the LVI cache for now, change the order
we iterate in.

This reduces my testcase from 5 minutes to 4 seconds.

I have verified cases like gmic do not get slower.

I am playing with whether the order should be postorder or idf.

[1] In practice, overdefined anywhere should be overdefined
everywhere, so this cache should be global.  That also fixes this bug.
The problem, however, is that LVI relies on this cache being filled in
per-block because it wants different values in different blocks due to
precisely the naming issue that predicateinfo fixes.  With
predicateinfo, making the cache global works fine on individual
passes, and also resolves this issue.

Reviewers: davide, sanjoy, chandlerc

Subscribers: llvm-commits, djasper

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294398 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/CorrelatedValuePropagation.cpp