Dead store elimination là gì?

Noun Programming
Loại bỏ dead store

Hiểu thuật ngữ dead store trước khi xem thuật ngữ này, loại bỏ dead store (dead store elimination) là một tối ưu hóa (optimization) nhằm loại bỏ việc gán (assign) một biến (variable) không được đọc bởi bất kỳ lệnh (instruction) tiếp theo nào.

Ví dụ hãy đoạn code trong C bên dưới:


int square function(x) {
  int number = 10;
  return x * x;
}

Biến number không bao giờ được sử dụng, vì vậy phép gán (assignation) này có thể bị xóa, dẫn đến:


int square function(x) {
  return x * x;
}

Learning English Everyday