From 65ac9f3a9ddcb8bcfc099ffb29beaa9a92ba1f53 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 1 Apr 2024 14:32:30 -0700 Subject: Fix peephole optimization of `TypeEquals`. (#3865) Closes #3861. --- source/slang/slang-ir-peephole.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') 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(operand->getFullType()) || !operand->getFullType()) + if (as(operand->getFullType()) || !operand->getFullType() || + as(operand->getFullType())) return (IRType*)operand; return operand->getFullType(); }; -- cgit v1.2.3