HomePhabricator

[GlobalISel] Avoid making G_PTR_ADD with nullptr

Authored by mbrkusanin on Oct 13 2020, 3:54 AM.

Description

[GlobalISel] Avoid making G_PTR_ADD with nullptr

When the first operand is a null pointer we can avoid making a G_PTR_ADD and
make a G_INTTOPTR with the offset operand.
This helps us avoid making add with 0 later on for targets such as AMDGPU.

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

Details