[all-commits] [llvm/llvm-project] 02a334: [SPIR-V] Fix bad insertion for type/id MIR (#109686)

Nathan Gauër via All-commits all-commits at lists.llvm.org
Tue Sep 24 06:24:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02a334de6690202154ef09456c581618ff290f9a
      https://github.com/llvm/llvm-project/commit/02a334de6690202154ef09456c581618ff290f9a
  Author: Nathan Gauër <brioche at google.com>
  Date:   2024-09-24 (Tue, 24 Sep 2024)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
    M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
    M llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp

  Log Message:
  -----------
  [SPIR-V] Fix bad insertion for type/id MIR (#109686)

Those instructions were inserted either after the instruction using it,
or in the middle of the module.
The first directly causes an issue. The second causes a more subtle
issue: the first type the type is inserted, the emission is fine, but
the second times, the first instruction is reused, without checking its
position in the function. This can lead to the second usage dominating
the definition.

In SPIR-V, types are usually in the header, above all code definition,
but at this stage I don't think we can, so what I do instead is to emit
it in the first basic block.

This commit reduces the failed tests with expensive checks from 107 to
71.

Signed-off-by: Nathan Gauër <brioche at google.com>



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