[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
Wed May 10 13:44:44 PDT 2017


hiraditya updated this revision to Diff 98515.
hiraditya added a comment.

Addressed @chandlerc 's comments: Essentially, I've added test cases for cycles due to direct branches, indirect branches and invoke instructions.

Test cases show:

- hoisting does not happen when anticipability cannot be guaranteed because of infinite loops in one of the paths
- when it is okay to hoist out of indirect branch targets and irreducible control flow because anticipability is satisfied
- that cycle due to indirect branches prevents hoisting
- that no hoisting happens when there is a cycle due to invoke
- instruction can be hoisted out of catch blocks when legality is satisfied

Please let me know if I may have missed any test case.


https://reviews.llvm.org/D32614

Files:
  llvm/lib/Transforms/Scalar/GVNHoist.cpp
  llvm/test/Transforms/GVNHoist/infinite-loop-direct.ll
  llvm/test/Transforms/GVNHoist/infinite-loop-indirect.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32614.98515.patch
Type: text/x-patch
Size: 16899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170510/1fe9eaed/attachment.bin>


More information about the llvm-commits mailing list