[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)
commit513aadecac2514a282b748a88c17743948144089
tree444443646a6b28fe0a647071c64860cedb2ef78f
parent3ca2099fdf35351e77d9d3be1068d0d7ca8e62a1
[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

llvm-svn: 238881
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/X86/pr23603.ll [new file with mode: 0644]