Lines Matching refs:PV

622     bool matchLeftShift(SelectInst *SelI, Value *CIV, ParsedValues &PV);
623 bool matchRightShift(SelectInst *SelI, ParsedValues &PV);
625 Value *CIV, ParsedValues &PV, bool PreScan);
627 Value *generate(BasicBlock::iterator At, ParsedValues &PV);
684 Value *CIV, ParsedValues &PV) { in matchLeftShift() argument
790 PV.X = X; in matchLeftShift()
791 PV.Q = Q; in matchLeftShift()
792 PV.R = R; in matchLeftShift()
793 PV.Left = true; in matchLeftShift()
798 ParsedValues &PV) { in matchRightShift() argument
860 PV.X = X; in matchRightShift()
861 PV.Q = Q; in matchRightShift()
862 PV.R = R; in matchRightShift()
863 PV.Left = false; in matchRightShift()
868 BasicBlock *LoopB, BasicBlock *PrehB, Value *CIV, ParsedValues &PV, in scanSelect() argument
909 if (matchLeftShift(SelI, CIV, PV)) { in scanSelect()
915 auto *RPhi = dyn_cast<PHINode>(PV.R); in scanSelect()
920 PV.Res = SelI; in scanSelect()
924 if (CurLoop->isLoopInvariant(PV.X)) { in scanSelect()
925 PV.P = PV.X; in scanSelect()
926 PV.Inv = false; in scanSelect()
932 PV.Inv = true; in scanSelect()
933 if (PV.X != PV.R) { in scanSelect()
935 if (!match(PV.X, m_Xor(m_Value(X1), m_Value(X2)))) in scanSelect()
947 if (Var != PV.R) in scanSelect()
949 PV.M = Inv; in scanSelect()
954 PV.P = EntryP; in scanSelect()
960 if (matchRightShift(SelI, PV)) { in scanSelect()
963 if (PV.Inv && !isa<ConstantInt>(PV.Q)) in scanSelect()
1532 ParsedValues &PV) { in generate() argument
1537 Value *P = PV.P, *Q = PV.Q, *P0 = P; in generate()
1538 unsigned IC = PV.IterCount; in generate()
1540 if (PV.M != nullptr) in generate()
1541 P0 = P = B.CreateXor(P, PV.M); in generate()
1546 if (PV.IterCount != 32) in generate()
1549 if (PV.Inv) { in generate()
1550 auto *QI = dyn_cast<ConstantInt>(PV.Q); in generate()
1554 unsigned M = (1 << PV.IterCount) - 1; in generate()
1566 if (PV.M != nullptr) in generate()
1798 ParsedValues PV; in recognize() local
1800 PV.IterCount = IterCount; in recognize()
1830 if (scanSelect(SelI, LoopB, EntryB, CIV, PV, true)) { in recognize()
1846 if (!PV.Left) { in recognize()
1883 FoundScan = scanSelect(SelI, LoopB, EntryB, CIV, PV, false); in recognize()
1890 StringRef PP = (PV.M ? "(P+M)" : "P"); in recognize()
1891 if (!PV.Inv) in recognize()
1896 dbgs() << " Res:" << *PV.Res << "\n P:" << *PV.P << "\n"; in recognize()
1897 if (PV.M) in recognize()
1898 dbgs() << " M:" << *PV.M << "\n"; in recognize()
1899 dbgs() << " Q:" << *PV.Q << "\n"; in recognize()
1900 dbgs() << " Iteration count:" << PV.IterCount << "\n"; in recognize()
1904 Value *PM = generate(At, PV); in recognize()
1908 if (PM->getType() != PV.Res->getType()) in recognize()
1909 PM = IRBuilder<>(&*At).CreateIntCast(PM, PV.Res->getType(), false); in recognize()
1911 PV.Res->replaceAllUsesWith(PM); in recognize()
1912 PV.Res->eraseFromParent(); in recognize()