[llvm-bugs] [Bug 32372] New: llvm-stress causes DAGCombiner crash

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 22 07:36:57 PDT 2017


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

            Bug ID: 32372
           Summary: llvm-stress causes DAGCombiner crash
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          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 18145
  --> https://bugs.llvm.org/attachment.cgi?id=18145&action=edit
reduced test case

Reduced test case, when run with

llc -mtriple=s390x-linux-gnu -mcpu=z13

results in

llc: /home/jonas/llvm/llvm-dev/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:746:
bool llvm::SelectionDAG::RemoveNodeFromCSEMaps(llvm::SDNode*): Assertion
`N->getOpcode() != ISD::DELETED_NODE && "DELETED_NODE in CSEMap!"' failed.

At first glance, it seems that the
CombineTo(N, (N0.getNode() == Load) ? NewLoad : N0);
in visitAND() should be guarded with a check if N or N0 has already been
deleted?

----
backtracking:


21: DAG.dump() = SelectionDAG has 21 nodes:
  t0: ch = EntryToken
  t2: i64,ch = CopyFromReg t0, Register:i64 %vreg2
  t32: i32,ch = load<LD1[%0], zext from i8> t0, t2, undef:i64
  t38: i32,ch = load<LD1[%0], anyext from i8> t0, t2, undef:i64
  t44: i32 = Constant<-1>
          t41: i32 = and t32, Constant:i32<255>
          t42: i32 = and t38, Constant:i32<255>
        t43: i32 = urem t41, t42
      t22: v16i8 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, t43, undef:i32, undef:i32, undef:i32, undef:i32, undef:i32,
undef:i32, undef:i32, undef:i32
    t24: ch = CopyToReg t0, Register:v16i8 %vreg0, t22
    t28: ch = CopyToReg t0, Register:i32 %vreg1, t32
    t39: ch = store<ST2[undef], trunc to i16> t38:1, Constant:i32<-3825>,
undef:i64, undef:i64
  t29: ch = TokenFactor t24, t28, t39

Combining: t42: i32 = and t38, Constant:i32<255>

SDValue DAGCombiner::visitAND()  ->

(gdb) p N->dump()
t42: i32 = and t38, Constant:i32<255>
CombineTo(Load, NewLoad.getValue(0), NewLoad.getValue(1));
(gdb) p N0->dump()

t38: i32,ch = load<LD1[%0], anyext from i8> t0, t2, undef:i64  ->

(gdb) p N->dump()
t42: i32 = <<Deleted Node!>>
(gdb) p N0->dump()
t38: i32,ch = <<Deleted Node!>>

// Fold the AND away, taking care not to fold to the old load node if we
// replaced it.
CombineTo(N, (N0.getNode() == Load) ? NewLoad : N0); ->

Replacing.1 t42: i32 = <<Deleted Node!>>

With: t32: i32,ch = load<LD1[%0], zext from i8> t0, t2, undef:i64
 and 0 other values
llc: /home/jonas/llvm/llvm-dev/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:746:
bool llvm::SelectionDAG::RemoveNodeFromCSEMaps(llvm::SDNode*): Assertion
`N->getOpcode() != ISD::DELETED_NODE && "DELETED_NODE in CSEMap!"' failed.

-- 
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/20170322/f71d7422/attachment.html>


More information about the llvm-bugs mailing list