Chromium Code Reviews| Index: src/IceTargetLoweringX8632.cpp |
| diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
| index 464a2e88a91260686a086eb91a6016eb1cf92dcc..ad687c82533940d68bb5ec946ed66c4e201548f9 100644 |
| --- a/src/IceTargetLoweringX8632.cpp |
| +++ b/src/IceTargetLoweringX8632.cpp |
| @@ -399,6 +399,12 @@ void TargetX8632::translateO2() { |
| if (shouldDoNopInsertion()) { |
| Func->doNopInsertion(); |
| } |
| + |
| + // Branch optimization. This needs to be done just before code |
|
jvoung (off chromium)
2014/09/18 03:56:02
Should this be before nop insertion? I don't think
Jim Stichnoth
2014/09/18 11:45:51
Good point, done.
|
| + // emission. In particular, no transformations that insert or |
| + // reorder CfgNodes should be done after branch optimization. |
| + Func->doBranchOpt(); |
| + Func->dump("After branch optimization"); |
| } |
| void TargetX8632::translateOm1() { |
| @@ -444,6 +450,12 @@ void TargetX8632::translateOm1() { |
| } |
| } |
| +void TargetX8632::doBranchOpt(Inst *I, const CfgNode *NextNode) { |
| + if (InstX8632Br *Br = llvm::dyn_cast<InstX8632Br>(I)) { |
| + Br->optimizeBranch(NextNode); |
| + } |
| +} |
| + |
| IceString TargetX8632::RegNames[] = { |
| #define X(val, init, name, name16, name8, scratch, preserved, stackptr, \ |
| frameptr, isI8, isInt, isFP) \ |