Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

assertion failure in induction variable simplification with zext #35977

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR37004
Status NEW
Importance P normal
Reported by Eric Schweitz (eschweitz@nvidia.com)
Reported on 2018-04-04 11:49:02 -0700
Last modified on 2021-04-12 19:42:48 -0700
Version trunk
Hardware PC Linux
CC czhengsz@cn.ibm.com, llvm-bugs@lists.llvm.org, nemanja.i.ibm@gmail.com, stefanp@ca.ibm.com
Fixed by commit(s)
Attachments bugpoint-reduced-simplified.bc (1456 bytes, application/octet-stream)
Blocks
Blocked by
See also
Created attachment 20157
reduced test

Originally found on Power, but get same behavior with X86.

% opt bugpoint-reduced-simplified.bc -indvars -o /dev/null
...
Stack dump:
0.      Program arguments: opt bugpoint-reduced-simplified.bc -indvars -o
/dev/null
1.      Running pass 'Function Pass Manager' on module 'bugpoint-reduced-
simplified.bc'.
2.      Running pass 'Loop Pass Manager' on function '@bug'
3.      Running pass 'Induction Variable Simplification' on basic block
'%L.B0155'
Segmentation fault
Quuxplusone commented 6 years ago

Attached bugpoint-reduced-simplified.bc (1456 bytes, application/octet-stream): reduced test

Quuxplusone commented 6 years ago
It looks like this bug is hidden by this patch:
https://reviews.llvm.org/D47974

The test case provided no longer fails.

I've updated the test case as follows:

$ cat bugpoint-reduced-simplified.ll
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-4e419f3.bc"
target datalayout = "e-p:64:64-i64:64-n32:64"
target triple = "powerpc64le-linux"

; Function Attrs: inlinehint
define void @bug() local_unnamed_addr #0 personality i8* bitcast (i32 (...)*
@__gxx_personality_v0 to i8*) {
L.entry:
  br label %L.B0155

L.B0155:                                          ; preds = %L.B0155, %L.entry
  %.G0001.addr.0 = phi i8* [ null, %L.entry ], [ %2, %L.B0155 ]
  %p.addr.0 = phi i32 [ 0, %L.entry ], [ %1, %L.B0155 ]
  %0 = zext i32 %p.addr.0 to i64
  %1 = add i32 %p.addr.0, 1
  %2 = getelementptr i8, i8* %.G0001.addr.0, i64 1
  br i1 undef, label %L.B0156, label %L.B0155

L.B0156:                                          ; preds = %L.B0155
  call void @foo(i64 %0)
  ret void
}

declare i32 @__gxx_personality_v0(...)

declare void @foo(i64)

attributes #0 = { inlinehint }

!llvm.module.flags = !{!0}

!0 = !{i32 1, !"Debug Info Version", i32 3}

The above example still fails with top of trunk.
To run use:
opt bugpoint-reduced-simplified.ll -indvars -o /dev/null
Quuxplusone commented 4 years ago

https://reviews.llvm.org/D80975 should resolve the failure in comment 1.

Quuxplusone commented 3 years ago

This has been committed long ago. Is this fixed and can be closed?