[all-commits] [llvm/llvm-project] 394837: prevent undefined behaviour of SPIR-V Backend non-...

Vyacheslav Levytskyy via All-commits all-commits at lists.llvm.org
Tue Jan 30 09:11:09 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 39483797b8981528eafaf6dad557ccfb2312e1ef
      https://github.com/llvm/llvm-project/commit/39483797b8981528eafaf6dad557ccfb2312e1ef
  Author: Vyacheslav Levytskyy <89994100+VyacheslavLevytskyy at users.noreply.github.com>
  Date:   2024-01-30 (Tue, 30 Jan 2024)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
    A llvm/test/CodeGen/SPIRV/token/token-type-preallocated-setup-arg.ll
    A llvm/test/CodeGen/SPIRV/token/token-type-requires-extension.ll

  Log Message:
  -----------
  prevent undefined behaviour of SPIR-V Backend non-asserts builds when dealing with token type (#78437)

The goal of this PR is to fix the issue when use of token type in LLVM
intrinsic causes undefined behavior of SPIR-V Backend code generator
when assertions are disabled:
https://github.com/llvm/llvm-project/issues/78434

Among possible fix options, discussed in the
https://github.com/llvm/llvm-project/issues/78434 issue description, the
option to generate a meaningful error before execution arrives at the
`llvm_unreachable` call looks like a better solution for now, because
SPIR-V doesn't support token type anyway without additional extensions.

The PR is to generate a user-friendly error message and exit without
generating a stack dump when such a usage of token type was detected
that would lead to undefined behavior of SPIR-V Backend code generator.




More information about the All-commits mailing list