Lines Matching refs:Usr
1245 // Return true if Usr has Op as an operand, otherwise false.
1246 static bool usesOperand(User *Usr, Value *Op) {
1247 return find(Usr->operands(), Op) != Usr->op_end();
1254 static bool isOperationFoldable(User *Usr) {
1255 return isa<CastInst>(Usr) || isa<BinaryOperator>(Usr);
1258 // Check if Usr can be simplified to an integer constant when the value of one
1262 static ValueLatticeElement constantFoldUser(User *Usr, Value *Op,
1265 assert(isOperationFoldable(Usr) && "Precondition");
1267 // Check if Usr can be simplified to a constant.
1268 if (auto *CI = dyn_cast<CastInst>(Usr)) {
1275 } else if (auto *BO = dyn_cast<BinaryOperator>(Usr)) {
1321 if (User *Usr = dyn_cast<User>(Val)) {
1326 if (isa<IntegerType>(Usr->getType()) && isOperationFoldable(Usr)) {
1328 if (usesOperand(Usr, Condition)) {
1337 Result = constantFoldUser(Usr, Condition, ConditionVal, DL);
1346 for (unsigned i = 0; i < Usr->getNumOperands(); ++i) {
1347 Value *Op = Usr->getOperand(i);
1351 Result = constantFoldUser(Usr, Op, OpConst.getValue(), DL);
1372 if (User *Usr = dyn_cast<User>(Val))
1373 ValUsesConditionAndMayBeFoldable = isOperationFoldable(Usr) &&
1374 usesOperand(Usr, Condition);
1389 User *Usr = cast<User>(Val);
1392 constantFoldUser(Usr, Condition, CaseValue, DL);