[PATCH] D27582: Avoid infinite loops in branch folding

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 16:46:13 PST 2016


andrew.w.kaylor updated this revision to Diff 80974.
andrew.w.kaylor added a comment.

I moved the isEHPad() check, as suggested.

I was able to reduce the test case a little more.  The arguments to g() were only necessary to prevent a tail call optimization.  Simply removing 'tail' from the call instruction dealt with that.  I was also able to remove a few of the switch statement entries and simplify the control flow slightly.  The remaining complexity is necessary to prevent intermediate passes (I think mostly the instruction selector) from simplifying a few remaining branches and reordering blocks such that the conditions for the failure are no longer met.

I updated the comments to better explain the failure condition a bit more.


Repository:
  rL LLVM

https://reviews.llvm.org/D27582

Files:
  lib/CodeGen/BranchFolding.cpp
  test/CodeGen/WinEH/wineh-noret-cleanup.ll
  test/CodeGen/X86/branchfolding-catchpads.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27582.80974.patch
Type: text/x-patch
Size: 5091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161210/bd9c6adc/attachment.bin>


More information about the llvm-commits mailing list