[all-commits] [llvm/llvm-project] f011cc: [AMDGPU] Use reverse iteration in CodeGenPrepare

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Wed Jul 16 01:17:43 PDT 2025


  Branch: refs/heads/users/pierre-vh/reverse-iterate-cgp
  Home:   https://github.com/llvm/llvm-project
  Commit: f011ccd1de07fc9534b75ae640c1c43c7175424e
      https://github.com/llvm/llvm-project/commit/f011ccd1de07fc9534b75ae640c1c43c7175424e
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-07-16 (Wed, 16 Jul 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
    M llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-fdiv.ll
    M llvm/test/CodeGen/AMDGPU/fdiv_flags.f32.ll
    M llvm/test/CodeGen/AMDGPU/uniform-select.ll

  Log Message:
  -----------
  [AMDGPU] Use reverse iteration in CodeGenPrepare

In order to make this easier, I also removed all "removeFromParent" calls from the visitors, instead adding instructions
to a set of instructions to delete once the function has been visited.
This avoids crashes due to functions deleting their operands. In theory we could allow functions to delete the
instruction they visited (and only that one) but I think having one idiom for everything is less error-prone.

Fixes #140219


  Commit: b5dded031aa168db5e78c8704429d78245dd1112
      https://github.com/llvm/llvm-project/commit/b5dded031aa168db5e78c8704429d78245dd1112
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-07-16 (Wed, 16 Jul 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp

  Log Message:
  -----------
  Use vector + weakvh


Compare: https://github.com/llvm/llvm-project/compare/748fe569aeb6...b5dded031aa1

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