[llvm-bugs] [Bug 36588] New: DAGCombiner: UNREACHABLE "Operand not processed?"

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 3 02:41:44 PST 2018


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

            Bug ID: 36588
           Summary: DAGCombiner: 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 19993
  --> https://bugs.llvm.org/attachment.cgi?id=19993&action=edit
reduced testcase

A small, reduced csmith program seems to expose some bug in DAGCombiner where a
brcond gets incorrectly combined:

=== main
Initial selection DAG: %bb.0 'main:'
SelectionDAG has 16 nodes:
  t2: ch = seteq
    t6: i1 = setcc undef:i32, Constant:i32<0>, setne:ch
  t7: i1 = or t6, Constant:i1<-1>
        t0: ch = EntryToken
        t8: i32 = any_extend t7
      t10: ch = CopyToReg t0, Register:i32 %0, t8
      t11: i1 = xor t7, Constant:i1<-1>
    t13: ch = brcond t10, t11, BasicBlock:ch< 0x28c29288>
  t15: ch = br t13, BasicBlock:ch<.preheader 0x28c29108>

Optimized lowered selection DAG: %bb.0 'main:'
SelectionDAG has 8 nodes:
      t0: ch = EntryToken
    t10: ch = CopyToReg t0, Register:i32 %0, Constant:i32<1>
  t17: ch = brcond t10, t17, BasicBlock:ch< 0x28c29288>
  t15: ch = br t17, BasicBlock:ch<.preheader 0x28c29108>


Operand not processed?
t15: ch = br t17, BasicBlock:ch<.preheader 0x28c29108>


---


Initial selection DAG: %bb.0 'main:'
SelectionDAG has 16 nodes:
  t2: ch = seteq
    t6: i1 = setcc undef:i32, Constant:i32<0>, setne:ch
  t7: i1 = or t6, Constant:i1<-1>
        t0: ch = EntryToken
        t8: i32 = any_extend t7
      t10: ch = CopyToReg t0, Register:i32 %0, t8
      t11: i1 = xor t7, Constant:i1<-1>
    t13: ch = brcond t10, t11, BasicBlock:ch< 0x36a3afd8>
  t15: ch = br t13, BasicBlock:ch<.preheader 0x36a3ae58>


Combining: t15: ch = br t13, BasicBlock:ch<.preheader 0x36a3ae58>

Combining: t14: ch = BasicBlock<.preheader 0x36a3ae58>

Combining: t13: ch = brcond t10, t11, BasicBlock:ch< 0x36a3afd8>

Replacing.2 t11: i1 = xor t7, Constant:i1<-1>

With: t16: i1 = Constant<0>

 ... into: t17: ch = brcond t10, t17, BasicBlock:ch< 0x36a3afd8>

...

After first time in visitBRCOND(), the CC i1 becomes constant, and then things
seem to go wrong. t17 is then using itself which is impossible.

---

bin/llc -mtriple=s390x-linux-gnu -mcpu=z13  tc_isel.ll -o out.s -O3

-- 
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/20180303/63ae08e4/attachment.html>


More information about the llvm-bugs mailing list