OSDN Git Service

[MemorySSA] Consider def-only BBs for live-in calculations.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 21 Mar 2016 21:25:39 +0000 (21:25 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 21 Mar 2016 21:25:39 +0000 (21:25 +0000)
commit127a8ddf859d0c2d38b51ed0bf186ccc54577961
treec62c4edb8f62dbab35619ee36a768c281d97aac9
parent4a0d91478fee4861acc355066c62edb43e6b8044
[MemorySSA] Consider def-only BBs for live-in calculations.

If we have a BB with only MemoryDefs, live-in calculations will ignore
it. This means we get results like this:

define void @foo(i8* %p) {
  ; 1 = MemoryDef(liveOnEntry)
  store i8 0, i8* %p
  br i1 undef, label %if.then, label %if.end

if.then:
  ; 2 = MemoryDef(1)
  store i8 1, i8* %p
  br label %if.end

if.end:
  ; 3 = MemoryDef(1)
  store i8 2, i8* %p
  ret void
}

...When there should be a MemoryPhi in the `if.end` BB.

This patch fixes that behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263991 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/MemorySSA.cpp
test/Transforms/Util/MemorySSA/livein.ll