[PATCH] D11607: Fix infinite loop in Shrink Wrapping

Kit Barton kbarton at ca.ibm.com
Wed Jul 29 13:55:48 PDT 2015


kbarton created this revision.
kbarton added a reviewer: qcolombet.
kbarton added subscribers: llvm-commits, wschmidt, hfinkel.

There is an infinite loop that can occur in Shrink Wrapping while searching for the Save/Restore points. 
Part of this search checks whether the save/restore points are located in different loop nests and if so, uses the (post) dominator trees to find the immediate (post) dominator blocks. However, if the current block does not have any immediate (post) dominators then this search will result in an infinite loop. This can occur in code containing an infinite loop.

The modification checks whether the immediate (post) dominator is different from the current save/restore block. If it is not, then the search terminates and the current location is not considered as a valid save/restore point for shrink wrapping. 
 

http://reviews.llvm.org/D11607

Files:
  lib/CodeGen/ShrinkWrap.cpp
  test/CodeGen/AArch64/arm64-shrink-wrapping.ll
  test/CodeGen/ARM/arm-shrink-wrapping.ll
  test/CodeGen/X86/x86-shrink-wrapping.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11607.30943.patch
Type: text/x-patch
Size: 5521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150729/14959707/attachment.bin>


More information about the llvm-commits mailing list