Avoid folding loads that are unsafe to move.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 20 Jul 2012 21:29:31 +0000 (21:29 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 20 Jul 2012 21:29:31 +0000 (21:29 +0000)
commit2ec0cda5d5ede57022eb7dc5e7170f4fa420cb2b
treecaf2220e5305521a65d48afd793f2e608a285424
parent7325f06051bab14196ab3701d515f5b110cefe26
Avoid folding loads that are unsafe to move.

LiveRangeEdit::foldAsLoad() can eliminate a register by folding a load
into its only use. Only do that when the load is safe to move, and it
won't extend any live ranges.

This fixes PR13414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160575 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveRangeEdit.cpp
test/CodeGen/X86/remat-fold-load.ll [new file with mode: 0644]