Lines Matching defs:cUnit
811 int dvmConvertSSARegToDalvik(CompilationUnit *cUnit, int ssaReg)
813 return GET_ELEM_N(cUnit->ssaToDalvikMap, int, ssaReg);
874 char *dvmCompilerGetSSAString(CompilationUnit *cUnit, SSARepresentation *ssaRep)
882 int ssa2DalvikValue = dvmConvertSSARegToDalvik(cUnit, ssaRep->defs[i]);
894 int ssa2DalvikValue = dvmConvertSSARegToDalvik(cUnit, ssaRep->uses[i]);
931 void dvmCompilerFindLiveIn(CompilationUnit *cUnit, BasicBlock *bb)
942 dvmCompilerAllocBitVector(cUnit->method->registersSize, false);
944 dvmCompilerAllocBitVector(cUnit->method->registersSize, false);
946 dvmCompilerAllocBitVector(cUnit->method->registersSize, false);
983 static void handleSSAUse(CompilationUnit *cUnit, int *uses, int dalvikReg,
986 int encodedValue = cUnit->dalvikToSSAMap[dalvikReg];
992 static void handleSSADef(CompilationUnit *cUnit, int *defs, int dalvikReg,
995 int encodedValue = cUnit->dalvikToSSAMap[dalvikReg];
996 int ssaReg = cUnit->numSSARegs++;
1001 cUnit->dalvikToSSAMap[dalvikReg] = newD2SMapping;
1004 dvmInsertGrowableList(cUnit->ssaToDalvikMap, (void *) newS2DMapping);
1010 static void dataFlowSSAFormat35C(CompilationUnit *cUnit, MIR *mir)
1020 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->arg[i], i);
1025 static void dataFlowSSAFormat3RC(CompilationUnit *cUnit, MIR *mir)
1035 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC+i, i);
1040 void dvmCompilerDoSSAConversion(CompilationUnit *cUnit, BasicBlock *bb)
1057 dataFlowSSAFormat35C(cUnit, mir);
1062 dataFlowSSAFormat3RC(cUnit, mir);
1111 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vA, numUses++);
1114 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vA, numUses++);
1116 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vA+1, numUses++);
1120 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vB, numUses++);
1123 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vB, numUses++);
1125 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vB+1, numUses++);
1129 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC, numUses++);
1132 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC, numUses++);
1134 handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC+1, numUses++);
1139 handleSSADef(cUnit, mir->ssaRep->defs, dInsn->vA, 0);
1142 handleSSADef(cUnit, mir->ssaRep->defs, dInsn->vA+1, 1);
1148 dvmCompilerNew(sizeof(int) * cUnit->method->registersSize, false);
1151 memcpy(bb->dataFlowInfo->dalvikToSSAMap, cUnit->dalvikToSSAMap,
1152 sizeof(int) * cUnit->method->registersSize);
1156 static void setConstant(CompilationUnit *cUnit, int ssaReg, int value)
1158 dvmSetBit(cUnit->isConstantV, ssaReg);
1159 cUnit->constantValues[ssaReg] = value;
1162 void dvmCompilerDoConstantPropagation(CompilationUnit *cUnit, BasicBlock *bb)
1165 BitVector *isConstantV = cUnit->isConstantV;
1182 setConstant(cUnit, mir->ssaRep->defs[0], dInsn->vB);
1185 setConstant(cUnit, mir->ssaRep->defs[0],
1195 setConstant(cUnit, mir->ssaRep->defs[0], dInsn->vB);
1196 setConstant(cUnit, mir->ssaRep->defs[1], 0);
1199 setConstant(cUnit, mir->ssaRep->defs[0],
1201 setConstant(cUnit, mir->ssaRep->defs[1],
1205 setConstant(cUnit, mir->ssaRep->defs[0], 0);
1206 setConstant(cUnit, mir->ssaRep->defs[1],
1222 setConstant(cUnit, mir->ssaRep->defs[0],
1223 cUnit->constantValues[mir->ssaRep->uses[0]]);
1225 setConstant(cUnit, mir->ssaRep->defs[1],
1226 cUnit->constantValues[mir->ssaRep->uses[1]]);
1234 void dvmCompilerFindInductionVariables(struct CompilationUnit *cUnit,
1237 BitVector *isIndVarV = cUnit->loopAnalysis->isIndVarV;
1238 BitVector *isConstantV = cUnit->isConstantV;
1239 GrowableList *ivList = cUnit->loopAnalysis->ivList;
1280 cUnit->constantValues[mir->ssaRep->uses[1]];
1288 -cUnit->constantValues[mir->ssaRep->uses[1]];
1311 cUnit->loopAnalysis->numBasicIV++;
1334 int srcDalvikReg = dvmConvertSSARegToDalvik(cUnit,
1336 int dstDalvikReg = dvmConvertSSARegToDalvik(cUnit,
1346 c = cUnit->constantValues[mir->ssaRep->uses[1]];
1353 c = -cUnit->constantValues[mir->ssaRep->uses[1]];
1367 cUnit->loopAnalysis->ssaBIV = mir->ssaRep->defs[0];
1399 void dvmInitializeSSAConversion(CompilationUnit *cUnit)
1402 int numDalvikReg = cUnit->method->registersSize;
1404 cUnit->ssaToDalvikMap = dvmCompilerNew(sizeof(GrowableList), false);
1405 dvmInitGrowableList(cUnit->ssaToDalvikMap, numDalvikReg);
1411 cUnit->numSSARegs = numDalvikReg;
1419 dvmInsertGrowableList(cUnit->ssaToDalvikMap,
1428 cUnit->dalvikToSSAMap = dvmCompilerNew(sizeof(int) * numDalvikReg, false);
1430 cUnit->dalvikToSSAMap[i] = i;
1436 for (i = 0; i < cUnit->numBlocks; i++) {
1437 BasicBlock *bb = cUnit->blockList[i];
1445 void dvmCompilerDataFlowAnalysisDispatcher(CompilationUnit *cUnit,
1449 for (i = 0; i < cUnit->numBlocks; i++) {
1450 BasicBlock *bb = cUnit->blockList[i];
1451 (*func)(cUnit, bb);
1456 void dvmCompilerNonLoopAnalysis(CompilationUnit *cUnit)
1458 dvmCompilerDataFlowAnalysisDispatcher(cUnit, dvmCompilerDoSSAConversion);