Merge "Def/Use mask fix for vldm/vstm" into dalvik-dev
diff --git a/src/compiler/codegen/arm/CodegenCommon.cc b/src/compiler/codegen/arm/CodegenCommon.cc
index 208eecf..4b9b592 100644
--- a/src/compiler/codegen/arm/CodegenCommon.cc
+++ b/src/compiler/codegen/arm/CodegenCommon.cc
@@ -165,6 +165,12 @@
         lir->defMask |= ENCODE_REG_FPCS_LIST(lir->operands[0]);
     }
 
+    if (flags & REG_DEF_FPCS_LIST2) {
+        for (int i = 0; i < lir->operands[2]; i++) {
+            setupRegMask(&lir->defMask, lir->operands[1] + i);
+        }
+    }
+
     if (flags & SETS_CCODES) {
         lir->defMask |= ENCODE_CCODE;
     }
@@ -205,7 +211,9 @@
     }
 
     if (flags & REG_USE_FPCS_LIST2) {
-        lir->useMask |= ENCODE_REG_FPCS_LIST(lir->operands[2] >> 16);
+        for (int i = 0; i < lir->operands[2]; i++) {
+            setupRegMask(&lir->useMask, lir->operands[1] + i);
+        }
     }
 
     if (flags & USES_CCODES) {
diff --git a/src/compiler/codegen/arm/LocalOptimizations.cc b/src/compiler/codegen/arm/LocalOptimizations.cc
index 1aaeebf..8d6f3a5 100644
--- a/src/compiler/codegen/arm/LocalOptimizations.cc
+++ b/src/compiler/codegen/arm/LocalOptimizations.cc
@@ -439,12 +439,10 @@
                                         LIR* tailLIR)
 {
     if (!(cUnit->disableOpt & (1 << kLoadStoreElimination))) {
-        LOG(INFO) << "Doing ldstElim, op: 0x" << std::hex << cUnit->disableOpt;
         applyLoadStoreElimination(cUnit, (ArmLIR* ) headLIR,
                                   (ArmLIR* ) tailLIR);
     }
     if (!(cUnit->disableOpt & (1 << kLoadHoisting))) {
-        LOG(INFO) << "Doing hoisting, op: 0x" << std::hex << cUnit->disableOpt;
         applyLoadHoisting(cUnit, (ArmLIR* ) headLIR, (ArmLIR* ) tailLIR);
     }
 }
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index b8045e2..9f89ff9 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -848,11 +848,16 @@
         int regsLeft = std::min(numArgs - 3, 16);
         callState = nextCallInsn(cUnit, mir, dInsn, callState, rollback);
         opRegRegImm(cUnit, kOpAdd, r3, rSP, startOffset);
-        newLIR3(cUnit, kThumb2Vldms, r3, fr0, regsLeft);
+        ArmLIR* ld = newLIR3(cUnit, kThumb2Vldms, r3, fr0, regsLeft);
+        //TUNING: loosen barrier
+        ld->defMask = ENCODE_ALL;
+        setMemRefType(ld, true /* isLoad */, kDalvikReg);
         callState = nextCallInsn(cUnit, mir, dInsn, callState, rollback);
         opRegRegImm(cUnit, kOpAdd, r3, rSP, 4 /* Method* */ + (3 * 4));
         callState = nextCallInsn(cUnit, mir, dInsn, callState, rollback);
-        newLIR3(cUnit, kThumb2Vstms, r3, fr0, regsLeft);
+        ArmLIR* st = newLIR3(cUnit, kThumb2Vstms, r3, fr0, regsLeft);
+        setMemRefType(st, false /* isLoad */, kDalvikReg);
+        st->defMask = ENCODE_ALL;
         callState = nextCallInsn(cUnit, mir, dInsn, callState, rollback);
     }