1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/Transforms
George Burgess IV 5b40ed6e26 [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. :)

llvm-svn: 264820
2016-03-30 03:12:08 +00:00
..
Hello Remove autoconf support 2016-01-26 21:29:08 +00:00
InstCombine Minor code cleanup. NFC. 2016-03-23 01:38:35 +00:00
Instrumentation [PGO] Handle invoke inst in IR based icall instrumentation 2016-03-30 02:16:07 +00:00
IPO Make InlineSimple's one-arg constructor explicit. NFC 2016-03-29 16:26:06 +00:00
ObjCARC ADT: Remove == and != comparisons between ilist iterators and pointers 2016-02-21 20:39:50 +00:00
Scalar [LoopDataPrefetch] Centralize the tuning cl::opts under the pass 2016-03-29 23:45:52 +00:00
Utils [MemorySSA] Make the visitor more careful with calls. 2016-03-30 03:12:08 +00:00
Vectorize [SLP] Remove unnecessary member variables by using container APIs. 2016-03-21 19:47:44 +00:00
CMakeLists.txt
LLVMBuild.txt