Fix PR14132 and handle OOB loads speculated throuh PHI nodes.
authorChandler Carruth <chandlerc@gmail.com>
Tue, 20 Nov 2012 10:02:19 +0000 (10:02 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 20 Nov 2012 10:02:19 +0000 (10:02 +0000)
commit176792990e1b8df4894d0dabddb735abbb254e7c
tree0f19caa7fd549195f659413541d912438c600d10
parent310f248c22c5a20eaa4de1e612af3338a89144f3
Fix PR14132 and handle OOB loads speculated throuh PHI nodes.

The issue is that we may end up with newly OOB loads when speculating
a load into the predecessors of a PHI node, and this confuses the new
integer splitting logic in some cases, triggering an assertion failure.
In fact, the branch in question must be dead code as it loads from
a too-narrow alloca. Add code to handle this gracefully and leave the
requisite FIXMEs for both optimizing more aggressively and doing more to
aid sanitizing invalid code which triggers these patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168361 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
test/Transforms/SROA/phi-and-select.ll