Skip to content

Commit

Permalink
Cover RSP-indexed accesses in frame optimization
Browse files Browse the repository at this point in the history
Summary:
Add a new dataflow analysis to recover the value of RSP at a
given point of the program. This value is expressed as an offset from
the CFA. Use this information to detect redundant load in memory
accesses performed via RSP as well, not only RBP as done previously.
Bail when RSP value (as an offset of the CFA) can't be reliably
determined with a simple dataflow analysis.

(cherry picked from FBD4372261)
  • Loading branch information
rafaelauler authored and maksfb committed Dec 29, 2016
1 parent 503c741 commit 6dfd16c
Show file tree
Hide file tree
Showing 4 changed files with 460 additions and 221 deletions.
1 change: 1 addition & 0 deletions bolt/BinaryBasicBlock.h
Expand Up @@ -543,6 +543,7 @@ class BinaryBasicBlock {
}

/// Erase given (non-pseudo) instruction if found.
/// Warning: this will invalidate succeeding instruction pointers.
bool eraseInstruction(MCInst *Inst) {
return replaceInstruction(Inst, std::vector<MCInst>());
}
Expand Down
2 changes: 1 addition & 1 deletion bolt/BinaryFunction.h
Expand Up @@ -866,7 +866,7 @@ class BinaryFunction : public AddressRangesOwner {

/// Check if (possibly one out of many) function name matches the given
/// string. Use this member function instead of direct name comparison.
bool hasName(std::string &FunctionName) const {
bool hasName(const std::string &FunctionName) const {
for (auto &Name : Names)
if (Name == FunctionName)
return true;
Expand Down

0 comments on commit 6dfd16c

Please sign in to comment.