<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - assert in GVN::propagateEquality assert(LHS->getType() == RHS->getType() && "Equality but unequal types!")"
   href="https://llvm.org/bugs/show_bug.cgi?id=24521">24521</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>assert in GVN::propagateEquality assert(LHS->getType() == RHS->getType() && "Equality but unequal types!")
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gekkekoe@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When passing the following IR to the passmanager I'm getting assert failures on
some test code. 

The IR works fine on 3.6.2. but with 3.7rc2 i'm getting assertion errors.

define double @bugfunc1(double %y, i64 %z) #0 {
entry:
  %"1_k" = alloca i64
  store i64 %z, i64* %"1_k"
  br label %loopcond

loop:                                             ; preds = %loopcond
  %load.ident = load i64, i64* %"1_k"
  %addIntTmp = add i64 %load.ident, 1
  store i64 %addIntTmp, i64* %"1_k"
  br label %loopcond

loopcond:                                         ; preds = %loop, %entry
  %load.ident1 = load i64, i64* %"1_k"
  %cmpIntTmp = icmp slt i64 %load.ident1, 3
  br i1 %cmpIntTmp, label %loop, label %loopexit

loopexit:                                         ; preds = %loopcond
  ret double 1.000000e+00
}

If I replace the 
  %cmpIntTmp = icmp slt i64 %load.ident1, 3

with a constant true, then the error goes away. It seems that something is
going wrong while trying to optimize the icmp instr.

The pass manager is initialized as:

passmanager = LLVMCreateFunctionPassManagerForModule(module);           
LLVMAddTargetData(LLVMGetExecutionEngineTargetData(engine), passmanager);
LLVMAddBasicAliasAnalysisPass(passmanager);
LLVMAddPromoteMemoryToRegisterPass(passmanager);
LLVMAddInstructionCombiningPass(passmanager);
LLVMAddReassociatePass(passmanager);
LLVMAddGVNPass(passmanager);
LLVMAddCFGSimplificationPass(passmanager);
LLVMInitializeFunctionPassManager(passmanager);

I'm using visual studio 2015.</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>