[clang] [HLSL] add loop unroll (PR #93879)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 3 17:36:01 PDT 2024
================
@@ -635,6 +635,17 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx,
Option = LoopHintAttr::UnrollCount;
State = LoopHintAttr::Numeric;
}
+ } else if (HLSLLoopHint) {
+ ValueInt = HLSLLoopHint->getDirective();
+ if (HLSLLoopHint->getSemanticSpelling() ==
+ HLSLLoopHintAttr::Spelling::Microsoft_unroll) {
+ if (ValueInt == 0)
+ State = LoopHintAttr::Enable;
+ if (ValueInt > 0) {
+ Option = LoopHintAttr::UnrollCount;
----------------
farzonl wrote:
@dmpots you are correct. It's very likely we will pursue a breaking change based on the feedback I've been gathering throughout the day. Since HLSL202x applies for both clang-dxc and an dxc It may be worth making a similar change in DXC to allow us to measure how much of a breaking change this would be via experiments before we come to a final decision.
https://github.com/llvm/llvm-project/pull/93879
More information about the cfe-commits
mailing list