diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-06-02 10:27:13 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-01 19:27:13 -0700 |
| commit | 0bc89bc13251fedc9ed90cf473d2e6eb7fda3abf (patch) | |
| tree | 564e5160660c8b65e9f7b9b15c1e7d3c0d863f11 /source/slang/slang-ir-redundancy-removal.cpp | |
| parent | c5a453e56985022deb820cbbb2ff5cd6a8347e34 (diff) | |
Prevent hoisting of non-hoistable instructions in non-function values with code (#4250)
Diffstat (limited to 'source/slang/slang-ir-redundancy-removal.cpp')
| -rw-r--r-- | source/slang/slang-ir-redundancy-removal.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-ir-redundancy-removal.cpp b/source/slang/slang-ir-redundancy-removal.cpp index c7986cfbc..b679d8438 100644 --- a/source/slang/slang-ir-redundancy-removal.cpp +++ b/source/slang/slang-ir-redundancy-removal.cpp @@ -25,9 +25,9 @@ struct RedundancyRemovalContext for (UInt i = 0; i < inst->getOperandCount(); i++) { auto operand = inst->getOperand(i); - if (getParentFunc(operand) != func) + if (!hasDescendent(func, operand)) { - // Global value won't prevent hoisting. + // Only prevent hoisting from operands local to this function continue; } auto operandParent = as<IRBlock>(operand->getParent()); |
