llvm-6502/lib
Chandler Carruth e1a5243053 Fix a really nasty SROA bug with how we handled out-of-bounds memcpy
intrinsics.

Reported on the list by Evan with a couple of attempts to fix, but it
took a while to dig down to the root cause. There are two overlapping
bugs here, both centering around the circumstance of discovering
a memcpy operand which is known to be completely outside the bounds of
the alloca.

First, we need to kill the *other* side of the memcpy if it was added to
this alloca. Otherwise we'll factor it into our slicing and try to
rewrite it even though we know for a fact that it is dead. This is made
more tricky because we can visit the sides in either order. So we have
to both kill the other side and skip instructions marked as dead. The
latter really should be goodness in every case, but here is a matter of
correctness.

Second, we need to actually remove the *uses* of the alloca by the
memcpy when queuing it for later deletion. Otherwise it may still be
using the alloca when we go to promote it (if the rewrite re-uses the
existing alloca instruction). Do this by factoring out the
use-clobbering used when for nixing a Phi argument and re-using it
across the operands of a to-be-deleted instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199590 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-19 12:16:54 +00:00
..
Analysis [PM] Make the verifier work independently of any pass manager. 2014-01-19 02:22:18 +00:00
AsmParser Add an inalloca flag to allocas 2014-01-17 23:58:17 +00:00
Bitcode Make parseBitcodeFile return an ErrorOr<Module *>. 2014-01-15 01:08:23 +00:00
CodeGen Debug info (LTO): Move the creation of accessibility flags to 2014-01-18 02:12:00 +00:00
DebugInfo llvm-dwarfdump: type unit dwo support 2014-01-09 05:08:24 +00:00
ExecutionEngine Attempt to fix the MSVC build. 2014-01-16 05:09:32 +00:00
IR [PM] Make the verifier work independently of any pass manager. 2014-01-19 02:22:18 +00:00
IRReader Make parseBitcodeFile return an ErrorOr<Module *>. 2014-01-15 01:08:23 +00:00
Linker Reapply r194218 with fix: 2014-01-16 06:29:36 +00:00
LTO [LTO] Add a hook to map LLVM diagnostics into the clients of LTO. 2014-01-15 22:04:35 +00:00
MC Tweak the MCExternalSymbolizer to print references to C string literals 2014-01-16 18:43:56 +00:00
Object 80-column. 2014-01-17 22:11:27 +00:00
Option Avoid buffer copies when a Twine already is a StringRef. 2013-12-03 18:18:28 +00:00
Support ARM: update build attributes for ABI r2.09 2014-01-19 08:25:35 +00:00
TableGen [TableGen] Correctly generate implicit anonymous prototype defs in multiclasses 2014-01-02 20:47:09 +00:00
Target ARM ELF: ensure that the tag types are corrected 2014-01-19 08:25:41 +00:00
Transforms Fix a really nasty SROA bug with how we handled out-of-bounds memcpy 2014-01-19 12:16:54 +00:00
CMakeLists.txt Move LTO support library to a component, allowing it to be tested 2013-09-24 23:52:22 +00:00
LLVMBuild.txt Move LTO support library to a component, allowing it to be tested 2013-09-24 23:52:22 +00:00
Makefile Reformat Makefile. No other changes. 2013-10-30 04:03:03 +00:00