summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index 8371d6ef5..061edd966 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -3384,13 +3384,18 @@ IRInst* IRBuilder::emitGetValueFromBoundInterface(IRType* type, IRInst* boundInt
return inst;
}
-
-IRUndefined* IRBuilder::emitUndefined(IRType* type)
+IRLoadFromUninitializedMemory* IRBuilder::emitLoadFromUninitializedMemory(IRType* type)
{
- auto inst = createInst<IRUndefined>(this, kIROp_Undefined, type);
-
+ auto inst =
+ createInst<IRLoadFromUninitializedMemory>(this, kIROp_LoadFromUninitializedMemory, type);
addInst(inst);
+ return inst;
+}
+IRPoison* IRBuilder::emitPoison(IRType* type)
+{
+ auto inst = createInst<IRPoison>(this, kIROp_Poison, type);
+ addInst(inst);
return inst;
}
@@ -8681,8 +8686,11 @@ bool IRInst::mightHaveSideEffects(SideEffectAnalysisOptions options)
case kIROp_LiveRangeStart:
case kIROp_LiveRangeEnd:
+ // Undefined values are treated as having no side effects.
+ case kIROp_LoadFromUninitializedMemory:
+ case kIROp_Poison:
+
case kIROp_Nop:
- case kIROp_Undefined:
case kIROp_DefaultConstruct:
case kIROp_Specialize:
case kIROp_LookupWitnessMethod: