From 0e3d9ba255b86c11521a951183d38bffae008559 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 16 Nov 2017 19:31:57 -0800 Subject: 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`. --- source/slang/ir.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/ir.cpp') 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(clonedValue); + newDecoration->mode = originalDecoration->mode; + } + break; + default: // Don't clone any decorations we don't understand. break; -- cgit v1.2.3