summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-11-16 19:31:57 -0800
committerGitHub <noreply@github.com>2017-11-16 19:31:57 -0800
commit0e3d9ba255b86c11521a951183d38bffae008559 (patch)
tree3be0a0da5a8f6bfddaae761dff7a4872f355787d /source
parent871fbeec58caaa02ec990a676f10fa7014391a58 (diff)
IR: pass through `[unroll]` attribute (#284)
The initial lowering was adding an `IRLoopControlDecoration` to the instruction at the head of a loop, but this was getting dropped when the IR gets cloned for a particular entry point. The fix was simply to add a case for loop-control decorations to `cloneDecoration`.
Diffstat (limited to 'source')
-rw-r--r--source/slang/ir.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/ir.cpp b/source/slang/ir.cpp
index 9ecafbc7d..9068e717b 100644
--- a/source/slang/ir.cpp
+++ b/source/slang/ir.cpp
@@ -3063,6 +3063,14 @@ namespace Slang
}
break;
+ case kIRDecorationOp_LoopControl:
+ {
+ auto originalDecoration = (IRLoopControlDecoration*)dd;
+ auto newDecoration = context->builder->addDecoration<IRLoopControlDecoration>(clonedValue);
+ newDecoration->mode = originalDecoration->mode;
+ }
+ break;
+
default:
// Don't clone any decorations we don't understand.
break;