diff options
| author | 2012-07-30 16:37:41 -0700 | |
|---|---|---|
| committer | 2012-07-30 16:37:41 -0700 | |
| commit | 573b42936ba7fbf296452875cdcadedc619418ef (patch) | |
| tree | 8d0edb778bd3b5e598fedb1aa9fdc45f9f6ac585 /src/compiler/codegen/LocalOptimizations.cc | |
| parent | bb5f32837926bde201bf5744778dcf2573ea0c68 (diff) | |
Enable load store elimination on x86.
Includes a fix to prevent stores from being sunk between cmp and jcc
ops. Also fixes neg-float/double when the source and destination are the
same register. All optis are enabled by default on x86 now.
Change-Id: Ie6f1a3a5ba94fd1b5298df87779d70d9868e8baa
Diffstat (limited to 'src/compiler/codegen/LocalOptimizations.cc')
| -rw-r--r-- | src/compiler/codegen/LocalOptimizations.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/codegen/LocalOptimizations.cc b/src/compiler/codegen/LocalOptimizations.cc index faab3e0046..2fc7ae0ccd 100644 --- a/src/compiler/codegen/LocalOptimizations.cc +++ b/src/compiler/codegen/LocalOptimizations.cc @@ -226,6 +226,15 @@ void applyLoadStoreElimination(CompilationUnit* cUnit, LIR* headLIR, } if (stopHere == true) { +#if defined(TARGET_X86) + // Prevent stores from being sunk between ops that generate ccodes and + // ops that use them. + int flags = EncodingMap[checkLIR->opcode].flags; + if (sinkDistance > 0 && (flags & IS_BRANCH) && (flags & USES_CCODES)) { + checkLIR = PREV_LIR(checkLIR); + sinkDistance--; + } +#endif DEBUG_OPT(dumpDependentInsnPair(thisLIR, checkLIR, "REG CLOBBERED")); /* Only sink store instructions */ if (sinkDistance && !isThisLIRLoad) { |