Lines Matching refs:R
81 unsigned R = (Index + 1) * 2; in remove_min() local
82 unsigned L = R - 1; in remove_min()
85 if (R >= NewSize) { in remove_min()
97 unsigned IndexToTest = (Precedes(Storage[L], Storage[R]) ? L : R); in remove_min()
156 bool tryUnify(BasicBlock *L, BasicBlock *R) { in tryUnify() argument
160 if (Ref == R) return false; in tryUnify()
164 << L << R << Ref; in tryUnify()
168 Ref = R; in tryUnify()
169 Queue.insert(BlockPair(L, R)); in tryUnify()
175 void unify(Instruction *L, Instruction *R) { in unify() argument
176 DifferenceEngine::Context C(Engine, L, R); in unify()
178 bool Result = diff(L, R, true, true); in unify()
182 Values[L] = R; in unify()
192 void diff(BasicBlock *L, BasicBlock *R) { in diff() argument
193 DifferenceEngine::Context C(Engine, L, R); in diff()
196 BasicBlock::iterator RI = R->begin(); in diff()
199 assert(LI != LE && RI != R->end()); in diff()
206 return runBlockDiff(L->begin(), R->begin()); in diff()
219 for (LI = L->begin(), RI = R->begin(); LI != LE; ++LI, ++RI) in diff()
223 bool matchForBlockDiff(Instruction *L, Instruction *R);
226 bool diffCallSites(CallSite L, CallSite R, bool Complain) { in diffCallSites() argument
228 if (!equivalentAsOperands(L.getCalledValue(), R.getCalledValue())) { in diffCallSites()
232 if (L.arg_size() != R.arg_size()) { in diffCallSites()
237 if (!equivalentAsOperands(L.getArgument(I), R.getArgument(I))) { in diffCallSites()
240 << L.getArgument(I) << R.getArgument(I); in diffCallSites()
246 bool diff(Instruction *L, Instruction *R, bool Complain, bool TryUnify) { in diff() argument
250 if (L->getOpcode() != R->getOpcode()) { in diff()
257 != cast<CmpInst>(R)->getPredicate()) { in diff()
262 return diffCallSites(CallSite(L), CallSite(R), Complain); in diff()
267 if (L->getType() != R->getType()) { in diff()
268 if (!L->getType()->isPointerTy() || !R->getType()->isPointerTy()) { in diff()
278 InvokeInst *RI = cast<InvokeInst>(R); in diff()
290 BranchInst *RI = cast<BranchInst>(R); in diff()
308 SwitchInst *RI = cast<SwitchInst>(R); in diff()
348 if (L->getNumOperands() != R->getNumOperands()) { in diff()
354 Value *LO = L->getOperand(I), *RO = R->getOperand(I); in diff()
364 bool equivalentAsOperands(Constant *L, Constant *R) { in equivalentAsOperands() argument
366 if (L == R) in equivalentAsOperands()
369 if (L->getValueID() != R->getValueID()) in equivalentAsOperands()
375 cast<GlobalValue>(R)); in equivalentAsOperands()
380 cast<ConstantExpr>(R)); in equivalentAsOperands()
391 == cast<BlockAddress>(R)->getBasicBlock(); in equivalentAsOperands()
396 bool equivalentAsOperands(ConstantExpr *L, ConstantExpr *R) { in equivalentAsOperands() argument
397 if (L == R) in equivalentAsOperands()
399 if (L->getOpcode() != R->getOpcode()) in equivalentAsOperands()
405 if (L->getPredicate() != R->getPredicate()) in equivalentAsOperands()
417 if (L->getNumOperands() != R->getNumOperands()) in equivalentAsOperands()
421 if (!equivalentAsOperands(L->getOperand(I), R->getOperand(I))) in equivalentAsOperands()
427 bool equivalentAsOperands(Value *L, Value *R) { in equivalentAsOperands() argument
430 if (L->getValueID() != R->getValueID()) in equivalentAsOperands()
437 return equivalentAsOperands(cast<Constant>(L), cast<Constant>(R)); in equivalentAsOperands()
440 return Values[L] == R || TentativeValues.count(std::make_pair(L, R)); in equivalentAsOperands()
443 return Values[L] == R; in equivalentAsOperands()
446 return Blocks[cast<BasicBlock>(L)] != R; in equivalentAsOperands()
459 void diff(Function *L, Function *R) { in diff() argument
460 if (L->arg_size() != R->arg_size()) in diff()
466 RI = R->arg_begin(), RE = R->arg_end(); in diff()
470 tryUnify(&*L->begin(), &*R->begin()); in diff()
483 Instruction *R) { in matchForBlockDiff() argument
484 return !diff(L, R, false, false); in matchForBlockDiff()
566 Instruction *L = &*LI, *R = &*RI; in runBlockDiff() local
567 unify(L, R); in runBlockDiff()
568 Diff.addMatch(L, R); in runBlockDiff()
633 void DifferenceEngine::diff(Function *L, Function *R) { in diff() argument
634 Context C(*this, L, R); in diff()
641 if (L->empty() && R->empty()) in diff()
645 else if (R->empty()) in diff()
648 FunctionDifferenceEngine(*this).diff(L, R); in diff()
651 void DifferenceEngine::diff(Module *L, Module *R) { in diff() argument
659 if (Function *RFn = R->getFunction(LFn->getName())) in diff()
665 for (Module::iterator I = R->begin(), E = R->end(); I != E; ++I) { in diff()
676 bool DifferenceEngine::equivalentAsOperands(GlobalValue *L, GlobalValue *R) { in equivalentAsOperands() argument
677 if (globalValueOracle) return (*globalValueOracle)(L, R); in equivalentAsOperands()
678 return L->getName() == R->getName(); in equivalentAsOperands()