This is an archive of the discontinued LLVM Phabricator instance.

[RFC] [LLVM] [LazyValueInfo] Introduce getRecurringEdgeValue to handle simple recurrence
Needs RevisionPublic

Authored by etherzhhb on Jul 25 2017, 2:52 PM.

Details

Summary

Teach LazyValueInfo to handle simple patterns on the PHINodes, including:

  1. Induction variable of natural loop that increased by 1
  2. select (phi (init, select)) generated from linear search

This is accomplished by computing the value of PHINode recurring edge based on mathematical fixed-point. We will fallback to getEdgeValue if we cannot handle the recurring edge.

PS: How should I add unittest for this? since it is "lazy". maybe I should come back with a LazyValueInfo printer

Diff Detail

Repository
rL LLVM

Event Timeline

etherzhhb created this revision.Jul 25 2017, 2:52 PM
regehr edited edge metadata.Jul 25 2017, 3:54 PM

Could you please quantify the effect that this has on compile time? Time for an optimized -j1 compile of LLVM itself is reasonable. Also it would be nice to know what effect this has on generated code.

Could you please quantify the effect that this has on compile time? Time for an optimized -j1 compile of LLVM itself is reasonable. Also it would be nice to know what effect this has on generated code.

Sure, will do that.

reames requested changes to this revision.Oct 10 2017, 12:06 PM

Pending update per last comment, just getting this off review queue.

This revision now requires changes to proceed.Oct 10 2017, 12:06 PM
sanjoy resigned from this revision.Jan 29 2022, 5:44 PM