[PATCH] D32614: [GVNHoist] Fix: PR32821, add check for anticipability in case of infinite loops

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 26 13:01:20 PDT 2017


hiraditya added a comment.

@dberlin 
When SSAPRE inserts PHI (expression PHIs), it does so at places where (potentially) multiple expressions may merge. If a PHI has a bottom (⊥) entry, that means the expression is partially available.
The concept may work for GVN-Hoist to help factor out anticipability by working on inverted graph. If we insert an outgoing PHI (if I may), to a basic block with multiple successors, as instructions are hoisted upwards to a nearest common dominator.
And we start walking the CFG to figure out if any outgoing PHI has a ⊥, that means the expression is not anticipable in the basic block having that outgoing PHI.
To minimize the number of outgoing PHIs, we will only insert them for expressions with multiple occurrences.
This will help remove the need to check for reachability.

Please let me know if this would be a way to factor out anticipability of expressions.

Thanks,
-Aditya


https://reviews.llvm.org/D32614





More information about the llvm-commits mailing list