[all-commits] [llvm/llvm-project] 21560f: GlobalISel: Fix defined register of invariant.star...

Robert Imschweiler via All-commits all-commits at lists.llvm.org
Tue Feb 4 08:59:25 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 21560fe6b9c73133fd86723071877c55106df010
      https://github.com/llvm/llvm-project/commit/21560fe6b9c73133fd86723071877c55106df010
  Author: Robert Imschweiler <50044286+ro-i at users.noreply.github.com>
  Date:   2025-02-04 (Tue, 04 Feb 2025)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
    A llvm/test/CodeGen/AMDGPU/GlobalISel/promote-dependency-on-invariant-result.ll

  Log Message:
  -----------
  GlobalISel: Fix defined register of invariant.start (#125664)

In contrast to SelectionDAG, GlobalISel created a new virtual register
for the return value of invariant.start, leaving subsequent users of the
invariant.start value with an undefined reference.
A minimal example:
```
  %tmp = alloca i32, align 4, addrspace(5)
  %tmpI = call ptr @llvm.invariant.start.p5(i64 4, ptr addrspace(5) %tmp) #3
  call void @llvm.invariant.end.p5(ptr %tmpI, i64 4, ptr addrspace(5) %tmp) #3
  store i32 %i, ptr %tmpI, align 4
```
Although the return value of invariant.start might not be intended for
any use beyond invariant.end (the fuzzer might not have created a
sensible situation here), an implicit definition of the corresponding
virtual register avoids a segfault in the target instruction selector
later.

This LLVM defect was identified via the AMD Fuzzing project.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list