[llvm] [llvm][SPIRV] Expose fast `popcnt` support for SPIR-V targets (PR #109845)
Alex Voicu via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 19:10:59 PDT 2024
================
@@ -0,0 +1,114 @@
+; RUN: opt -O3 -mtriple=spirv32-- %s -o - | llc -O3 -mtriple=spirv32-- -o - | FileCheck %s
+; RUN: %if spirv-tools %{ opt -O3 -mtriple=spirv32-- %s -o - | llc -O3 -mtriple=spirv32-- -o - -filetype=obj | spirv-val %}
----------------
AlexVlx wrote:
This is actually a great idea, because it tickles something [that looks like a notable bug](https://github.com/llvm/llvm-project/blob/f7dfaf35065fc858056a206b10c3dfbf8029f801/llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp#L355) - that insertion is incorrect, we should skip over PHIs if the successor is a PHI. However, doing that doesn't quite solve it, as vreg lifetimes get messed up and verification still fails. I'll need to spend a bit more time to understand the transform. This can be verified, independently from, this patch, by using `-verify-machineinstrs` on e.g. `/llvm/test/CodeGen/SPIRV/phi-spvintrinsic-dominate.ll`. So this doesn't make things worse - we could merge it and deal with the issue separately, I reckon.
https://github.com/llvm/llvm-project/pull/109845
More information about the llvm-commits
mailing list