[all-commits] [llvm/llvm-project] 92fc1e: [HLSL] add loop unroll (#93879)

Farzon Lotfi via All-commits all-commits at lists.llvm.org
Thu Jul 11 14:08:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 92fc1eb0c1ae3813f2ac9208e2c74207aae9d23f
      https://github.com/llvm/llvm-project/commit/92fc1eb0c1ae3813f2ac9208e2c74207aae9d23f
  Author: Farzon Lotfi <1802579+farzonl at users.noreply.github.com>
  Date:   2024-07-11 (Thu, 11 Jul 2024)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/lib/CodeGen/CGLoopInfo.cpp
    M clang/lib/Parse/ParseStmt.cpp
    M clang/lib/Sema/SemaStmtAttr.cpp
    A clang/test/CodeGenHLSL/loops/unroll.hlsl
    A clang/test/SemaHLSL/Loops/unroll.hlsl

  Log Message:
  -----------
  [HLSL] add loop unroll (#93879)

spec: https://github.com/microsoft/hlsl-specs/pull/263

- `Attr.td` - Define the HLSL loop attribute hints (unroll and loop)
- `AttrDocs.td` - Add documentation for unroll and loop
- `CGLoopInfo.cpp` - Add codegen for HLSL unroll that maps to clang
unroll expectations
- `ParseStmt.cpp` - For statements if HLSL define DeclSpecAttrs via
MaybeParseMicrosoftAttributes
- `SemaStmtAttr.cpp` - Add the HLSL loop unroll handeling

resolves #70114

dxc examples: 
- for loop: https://hlsl.godbolt.org/z/8EK6Pa139
- while loop:  https://hlsl.godbolt.org/z/ebr5MvEcK
- do while: https://hlsl.godbolt.org/z/be8cedoTs 

Documentation:

![Screenshot_20240531_143000](https://github.com/llvm/llvm-project/assets/1802579/9da9df9b-68a6-49eb-9d4f-e080aa2eff7f)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list