[SelectionDAG] Handle IntToPtr constants in dbg.value
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>
Wed, 3 Aug 2022 18:09:04 +0000 (14:09 -0400)
committerFelipe de Azevedo Piovezan <fpiovezan@apple.com>
Wed, 3 Aug 2022 18:10:05 +0000 (14:10 -0400)
commita5a8a05c78c0d1298c4128aaafd0275354198afb
tree7b2154e5eb40f300e6e71472d70a34e7b57145f1
parentc9edf843fcf954132271214445857498fb47bb72
[SelectionDAG] Handle IntToPtr constants in dbg.value

The function `handleDebugValue` has custom logic to handle certain kinds
constants, namely integers, floats and null pointers. However, it does
not handle constant pointers created from IntToPtr ConstantExpressions.
This patch addresses the issue by replacing the Constant with its
integer operand.

A similar bug was addressed for GlobalISel in D130642.

Reviewed By: aprantl, #debug-info

Differential Revision: https://reviews.llvm.org/D130908
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/AArch64/inttoptr_debug_value.ll [new file with mode: 0644]