assertion failure in induction variable simplification with zext
| Bugzilla Link | 37004 |
| Version | trunk |
| OS | Linux |
| Attachments | reduced test |
| Reporter | LLVM Bugzilla Contributor |
| CC | @nemanjai,@stefanp-ibm |
Extended Description
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
-
Running pass 'Function Pass Manager' on module 'bugpoint-reduced-simplified.bc'. -
Running pass 'Loop Pass Manager' on function '@bug' -
Running pass 'Induction Variable Simplification' on basic block '%L.B0155'
Segmentation fault
This has been committed long ago. Is this fixed and can be closed?
https://reviews.llvm.org/D80975 should resolve the failure in comment 1.
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