Lines Matching full:assume
30 "assume-preserve-all", cl::init(false), cl::Hidden,
40 #define DEBUG_TYPE "assume-builder"
42 STATISTIC(NumAssumeBuilt, "Number of assume built by the assume builder");
43 STATISTIC(NumBundlesInAssumes, "Total number of Bundles in the assume built");
45 "Number of assume merged by the assume simplify pass");
47 "Number of assume removed by the assume simplify pass");
49 DEBUG_COUNTER(BuildAssumeCounter, "assume-builder-counter",
102 /// llvm.assume and the function to manipulate it.
123 [&](RetainedKnowledge RKOther, Instruction *Assume,
125 if (!isValidAssumeForContext(Assume, InstBeingModified, DT))
130 } else if (isValidAssumeForContext(InstBeingModified, Assume, DT)) {
132 IntrinsicInst *Intr = cast<IntrinsicInst>(Assume);
228 Function *FnAssume = Intrinsic::getDeclaration(M, Intrinsic::assume);
278 // TODO: Maybe we should look around and merge with other llvm.assume.
318 RetainedKnowledge llvm::simplifyRetainedKnowledge(AssumeInst *Assume,
322 AssumeBuilderState Builder(Assume->getModule(), Assume, AC, DT);
323 RK = canonicalizedKnowledge(RK, Assume->getDataLayout());
355 IntrinsicInst *Assume = cast<IntrinsicInst>(V);
357 auto *Arg = dyn_cast<ConstantInt>(Assume->getOperand(0));
361 BBToAssume[Assume->getParent()].push_back(Assume);
373 /// ForceCleanup is set or the assume doesn't hold valuable knowledge.
375 for (IntrinsicInst *Assume : CleanupToDo) {
376 auto *Arg = dyn_cast<ConstantInt>(Assume->getOperand(0));
379 !isAssumeWithEmptyBundle(cast<AssumeInst>(*Assume))))
386 Assume->eraseFromParent();
391 /// Remove knowledge stored in assume when it is already know by an attribute
392 /// or an other assume. This can when valid update an existing knowledge in an
393 /// attribute or an other assume.
396 IntrinsicInst *Assume;
408 IntrinsicInst *Assume = cast<IntrinsicInst>(V);
409 for (CallInst::BundleOpInfo &BOI : Assume->bundle_op_infos()) {
411 CleanupToDo.insert(Assume);
413 Use *U = &Assume->op_begin()[BOI.Begin + ABA_WasOn];
419 CleanupToDo.insert(Assume);
423 getKnowledgeFromBundle(cast<AssumeInst>(*Assume), BOI);
434 Assume, &*F.getEntryBlock().getFirstInsertionPt()) ||
435 Assume == &*F.getEntryBlock().getFirstInsertionPt()) {
446 if (!isValidAssumeForContext(Elem.Assume, Assume, DT))
451 } else if (isValidAssumeForContext(Assume, Elem.Assume, DT)) {
452 Elem.Assume->op_begin()[Elem.BOI->Begin + ABA_Argument].set(
459 Lookup.push_back({Assume, RK.ArgValue, &BOI});
466 /// Merge all Assumes from Begin to End in and insert the resulting assume as
495 /// guarantees we can place the resulting assume between Begin and End.
511 /// Merge assume when they are in the same BasicBlock and for all instruction
547 /// Remove knowledge that is already known by a dominating other assume or an
551 /// Remove assume that are empty.
554 /// Merge assume in the same basicblock when possible.
557 /// Remove assume that were merged.