[llvm] [Scalarizer][DirectX] Teach the Scalarizer to handle integer bitcasts between scalars and vectors. (PR #221033)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 14:48:08 PDT 2026
================
@@ -0,0 +1,32 @@
+; RUN: opt %s -passes='scalarizer,dce' -S --data-layout=e | FileCheck %s --check-prefix=LE
+; RUN: opt %s -passes='scalarizer,dce' -S --data-layout=E | FileCheck %s --check-prefix=BE
+
+declare <2 x i16> @llvm.ctpop.v2i16(<2 x i16>)
+
+define i32 @bitcast_vector_to_scalar(<2 x i16> %x) {
----------------
bjope wrote:
Hi @farzonl ,
I would preferr if these new tests cases were changed into using utils/update_test_checks to get more complete checks (both in this test case and bitcast-scalar-to-vector.ll).
As it is right now, we run tests for both big and little endian. But the checks added here are incomplete and does not show where the ctpop inputs originates for. So to me it looks like the LE and BE checks are "equivalent". There are two ctpop results, both are zext:ed, and then one is shifted left. It is only the order of operations that are different. Nothing proving that transform is correct based on endianess by just looking at the checks.
https://github.com/llvm/llvm-project/pull/221033
More information about the llvm-commits
mailing list