Skip to content

Commit 1bc00e1

Browse files
committed
Kill unnecessary VLMap updates.
- A branch instruction doesn't define a local variable, so there's no need to update the map. - Similarly only update the VLMap for call instructions if there is a return value. No functional change.
1 parent cc4259a commit 1bc00e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,9 @@ class YkIRWriter {
431431
serialiseOperand(I, VLMap, I->getOperand(OI));
432432
}
433433

434-
VLMap[I] = {BBIdx, InstIdx};
434+
if (!I->getType()->isVoidTy()) {
435+
VLMap[I] = {BBIdx, InstIdx};
436+
}
435437
InstIdx++;
436438
}
437439

@@ -447,8 +449,6 @@ class YkIRWriter {
447449
// num_operands:
448450
// We don't serialise any operands, because traces will guide us.
449451
OutStreamer.emitInt32(0);
450-
451-
VLMap[I] = {BBIdx, InstIdx};
452452
} else {
453453
// type_index:
454454
OutStreamer.emitSizeT(typeIndex(I->getType()));

0 commit comments

Comments
 (0)