Skip to content

[VectorCombine] scalarizeLoadExtract - infinite loop if we scalarize a dead extract waiting to be erased #129373

@RKSimon

Description

@RKSimon

Reduced test case:

define void @infinite_loop(ptr %p0) {
  %load = load <4 x float>, ptr %p0, align 8
  %shuffle0 = shufflevector <4 x float> zeroinitializer, <4 x float> %load, <4 x i32> <i32 0, i32 4, i32 1, i32 5>
  %shuffle1 = shufflevector <4 x float> %shuffle0, <4 x float> zeroinitializer, <4 x i32> <i32 0, i32 4, i32 poison, i32 poison>
  %extract = extractelement <4 x float> %load, i64 1
  ret void
}

scalarizeLoadExtract iterates across all users of a load, and doesn't account for possible orders in the worklist that prevent unused instructions that use the load from being erased afterward.

Fix incoming

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions