[PATCH] D23843: GVN-hoist: fix hoistingFromAllPaths for loops (PR29034)

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 11:08:55 PDT 2016


sebpop created this revision.
sebpop added a reviewer: dberlin.
sebpop added subscribers: llvm-commits, hiraditya.

It is invalid to hoist stores or loads if they are not executed on all paths
from the hoisting point to the exit of the function. In the testcase, there are
paths in the loop that do not execute the stores or the loads, and so hoisting
them within the loop is unsafe.
    
The problem is that the current implementation of hoistingFromAllPaths is
incomplete: it walks all blocks dominated by the hoisting point, and does not
return false when the loop contains a path on which the hoisted ld/st is
not executed.


https://reviews.llvm.org/D23843

Files:
  llvm/lib/Transforms/Scalar/GVNHoist.cpp
  llvm/test/Transforms/GVNHoist/pr29034.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23843.69141.patch
Type: text/x-patch
Size: 12595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160824/31efb00b/attachment.bin>


More information about the llvm-commits mailing list