[SelectionDAG] Fix PR23603.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 2 Jun 2015 22:33:30 +0000 (22:33 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 2 Jun 2015 22:33:30 +0000 (22:33 +0000)
commit8fadf8f4d3cade0bc50faa23a6575588c67ecd67
tree8e815f8cbf733ac98a2323098843e39b26612505
parent4cc59a13c7634c822f8ec6255e3c6f38b03b6f81
[SelectionDAG] Fix PR23603.

Summary:
LLVM's MI level notion of invariant_load is different from LLVM's IR
level notion of invariant_load with respect to dereferenceability.  The
IR notion of invariant_load only guarantees that all *non-faulting*
invariant loads result in the same value.  The MI notion of invariant
load guarantees that the load can be legally moved to any location
within its containing function.  The MI notion of invariant_load is
stronger than the IR notion of invariant_load -- an MI invariant_load is
an IR invariant_load + a guarantee that the location being loaded from
is dereferenceable throughout the function's lifetime.

Reviewers: hfinkel, reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238881 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/X86/pr23603.ll [new file with mode: 0644]