Open cardigan1008 opened 4 days ago
Reduced reproducer: https://godbolt.org/z/bK3z9nGsa
; bin/opt -passes="loop-mssa(licm,simple-loop-unswitch<nontrivial;trivial>)" reduced.ll -S
; ModuleID = 'reduced.bc'
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: allockind("alloc,uninitialized")
declare ptr @malloc() #0
define void @j(i1 %cmp2.i) {
entry:
br label %for.cond
for.cond: ; preds = %for.cond1.for.cond_crit_edge, %entry
br label %for.cond1
for.cond1: ; preds = %for.body.i, %for.body, %for.cond
br i1 false, label %for.cond1.for.cond_crit_edge, label %for.body
for.cond1.for.cond_crit_edge: ; preds = %for.cond1
br label %for.cond
for.body: ; preds = %for.cond1
%call.i = call ptr @malloc()
%cmp.i = icmp ne ptr %call.i, null
%or.cond.i = select i1 %cmp.i, i1 %cmp2.i, i1 false
br i1 %or.cond.i, label %for.body.i, label %for.cond1
for.body.i: ; preds = %for.body
br label %for.cond1
}
attributes #0 = { allockind("alloc,uninitialized") }
When I compiled the code with -O3, it crashed:
Bisected to https://github.com/llvm/llvm-project/commit/5a3e3675f6be3c49fb1a305202888cce4d916ba6, which was committed by @durin42
Compiler explorer: https://godbolt.org/z/3Wc1jdx6d
Crash is: