mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[cse] Add support for struct_element_addr.
With this commit CSE reduces the standard library by ~1911 lines. Swift SVN r10845
This commit is contained in:
@@ -65,6 +65,7 @@ namespace {
|
||||
case ValueKind::StringLiteralInst:
|
||||
case ValueKind::StructInst:
|
||||
case ValueKind::StructExtractInst:
|
||||
case ValueKind::StructElementAddrInst:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -139,6 +140,13 @@ unsigned llvm::DenseMapInfo<SimpleValue>::getHashValue(SimpleValue Val) {
|
||||
X->getField(),
|
||||
X->getOperand());
|
||||
}
|
||||
case ValueKind::StructElementAddrInst: {
|
||||
auto *X = cast<StructElementAddrInst>(Inst);
|
||||
return llvm::hash_combine(unsigned(ValueKind::StructElementAddrInst),
|
||||
X->getStructDecl(),
|
||||
X->getField(),
|
||||
X->getOperand());
|
||||
}
|
||||
default:
|
||||
llvm_unreachable("Unhandled ValueKind.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user