llvm/test/Transforms/Util
George Burgess IV ff01852cd7 [MemorySSA] Make the visitor more careful with calls.
Prior to this patch, the MemorySSA caching visitor would cache all
calls that it visited. When paired with phi optimization, this can be
problematic. Consider:

define void @foo() {
  ; 1 = MemoryDef(liveOnEntry)
  call void @clobberFunction()
  br i1 undef, label %if.end, label %if.then

if.then:
  ; MemoryUse(??)
  call void @readOnlyFunction()
  ; 2 = MemoryDef(1)
  call void @clobberFunction()
  br label %if.end

if.end:
  ; 3 = MemoryPhi(...)
  ; MemoryUse(?)
  call void @readOnlyFunction()
  ret void
}

When optimizing MemoryUse(?), we visit defs 1 and 2, so we note to
cache them later. We ultimately end up not being able to optimize
passed the Phi, so we set MemoryUse(?) to point to the Phi. We then
cache the clobbering call for def 1 to be the Phi.

This commit changes this behavior so that we wipe out any calls
added to VisistedCalls while visiting the defs of a phi we couldn't
optimize.

Aside: With this patch, we now can bootstrap clang/LLVM without a
single MemorySSA verifier failure. Woohoo. :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30 03:12:08 +00:00
..
MemorySSA [MemorySSA] Make the visitor more careful with calls. 2016-03-30 03:12:08 +00:00
combine-alias-scope-metadata.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
flattencfg.ll
lowerswitch.ll Have a single way for creating unique value names. 2015-11-22 00:16:24 +00:00
simplify-dbg-declare-load.ll Clean up the processing of dbg.value in various places 2015-12-19 02:02:44 +00:00
split-bit-piece.ll [Utils] Insert DW_OP_bit_piece when only describing part of the variable 2016-01-12 22:46:09 +00:00
store-first-op.ll [Utils] Fix incorrect dbg.declare store conversion 2016-01-14 19:12:27 +00:00