[llvm-bugs] [Bug 36901] New: [DAGCombiner] visitBRCOND() leads to UNREACHABLE: "Operand not processed?"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 26 03:15:51 PDT 2018


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

            Bug ID: 36901
           Summary: [DAGCombiner]  visitBRCOND() leads to UNREACHABLE:
                    "Operand not processed?"
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20122
  --> https://bugs.llvm.org/attachment.cgi?id=20122&action=edit
reduced testcase

DAG:

  t5: i32 = Constant<0>
  t6: i32 = Constant<-1>
  t7: ch = setgt
    t4: i1 = setcc undef:i32, Constant:i32<-8>, setlt:ch
  t11: i1 = or t4, Constant:i1<-1>
    t10: i1 = setcc undef:i32, Constant:i32<-9>, setlt:ch
  t12: i1 = and t11, t10
      t0: ch = EntryToken
      t13: i1 = xor t11, Constant:i1<-1>
    t15: ch = brcond t0, t13, BasicBlock:ch< 0x5373f68>
  t17: ch = br t15, BasicBlock:ch< 0x5374428>

visitBRCOND() calls rebuildSetCC() which correctly replaces t13 like:

t15: ch = brcond t0, Constant:i1<0>, BasicBlock:ch< 0x5373f68>

After visit(N) (in combine()) returns, the DAG looks like

  t0: ch = EntryToken
  t5: i32 = Constant<0>
  t6: i32 = Constant<-1>
  t7: ch = setgt
      t4: i1 = setcc undef:i32, Constant:i32<-8>, setlt:ch
    t11: i1 = or t4, Constant:i1<-1>
    t10: i1 = setcc undef:i32, Constant:i32<-9>, setlt:ch
  t12: i1 = and t11, t10
    t15: ch = brcond t0, Constant:i1<0>, BasicBlock:ch< 0x5373f68>
  t17: ch = br t15, BasicBlock:ch< 0x5374428>

However, the returned RV looks like

t19: ch = brcond t0, t19, BasicBlock:ch< 0x5373f68>

, which has itself as operand! This is inserted into the DAG...

Runline:

llc -mtriple=s390x-linux-gnu -mcpu=z13 tc_brcond.ll

-- 
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/20180326/5108520f/attachment.html>


More information about the llvm-bugs mailing list