diff options
| author | Yong He <yonghe@outlook.com> | 2022-12-07 12:02:30 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 12:02:30 -0800 |
| commit | 3a3a8b5f7701109fc413f42692c4de5769870489 (patch) | |
| tree | 909df4a30e69f33a76e0158d92b1823629dc2184 /source/slang/slang-ir-liveness.cpp | |
| parent | f116f43bd12358e87f351f0d3615628ac4e00921 (diff) | |
Lower-to-ir no longer produce `Construct` inst. (#2553)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-liveness.cpp')
| -rw-r--r-- | source/slang/slang-ir-liveness.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/slang/slang-ir-liveness.cpp b/source/slang/slang-ir-liveness.cpp index b708307c2..4a39dc612 100644 --- a/source/slang/slang-ir-liveness.cpp +++ b/source/slang/slang-ir-liveness.cpp @@ -1023,9 +1023,21 @@ bool LivenessContext::_isAccessTerminator(IRTerminatorInst* terminator) // we have a cast between uint/int (for example) that isn't a problem // Strip construct - if (val->getOp() == kIROp_Construct && val->getOperandCount() == 1) + switch (val->getOp()) { + case kIROp_Construct: + if (val->getOperandCount() == 1) + val = val->getOperand(0); + break; + case kIROp_CastIntToFloat: + case kIROp_CastFloatToInt: + case kIROp_IntCast: + case kIROp_FloatCast: + case kIROp_CastIntToPtr: + case kIROp_CastPtrToInt: + case kIROp_CastPtrToBool: val = val->getOperand(0); + break; } // If it *is* the root it's an access |
