Fix bug 25440: GVN assertion after coercing loads
authorWeiming Zhao <weimingz@codeaurora.org>
Thu, 19 Nov 2015 02:45:18 +0000 (02:45 +0000)
committerWeiming Zhao <weimingz@codeaurora.org>
Thu, 19 Nov 2015 02:45:18 +0000 (02:45 +0000)
commitf9d8b8d2ab35abd0dc879099cba8260833a04dc0
tree336f07a9fbd10b73c42fd98f0caa38504af86875
parent697477e00c3fc08795efb81f002fbf4ad3c055d1
Fix bug 25440: GVN assertion after coercing loads

Optimizations like LoadPRE in GVN will insert new instructions.
If the insertion point is in a already processed BB, they should
get a value number explicitly. If the insertion point is after
current instruction, then just leave it. However, current GVN framework
has no support for it.
In this patch, we just bail out if a VN can't be found.

Dfferential Revision: http://reviews.llvm.org/D14670

A    test/Transforms/GVN/pr25440.ll
M    lib/Transforms/Scalar/GVN.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253536 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
test/Transforms/GVN/pr25440.ll [new file with mode: 0644]