diff options
| author | Yong He <yonghe@outlook.com> | 2020-07-23 13:47:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-23 13:47:12 -0700 |
| commit | fed4292a581364b611a82a0f6c1c1c95f82dfeb2 (patch) | |
| tree | f4e50a0d448f2710313a05b5def07a1c0a3b67b3 /source/slang/slang-ir-lower-generic-var.cpp | |
| parent | e93d3a443934b50fb983f77306a72e9c695bd5b9 (diff) | |
Run SSA pass to clean up temporary variables during generics lowering. (#1447)
* Run SSA pass to clean up generic temporary variables during lowering.
* Fix `undefined` emitting logic.
* revert dumpir control flag
* Defer fold decision of `undefined` values after special case logic for GLSL and HLSL.
* Update expected test result.
* Manually update raygen.slang.glsl to minimize change.
* fix formatting
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-ir-lower-generic-var.cpp')
| -rw-r--r-- | source/slang/slang-ir-lower-generic-var.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/slang/slang-ir-lower-generic-var.cpp b/source/slang/slang-ir-lower-generic-var.cpp index 8799dea6b..936ed017f 100644 --- a/source/slang/slang-ir-lower-generic-var.cpp +++ b/source/slang/slang-ir-lower-generic-var.cpp @@ -79,6 +79,12 @@ namespace Slang // have already been replaced with the pointer to that variable by now. // So we don't need to do anything here. } + else if (valPtr->op == kIROp_undefined) + { + // We don't need to store an undef value. + storeInst->removeAndDeallocate(); + return; + } else { // If value does not come from another generic variable, then it must be @@ -138,7 +144,7 @@ namespace Slang void processInst(IRInst* inst) { - if (inst->op == kIROp_Var || inst->op == kIROp_undefined) + if (inst->op == kIROp_Var) { processVarInst(inst); } |
