Open mikaelholmen opened 6 years ago
Still reproduces with -passes=loop-versioning -aa-pipeline=''
: https://clang.godbolt.org/z/xMKo5P989
target triple = "x86_64-unknown-linux-gnu"
@a = external global i16, align 1
@b = external global i16, align 1
@c = external global i16, align 1
define void @f2() {
entry:
br label %for.body
for.body: ; preds = %for.body, %entry
%0 = load i16, ptr @a, align 1
store i16 %0, ptr @b, align 1
%inc = add nsw i16 undef, 1
br i1 false, label %for.body, label %for.cond.for.end_crit_edge
for.cond.for.end_crit_edge: ; preds = %for.body
%split2 = phi i16 [ %inc, %for.body ]
store i16 %inc, ptr @c, align 1
ret void
}
Converted the testcase to opaque pointers. Able to reproduce with opt -passes=loop-versioning -aa-pipeline='' crash.ll
I want to work on this issue, can I assign this to self?
Still reproduces with
-passes=loop-versioning -aa-pipeline=''
: https://clang.godbolt.org/z/xMKo5P989
The IR ins't in LCSSA form, in the critical edge, store uses inc which is a value defined inside the loop.
I have pushed a fix for this, thanks (cc: @fhahn and @aeubanks) (https://github.com/llvm/llvm-project/pull/116443)
Thanks, Vedant
Extended Description
opt -S -o - bbi-14805.ll -disable-basicaa -loop-versioning
gives
Instruction does not dominate all uses! %inc = add nsw i16 undef, 1 store i16 %inc, i16* @c, align 1 LLVM ERROR: Broken function found, compilation aborted!
Found when running random passes/flags on random input. We don't normally use -disable-basicaa -loop-versioning.
This happens also with some old opt binary built in Nov 2016.