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
791 PV.X = X; in matchLeftShift()
792 PV.Q = Q; in matchLeftShift()
793 PV.R = R; in matchLeftShift()
794 PV.Left = true; in matchLeftShift()
799 ParsedValues &PV) { in matchRightShift() argument
866 PV.X = X; in matchRightShift()
867 PV.Q = Q; in matchRightShift()
868 PV.R = R; in matchRightShift()
869 PV.Left = false; in matchRightShift()
874 BasicBlock *LoopB, BasicBlock *PrehB, Value *CIV, ParsedValues &PV, in scanSelect() argument
915 if (matchLeftShift(SelI, CIV, PV)) { in scanSelect()
921 auto *RPhi = dyn_cast<PHINode>(PV.R); in scanSelect()
926 PV.Res = SelI; in scanSelect()
930 if (CurLoop->isLoopInvariant(PV.X)) { in scanSelect()
931 PV.P = PV.X; in scanSelect()
932 PV.Inv = false; in scanSelect()
938 PV.Inv = true; in scanSelect()
939 if (PV.X != PV.R) { in scanSelect()
941 if (!match(PV.X, m_Xor(m_Value(X1), m_Value(X2)))) in scanSelect()
953 if (Var != PV.R) in scanSelect()
955 PV.M = Inv; in scanSelect()
960 PV.P = EntryP; in scanSelect()
966 if (matchRightShift(SelI, PV)) { in scanSelect()
969 if (PV.Inv && !isa<ConstantInt>(PV.Q)) in scanSelect()
1538 ParsedValues &PV) { in generate() argument
1543 Value *P = PV.P, *Q = PV.Q, *P0 = P; in generate()
1544 unsigned IC = PV.IterCount; in generate()
1546 if (PV.M != nullptr) in generate()
1547 P0 = P = B.CreateXor(P, PV.M); in generate()
1552 if (PV.IterCount != 32) in generate()
1555 if (PV.Inv) { in generate()
1556 auto *QI = dyn_cast<ConstantInt>(PV.Q); in generate()
1560 unsigned M = (1 << PV.IterCount) - 1; in generate()
1572 if (PV.M != nullptr) in generate()
1804 ParsedValues PV; in recognize() local
1806 PV.IterCount = IterCount; in recognize()
1836 if (scanSelect(SelI, LoopB, EntryB, CIV, PV, true)) { in recognize()
1852 if (!PV.Left) { in recognize()
1889 FoundScan = scanSelect(SelI, LoopB, EntryB, CIV, PV, false); in recognize()
1896 StringRef PP = (PV.M ? "(P+M)" : "P"); in recognize()
1897 if (!PV.Inv) in recognize()
1902 dbgs() << " Res:" << *PV.Res << "\n P:" << *PV.P << "\n"; in recognize()
1903 if (PV.M) in recognize()
1904 dbgs() << " M:" << *PV.M << "\n"; in recognize()
1905 dbgs() << " Q:" << *PV.Q << "\n"; in recognize()
1906 dbgs() << " Iteration count:" << PV.IterCount << "\n"; in recognize()
1910 Value *PM = generate(At, PV); in recognize()
1914 if (PM->getType() != PV.Res->getType()) in recognize()
1915 PM = IRBuilder<>(&*At).CreateIntCast(PM, PV.Res->getType(), false); in recognize()
1917 PV.Res->replaceAllUsesWith(PM); in recognize()
1918 PV.Res->eraseFromParent(); in recognize()