[clang] [HLSL] add loop unroll (PR #93879)

David Peixotto via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 3 12:10:35 PDT 2024


================
@@ -0,0 +1,99 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -o - | FileCheck %s
+
+/*** for ***/
+void for_count()
+{
+// CHECK-LABEL: for_count
----------------
dmpots wrote:

We are not actually checking that these loops get unrolled. I think that is mostly ok, but I'm wondering if there are other mismatches between the expected hlsl behavior and the llvm loop unroller.

Are we guaranteed that the loop will be unrolled if we have the loop count metadata added? Will llvm raise an error if the loop cannot be unrolled when it has the unroll directive?

https://github.com/llvm/llvm-project/pull/93879


More information about the cfe-commits mailing list