Lines Matching defs:cst
2062 RegAlloc::InsertConstraintsPass::detectConflict(Instruction *cst, int s)
2064 Value *v = cst->getSrc(s);
2069 if (cst != (*it)->getInsn())
2074 for (int c = s + 1; cst->srcExists(c); ++c)
2075 if (v == cst->getSrc(c))
2086 Instruction *cst;
2093 cst = (*it);
2094 if (!i->bb->dominatedBy(cst->bb))
2097 if (cst->getSrc(d) != i->getSrc(d + s))
2101 i->setSrc(s, cst->getDef(d));
2105 cst = new_Instruction(func, OP_CONSTRAINT, i->dType);
2108 cst->setDef(d, new_LValue(func, FILE_GPR));
2109 cst->setSrc(d, i->getSrc(s));
2110 i->setSrc(s, cst->getDef(d));
2112 i->bb->insertBefore(i, cst);
2114 constrList.push_back(cst);
2611 RegAlloc::InsertConstraintsPass::insertConstraintMove(Instruction *cst, int s)
2613 const uint8_t size = cst->src(s).getSize();
2615 assert(cst->getSrc(s)->defs.size() == 1); // still SSA
2617 Instruction *defi = cst->getSrc(s)->defs.front()->getInsn();
2625 if (cst->getSrc(s)->refCount() == 1 && !defi->constrainedDefs()
2628 // Move the defi right before the cst. No point in expanding
2631 cst->bb->insertBefore(cst, defi);
2636 LValue *lval = new_LValue(func, cst->src(s).getFile());
2641 mov->setSrc(0, cst->getSrc(s));
2653 cst->setSrc(s, mov->getDef(0));
2654 cst->bb->insertBefore(cst, mov);
2656 cst->getDef(0)->asLValue()->noSpill = 1; // doesn't help
2667 Instruction *cst = *it;
2670 if (cst->op == OP_SPLIT && false) {
2672 for (int d = 0; cst->defExists(d); ++d) {
2673 if (!cst->getDef(d)->refCount())
2675 LValue *lval = new_LValue(func, cst->def(d).getFile());
2676 const uint8_t size = cst->def(d).getSize();
2681 mov->setDef(0, cst->getDef(d));
2682 cst->setDef(d, mov->getSrc(0));
2683 cst->bb->insertAfter(cst, mov);
2685 cst->getSrc(0)->asLValue()->noSpill = 1;
2689 if (cst->op == OP_MERGE || cst->op == OP_UNION) {
2690 for (int s = 0; cst->srcExists(s); ++s) {
2691 const uint8_t size = cst->src(s).getSize();
2693 if (!cst->getSrc(s)->defs.size()) {
2695 mov->setDef(0, cst->getSrc(s));
2696 cst->bb->insertBefore(cst, mov);
2700 insertConstraintMove(cst, s);