[all-commits] [llvm/llvm-project] 9cfa6a: [SPIRV] Replace `removeFromParent` with `eraseFrom...

Juan Manuel Martinez Caamaño via All-commits all-commits at lists.llvm.org
Thu Mar 5 07:15:11 PST 2026


  Branch: refs/heads/users/jmmartinez/spirv/erase-from-parent-2
  Home:   https://github.com/llvm/llvm-project
  Commit: 9cfa6ae53dae1ab84dbb4df5d9f3d2aabcc2ee00
      https://github.com/llvm/llvm-project/commit/9cfa6ae53dae1ab84dbb4df5d9f3d2aabcc2ee00
  Author: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

  Log Message:
  -----------
  [SPIRV] Replace `removeFromParent` with `eraseFromParent` and return early in G_SELECT selection

When selecting an ASSIGN_TYPE of a G_SELECT, both instructions were
removed but not erased.

The code followed on a code path where the replaced G_SELECT would be
added to a remove set if it was dead. But the select is not in the
function anymore since it is already removed!

Selecting a `selectSelect` always returns `true`. So the
assertions/prints below would have never been triggered.

This patch simplifies this code path to avoid falling through the
asserts and paths where `selectSelect` could have failed (which
trivially doens't happen).

Guarded `selectSelect` return with an assert in case it changes.



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