summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-04-01 14:32:30 -0700
committerGitHub <noreply@github.com>2024-04-01 14:32:30 -0700
commit65ac9f3a9ddcb8bcfc099ffb29beaa9a92ba1f53 (patch)
tree58b20c58d71dca4d807db7830d61b0d8c96cf8d7 /source/slang
parent844a8d6274cb5e4927bf3241a94b2a9d9553df90 (diff)
Fix peephole optimization of `TypeEquals`. (#3865)
Closes #3861.
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-ir-peephole.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-ir-peephole.cpp b/source/slang/slang-ir-peephole.cpp
index d4369da7a..88b26fbd3 100644
--- a/source/slang/slang-ir-peephole.cpp
+++ b/source/slang/slang-ir-peephole.cpp
@@ -960,7 +960,8 @@ struct PeepholeContext : InstPassBase
{
auto getTypeFromOperand = [](IRInst* operand) -> IRType*
{
- if (as<IRTypeType>(operand->getFullType()) || !operand->getFullType())
+ if (as<IRTypeType>(operand->getFullType()) || !operand->getFullType() ||
+ as<IRTypeKind>(operand->getFullType()))
return (IRType*)operand;
return operand->getFullType();
};