[all-commits] [llvm/llvm-project] 04831c: [SDAG] Introduce inbounds flag for pointer arithmetic

Fabian Ritter via All-commits all-commits at lists.llvm.org
Wed Apr 23 03:41:07 PDT 2025


  Branch: refs/heads/users/ritter-x2a/03-17-_sdag_introduce_inbounds_flag_for_pointer_arithmetic
  Home:   https://github.com/llvm/llvm-project
  Commit: 04831c178dfa8afe8f214ee08c7bd56eaa9edbf7
      https://github.com/llvm/llvm-project/commit/04831c178dfa8afe8f214ee08c7bd56eaa9edbf7
  Author: Fabian Ritter <fabian.ritter at amd.com>
  Date:   2025-04-23 (Wed, 23 Apr 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAGNodes.h
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
    M llvm/test/CodeGen/X86/merge-store-partially-alias-loads.ll

  Log Message:
  -----------
  [SDAG] Introduce inbounds flag for pointer arithmetic

This patch introduces an inbounds SDNodeFlag, to show that a pointer
addition SDNode implements an inbounds getelementptr operation (i.e.,
the pointer operand is in bounds wrt. the allocated object it is based
on, and the arithmetic does not change that). The flag is set in the DAG
construction when lowering inbounds GEPs.

Inbounds information is useful in the ISel when selecting memory
instructions that perform address computations whose intermediate steps
must be in the same memory region as the final result. A follow-up patch
will start using it for AMDGPU's flat memory instructions, where the
immediate offset must not affect the memory aperture of the address.

A similar patch for gMIR and GlobalISel will follow.

For SWDEV-516125.



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