<html>
    <head>
      <base href="http://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LICM fails AssertingVH check"
   href="http://bugs.llvm.org/show_bug.cgi?id=32129">32129</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LICM fails AssertingVH check
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Loop Optimizer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>igor@azulsystems.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Running this command: opt  -licm -loop-unswitch -licm tmp.ll

On the following test case:

declare void @llvm.experimental.guard(i1, ...)

define void @test() {
entry:
  br label %header

header:
  br label %loop

loop:
  %0 = icmp ult i32 0, 400
  call void (i1, ...) @llvm.experimental.guard(i1 %0, i32 9) [ "deopt"() ]
  br i1 undef, label %header, label %loop
}


Leads to the LICM crash:

While deleting: void %
An asserting value handle still pointed to this value!
UNREACHABLE executed at /Users/igor/Projects/llvm-svn/lib/IR/Value.cpp:830!
0  opt                      0x000000010b3438d8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  opt                      0x000000010b343fd6 SignalHandler(int) + 454
2  libsystem_platform.dylib 0x00007fffd8f51bba _sigtramp + 26
3  libsystem_platform.dylib 0x0000000117f6a291 _sigtramp + 1057064689
4  libsystem_c.dylib        0x00007fffd8dd8420 abort + 129
5  opt                      0x000000010b2da817
llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 471
6  opt                      0x000000010adf2bb9
llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*) + 1081
7  opt                      0x000000010adf243a llvm::Value::~Value() + 42
8  opt                      0x000000010ad7bdbe llvm::CallInst::~CallInst() + 14
9  opt                      0x000000010ad77971
llvm::Instruction::eraseFromParent() + 97
10 opt                      0x000000010b1480f0
llvm::sinkRegion(llvm::DomTreeNodeBase<llvm::BasicBlock>*, llvm::AAResults*,
llvm::LoopInfo*, llvm::DominatorTree*, llvm::TargetLibraryInfo*, llvm::Loop*,
ll
<truncated></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>