[llvm-bugs] [Bug 24521] New: assert in GVN::propagateEquality assert(LHS->getType() == RHS->getType() && "Equality but unequal types!")

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 20 05:22:24 PDT 2015


            Bug ID: 24521
           Summary: assert in GVN::propagateEquality assert(LHS->getType()
                    == RHS->getType() && "Equality but unequal types!")
           Product: new-bugs
           Version: 3.7
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: gekkekoe at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

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 {
  %"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);

I'm using visual studio 2015.

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/20150820/d3a9e4ad/attachment.html>

More information about the llvm-bugs mailing list