opt -O3 crashes with debug-only=loop-unroll
| Bugzilla Link | 27157 |
| Resolution | FIXED |
| Resolved on | Apr 08, 2016 18:34 |
| Version | trunk |
| OS | Linux |
| Attachments | opt input |
| CC | @hfinkel |
Extended Description
For the supplied test case, the LoopUnroll pass crashes in DT->verifyDomTree() if debug output is enabled. This causes the verifyDomTree() function to be called.
if (DT && !CompletelyUnroll) DT->recalculate(*L->getHeader()->getParent()); else DEBUG(DT->verifyDomTree()); <<<<<<<<<<<<<<<<<<
bin/opt ./reg-stack.bc -O3 -mtriple=s390x-linux-gnu -mcpu=z13 -debug-only=loop-unroll
Should be fixed in r265605.
I submitted a patch for review: http://reviews.llvm.org/D18712
This is a small reproducer:
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
; RUN: opt -loop-unroll -debug a.ll -disable-output define void @foo() { entry: br label %loop_header loop_header: %iv = phi i64 [ 0, %entry ], [ %iv_next, %loop_latch ] br i1 undef, label %loop_latch, label %loop_exiting_bb1 loop_exiting_bb1: br i1 false, label %loop_exiting_bb2, label %exit1.loopexit loop_exiting_bb2: br i1 false, label %loop_latch, label %bb bb: br label %exit1 loop_latch: %iv_next = add nuw nsw i64 %iv, 1 %cmp = icmp ne i64 %iv_next, 2 br i1 %cmp, label %loop_header, label %exit2 exit1.loopexit: br label %exit1 exit1: ret void exit2: ret void }
Thanks for the report, I'll take a look!