[all-commits] [llvm/llvm-project] 58526b: [GlobalISel] Handle nullptr constants in dbg.value

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Thu Jul 28 14:58:28 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58526b2d2be932e893218857cc47a16fb05cf1c0
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2022-07-28 (Thu, 28 Jul 2022)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll

  Log Message:
  [GlobalISel] Handle nullptr constants in dbg.value

Currently, the LLVM IR -> MIR translator fails to translate dbg.values
whose first argument is a null pointer. However, in other portions of
the code, such pointers are always lowered to the constant zero, for
example see IRTranslator::Translate(Constant, Register).

This patch addresses the limitation by following the same approach of
lowering null pointers to zero.

A prior test was checking that null pointers were always lowered to
$noreg; this test is changed to check for zero, and the previous
behavior is now checked by introducing a dbg.value whose first argument
is the address of a global variable.

Differential Revision: https://reviews.llvm.org/D130721

More information about the All-commits mailing list