From f875d3f5ba9c1ddc6aa9a0960efd5ab27ae4e4c9 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 9 Aug 2023 20:11:09 -0700 Subject: Support implciit casted swizzled lvalue. (#3077) * Support implciit casted swizzled lvalue. * Fix warnings. * Fix. * fix comment. * Prefer mangled linkage name for global params. * Update tests. --------- Co-authored-by: Yong He --- source/slang/slang-ir-ssa.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ir-ssa.cpp') diff --git a/source/slang/slang-ir-ssa.cpp b/source/slang/slang-ir-ssa.cpp index 48cf2976f..18eba677e 100644 --- a/source/slang/slang-ir-ssa.cpp +++ b/source/slang/slang-ir-ssa.cpp @@ -379,11 +379,18 @@ static void cloneRelevantDecorations( break; case kIROp_PreciseDecoration: - case kIROp_NameHintDecoration: // Copy these decorations if the target doesn't already have them, // but don't make duplicate decorations on the target. // - if( !val->findDecorationImpl(decoration->getOp()) ) + if (!val->findDecorationImpl(decoration->getOp())) + { + cloneDecoration(nullptr, decoration, val, var->getModule()); + } + break; + case kIROp_NameHintDecoration: + // If the target already contains a linkage decoration, don't add + // a name decoration to avoid issues with emit logic. + if (!val->findDecorationImpl(decoration->getOp()) && !val->findDecoration()) { cloneDecoration(nullptr, decoration, val, var->getModule()); } -- cgit v1.2.3