Skip to content

Commit ef15dff

Browse files
committed
Add comments
1 parent 50c254c commit ef15dff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,6 +1958,7 @@ void SPIRVEmitIntrinsics::insertAssignTypeIntrs(Instruction *I,
19581958
} else {
19591959
Value *OpTyVal = Op;
19601960
if (OpTy->isTargetExtTy()) {
1961+
// We need to do this in order to be consistent with how target ext types are handled in `processInstrAfterVisit`
19611962
OpTyVal = getNormalizedPoisonValue(OpTy);
19621963
}
19631964
CallInst *AssignCI =
@@ -2077,6 +2078,7 @@ void SPIRVEmitIntrinsics::processInstrAfterVisit(Instruction *I,
20772078
Type *OpElemTy = GR->findDeducedElementType(Op);
20782079
Value *NewOp = Op;
20792080
if (OpTy->isTargetExtTy()) {
2081+
// Since this value is replaced by poison, we need to do the same in `insertAssignTypeIntrs`.
20802082
Value *OpTyVal = getNormalizedPoisonValue(OpTy);
20812083
NewOp = buildIntrWithMD(Intrinsic::spv_track_constant,
20822084
{OpTy, OpTyVal->getType()}, Op, OpTyVal, {}, B);

0 commit comments

Comments
 (0)