Skip to content

Commit

Permalink
Check if operands are immediates before trying shortening.
Browse files Browse the repository at this point in the history
Summary:
Operands in the initial instruction stream should all have immediate operands
for instructions that can be shortened.  But if a BOLT optimization pass adds
one of these instructions with a symbolic operand, the shortening operation
will assert.  This diff adds checks to make sure that the operands are
immediate.

I've also disabled shortening pass by default since it won't really be needed
until ICP is submitted.  It will still run at CFG creation time.

(cherry picked from FBD3610646)
  • Loading branch information
Bill Nell authored and maksfb committed Jul 23, 2016
1 parent 406aa62 commit c1d1c2e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion bolt/BinaryPassManager.cpp
Expand Up @@ -39,7 +39,6 @@ SimplifyConditionalTailCalls("simplify-conditional-tail-calls",
static llvm::cl::opt<bool>
Peepholes("peepholes",
llvm::cl::desc("run peephole optimizations"),
llvm::cl::init(true),
llvm::cl::Optional);

static llvm::cl::opt<bool>
Expand Down
2 changes: 1 addition & 1 deletion bolt/RewriteInstance.cpp
Expand Up @@ -252,7 +252,7 @@ bool shouldProcess(const BinaryFunction &Function) {
} // namespace opts

constexpr const char *RewriteInstance::DebugSectionsToOverwrite[];

static void report_error(StringRef Message, std::error_code EC) {
assert(EC);
errs() << "BOLT-ERROR: '" << Message << "': " << EC.message() << ".\n";
Expand Down

0 comments on commit c1d1c2e

Please sign in to comment.