[BOLT][AArch64] Speed up ICF pass (#172783)
Add hashing support for MCSpecifierExpr, which is frequently used as an operand in AArch64 instructions. Proper hashing reduces collisions when placing functions into buckets, resulting in shorter Identical Code Folding (ICF) pass runtime. In one benchmark, the ICF wall time decreased from 272s to 124s.
This commit is contained in:
parent
188bf2769a
commit
4a8e6a36b6
@ -67,7 +67,11 @@ std::string hashExpr(BinaryContext &BC, const MCExpr &Expr) {
|
||||
.append(hashInteger(BinaryExpr.getOpcode()))
|
||||
.append(hashExpr(BC, *BinaryExpr.getRHS()));
|
||||
}
|
||||
case MCExpr::Specifier:
|
||||
case MCExpr::Specifier: {
|
||||
const auto &SpecExpr = cast<MCSpecifierExpr>(Expr);
|
||||
return hashInteger(SpecExpr.getSpecifier())
|
||||
.append(hashExpr(BC, *SpecExpr.getSubExpr()));
|
||||
}
|
||||
case MCExpr::Target:
|
||||
return std::string();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user