Skip to content

LateLowerGCFrame infinite loops in presence of @llvm.vector.insert in IR #55844

@Zentrik

Description

@Zentrik

On master this IR hangs in LateLowerGCFrame

; 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-ni:10:11:12:13"
target triple = "x86_64-unknown-linux-gnu"

declare ptr @julia.get_pgcstack()

define swiftcc void @julia_abstract_modifyopNOT._36663(<4 x ptr addrspace(10)> %0, <2 x ptr addrspace(10)> %1) {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %2 = call <4 x ptr addrspace(10)> @llvm.vector.insert.v4p10.v2p10(<4 x ptr addrspace(10)> %0, <2 x ptr addrspace(10)> %1, i64 2)
  ret void
}

The hang is in the FindBaseValue function as this code doesn't seem to handle this intrinsic

else if (auto II = dyn_cast<IntrinsicInst>(CurrentV)) {
// Some intrinsics behave like LoadInst followed by a SelectInst
// This should never happen in a derived addrspace (since those cannot be stored to memory)
// so we don't need to lift these operations, but we do need to check if it's loaded and continue walking the base pointer
if (II->getIntrinsicID() == Intrinsic::masked_load ||
II->getIntrinsicID() == Intrinsic::masked_gather) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions