diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-09 20:11:09 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-09 20:11:09 -0700 |
| commit | f875d3f5ba9c1ddc6aa9a0960efd5ab27ae4e4c9 (patch) | |
| tree | 42dae9fd6c260dfdafe7ce4a1ffc392e799c855d /source/slang/slang-ir-ssa.cpp | |
| parent | 03a5bb4bc0391e2de3c2dfb9ff3213bc0ccd9664 (diff) | |
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-ssa.cpp')
| -rw-r--r-- | source/slang/slang-ir-ssa.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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<IRLinkageDecoration>()) { cloneDecoration(nullptr, decoration, val, var->getModule()); } |
