llvm-project
246528cb - [clang][bytecode] Unify elementwise integer builtins using callback pattern (#169957)

Commit
157 days ago
[clang][bytecode] Unify elementwise integer builtins using callback pattern (#169957) This patch refactors the handling of elementwise integer unary operations to use a unified callback-based approach, eliminating code duplication. Changes: - Extended interp__builtin_elementwise_int_unaryop to handle vector types - Replaced BI__builtin_elementwise_popcount with callback invocation - Replaced BI__builtin_elementwise_bitreverse with callback invocation - Removed interp__builtin_elementwise_popcount function The new approach uses a lambda function to specify the operation (popcount or reverseBits), which is applied uniformly to both scalar and vector operands. This reduces code duplication and makes it easier to add similar builtins in the future. Fixes #169657
Author
Parents
Loading