[LV][CFG] Add irreducible CFG detection for outer loops
authorFlorian Hahn <florian.hahn@arm.com>
Fri, 2 Mar 2018 12:24:25 +0000 (12:24 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Fri, 2 Mar 2018 12:24:25 +0000 (12:24 +0000)
commit515acd64fd100322c92691971674399155132dfe
tree56acd0a2cca20ae440128c98dafde7ff8e95ec2a
parentb46c191c4979bde12a11c8f087a874e810a625b7
[LV][CFG] Add irreducible CFG detection for outer loops

This patch adds support for detecting outer loops with irreducible control
flow in LV. Current detection uses SCCs and only works for innermost loops.
This patch adds a utility function that works on any CFG, given its RPO
traversal and its LoopInfoBase. This function is a generalization
of isIrreducibleCFG  from lib/CodeGen/ShrinkWrap.cpp. The code in
lib/CodeGen/ShrinkWrap.cpp is also updated to use the new generic utility
function.

Patch by Diego Caballero <diego.caballero@intel.com>

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

llvm-svn: 326568
llvm/include/llvm/Analysis/CFG.h
llvm/include/llvm/Analysis/LoopIterator.h
llvm/lib/CodeGen/ShrinkWrap.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp