summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-clone.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-clone.cpp')
-rw-r--r--source/slang/slang-ir-clone.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/slang/slang-ir-clone.cpp b/source/slang/slang-ir-clone.cpp
index 1a020ec26..74a972c1d 100644
--- a/source/slang/slang-ir-clone.cpp
+++ b/source/slang/slang-ir-clone.cpp
@@ -79,6 +79,12 @@ IRInst* cloneInstAndOperands(IRCloneEnv* env, IRBuilder* builder, IRInst* oldIns
//
SLANG_ASSERT(!as<IRConstant>(oldInst));
+ const auto canBeSpecConst = canOperationBeSpecConst(
+ oldInst->getOp(),
+ oldInst->getDataType(),
+ nullptr,
+ oldInst->getOperands());
+
// Next we will iterate over the operands of `oldInst`
// to find their replacements and install them as
// the operands of `newInst`.
@@ -94,7 +100,7 @@ IRInst* cloneInstAndOperands(IRCloneEnv* env, IRBuilder* builder, IRInst* oldIns
newOperands[ii] = newOperand;
- if (isArithmeticInst(oldInst))
+ if (canBeSpecConst)
newType = maybeAddRateType(builder, newOperand->getFullType(), newType);
}