llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

opt crashes with "opt -O2 --attributor-enable=cgscc": Assertion `!UR.InvalidatedSCCs.count(C) && "Processing an invalid SCC!"' failed.

Open ZequanWu opened this issue 5 years ago • 4 comments

Bugzilla Link 49121
Resolution FIXED
Resolved on Feb 27, 2021 17:59
Version trunk
OS All
CC @aeubanks,@fhahn,@jdoerfert,@rnk,@sstefan1
Fixed by commit(s) b077d82b00d81934c7c27ac89dd8b0e7f448bded

Extended Description

reduced.ll:

%"a" = type { i64 } %"b" = type { i8 }

define hidden i64 @​f1() align 2 { entry: %ref.tmp = alloca %"a", align 8 %call2 = call i64 @​f2(%"a"* %ref.tmp) ret i64 %call2 }

define internal i64 @​f2(%"a"* %this) align 2 { entry: %this.addr = alloca %"a", align 8 store %"a" %this, %"a"** %this.addr, align 8 %this1 = load %"a", %"a"** %this.addr, align 8 %0 = bitcast %"a" %this1 to %"b"* call void @​f3(%"b"* %0) ret i64 undef }

define internal void @​f3(%"b"* %this) align 2 { entry: %this.addr = alloca %"b", align 8 store %"b" %this, %"b"** %this.addr, align 8 %this1 = load %"b", %"b"** %this.addr, align 8 %call = call i1 @​f4(%"b" %this1) ret void }

define internal i1 @​f4(%"b"* %this) align 2 { entry: %this.addr = alloca %"b", align 8 store %"b" %this, %"b"** %this.addr, align 8 %this1 = load %"b", %"b"** %this.addr, align 8 %call = call %"a" @​f5(%"b"* %this1) ret i1 undef }

define internal %"a"* @​f5(%"b"* %this) align 2 { entry: %this.addr = alloca %"b", align 8 store %"b" %this, %"b"** %this.addr, align 8 %this1 = load %"b", %"b"** %this.addr, align 8 %0 = bitcast %"b" %this1 to %"a"* ret %"a"* %0 }

Command: opt -O2 --attributor-enable=cgscc -S reduced.ll

Not sure if it's a CGSCC bug or Attributor bug.

ZequanWu avatar Feb 10 '21 02:02 ZequanWu

I lost track of this. William is going to write the fix, apologies for the wait.

jdoerfert avatar Feb 22 '21 20:02 jdoerfert

Hi Johannes, Is there any progress on this bug?

ZequanWu avatar Feb 22 '21 18:02 ZequanWu

Yeah, I really have to disallow eliminating functions in the SCC pass. The entire infrastructure is brittle and it's not worth it. Try to do that tomorrow.

jdoerfert avatar Feb 10 '21 02:02 jdoerfert

assigned to @wsmoses

ZequanWu avatar Feb 10 '21 02:02 ZequanWu