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

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Tue Jun 24 02:39:18 PDT 2025


  Branch: refs/heads/users/pierre-vh/reverse-iterate-cgp
  Home:   https://github.com/llvm/llvm-project
  Commit: b031681978e2b356c2ae8e65d6e08515c0044ac1
      https://github.com/llvm/llvm-project/commit/b031681978e2b356c2ae8e65d6e08515c0044ac1
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-06-24 (Tue, 24 Jun 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



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