[llvm-bugs] [Bug 36484] New: Assertion failure with GVNHoist: Assertion `MSSA->dominates(NewDef, FirstDef) && "Should have dominated the new access"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 22 18:44:22 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36484

            Bug ID: 36484
           Summary: Assertion failure with GVNHoist: Assertion
                    `MSSA->dominates(NewDef, FirstDef) && "Should have
                    dominated the new access"' failed.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: efriedma at codeaurora.org
                CC: dberlin at dberlin.org, hiraditya at msn.com,
                    llvm-bugs at lists.llvm.org

Testcase (crashes with "opt -gvn-hoist"):

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"

define void @f(i8* %p) {
entry:
  switch i4 undef, label %if.then30 [
    i4 4, label %if.end
    i4 0, label %if.end
  ]

if.end:
  br label %if.end19

if.end19:
  br i1 undef, label %e, label %e.thread

e.thread:
  store i8 0, i8* %p, align 4
  br label %if.then30

if.then30:
  call void @g()
  unreachable

e:
  store i8 0, i8* %p, align 4
  unreachable
}

declare void @g()



--------------------------------------------------------------------

The issue is related to the MemoryPhi in the block if.then30. 
MemorySSAUpdater::moveTo erases the store in the block e.thread, then erases
the MemoryPHI in if.then30 because it's trivial (temporarily), then tries to
insert a def in if.end19.  fixupDefs then asserts that if.end19 dominates
if.then30, which is not true.

Not sure what the right fix is here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180223/bc28f227/attachment.html>


More information about the llvm-bugs mailing list