[llvm-bugs] [Bug 38778] New: simple-loop-unswitch asserts after nontrivial unswitch: Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 30 08:39:10 PDT 2018


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

            Bug ID: 38778
           Summary: simple-loop-unswitch asserts after nontrivial
                    unswitch: Assertion `use_empty() && "Uses remain when
                    a value is destroyed!"' failed.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: fedor.v.sergeev at gmail.com
                CC: llvm-bugs at lists.llvm.org

Yet another assert on simple loop unswitch:
] cat bad-unswitch-reduced.ll
define void @Test(i32) {
  br label %loop
loop:
  switch i32 %0, label %continue [
    i32 -2147483648, label %check
    i32 98, label %guarded1
    i32 99, label %guarded2
  ]
guarded1:
  br i1 undef, label %continue, label %leave
guarded2:
  br label %continue
check:
  %val = add i32 0, 1
  br i1 undef, label %continue, label %leave
continue:
  br label %loop
leave:
  %local = phi i32 [ 0, %guarded1 ], [ %val, %check ]
  ret void
}
] DEBUG/bin/opt -passes=unswitch -enable-nontrivial-unswitch
bad-unswitch-reduced.ll 2>&1 -disable-output | head
While deleting: i32 %val
Use still stuck around after Def is destroyed:  %.us-phi5 = phi i32 [ %val,
%leave.split.split ], [ %local.us4, %leave.split.split.us ]
opt: /home/fsergeev/work/orca/lib/IR/Value.cpp:92: llvm::Value::~Value():
Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.
Stack dump:
0.      Program arguments:
/home/fsergeev/work/sandbox/fromorca/installDA/bin/opt -passes=unswitch
-enable-nontrivial-unswitch bad-unswitch-reduced.ll -disable-output 
#0 0x00007f520b8f4a68 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/fsergeev/work/orca/lib/Support/Unix/Signals.inc:490:0
#1 0x00007f520b8f4af9 PrintStackTraceSignalHandler(void*)
/home/fsergeev/work/orca/lib/Support/Unix/Signals.inc:554:0
#2 0x00007f520b8f2b09 llvm::sys::RunSignalHandlers()
/home/fsergeev/work/orca/lib/Support/Signals.cpp:67:0
#3 0x00007f520b8f4509 SignalHandler(int)
/home/fsergeev/work/orca/lib/Support/Unix/Signals.inc:353:0
#4 0x00007f52092fa390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
]

It happens during deleteDeadBlocksFromLoop cleanup.
Recent change for 38737 does not affect this failure.

-- 
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/20180830/a11d78cd/attachment.html>


More information about the llvm-bugs mailing list