[clang] [HLSL] Use icmp ne instead of trunc on boolean load (PR #221105)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 14 09:54:19 PDT 2026
================
@@ -0,0 +1,3 @@
+// RUN: %clang_dxc -T cs_6_3 -### %s 2>&1 | FileCheck %s
+
+// CHECK: "-load-bool-from-mem=nonzero"
----------------
joaosaffran wrote:
I think we could add a few more tests:
- A `%clang_cc1` invocation test without `-load-bool-from-mem`, checking that scalar and vector boolean loads use nonzero comparisons rather than truncation.
- A test with `-load-bool-from-mem=truncate`, checking that the warning is being emitted and the codegen is still correct.
- The issue being fixed has a godbolt link; it is nice to add that as a regression test
https://github.com/llvm/llvm-project/pull/221105
More information about the cfe-commits
mailing list