llvm/llvm-project

[AMDGPU][GlobalIsel] ICE: cannot select G_PHI

Open

Aperta il 1 giu 2026

Vedi su GitHub
 (11 commenti) (0 reazioni) (1 assegnatario)C++ (26.378 star) (10.782 fork)batch import
backend:AMDGPUconfirmedcrash-on-validgood first issuellvm:globalisel

Descrizione

The following bitcode module triggers an internal compiler error for -global-isel -O0 in f68ef5b4303de763ecf37fd57cbefc3891ee48c0:

define i32 @__ockl_get_num_groups() {
  %1 = load i16, ptr addrspace(4) null, align 2
  %2 = icmp ne i16 %1, 0
  br label %3

3:                                                ; preds = %0
  %4 = phi i1 [ %2, %0 ]
  %5 = zext i1 %4 to i32
  ret i32 %5
}

Reproducer: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -O0 -global-isel module.ll

Failure: LLVM ERROR: cannot select: %12:sreg_64_xexec(s1) = G_PHI %11:vcc(s1), %bb.1 (in function: __ockl_get_num_groups

Bug found by @ElliotBLabs.

Guida contributor