reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
992 bool HasScalarUndef = !C1->getType()->isVectorTy() && 993 (isa<UndefValue>(C1) || isa<UndefValue>(C2)); 997 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) 1000 return Constant::getNullValue(C1->getType()); 1004 return UndefValue::get(C1->getType()); 1006 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) // undef & undef -> undef 1007 return C1; 1008 return Constant::getNullValue(C1->getType()); // undef & X -> 0 1011 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) 1012 return C1; 1015 if (match(C1, m_APInt(CV)) || match(C2, m_APInt(CV))) 1017 return UndefValue::get(C1->getType()); 1020 return Constant::getNullValue(C1->getType()); 1030 return C1; 1032 return Constant::getNullValue(C1->getType()); 1040 return C1; 1042 return Constant::getNullValue(C1->getType()); 1044 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) // undef | undef -> undef 1045 return C1; 1046 return Constant::getAllOnesValue(C1->getType()); // undef | X -> ~0 1053 return C1; 1055 return Constant::getNullValue(C1->getType()); 1062 return C1; 1065 return Constant::getNullValue(C1->getType()); 1072 return C1; 1074 return Constant::getNullValue(C1->getType()); 1081 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) 1082 return C1; 1090 return ConstantFP::getNaN(C1->getType()); 1103 if (CI2->isZero()) return C1; // X + 0 == X 1106 if (CI2->isZero()) return C1; // X - 0 == X 1111 return C1; // X * 1 == X 1116 return C1; // X / 1 == X 1130 return C1; // X & -1 == X 1132 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { 1140 return C1; 1185 if (CI2->isZero()) return C1; // X | 0 == X 1190 if (CI2->isZero()) return C1; // X ^ 0 == X 1192 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { 1208 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) 1210 return ConstantExpr::getLShr(C1, C2); 1213 } else if (isa<ConstantInt>(C1)) { 1216 return ConstantExpr::get(Opcode, C2, C1); 1219 if (ConstantInt *CI1 = dyn_cast<ConstantInt>(C1)) { 1257 return UndefValue::get(C1->getType()); // too big shift is undef 1261 return UndefValue::get(C1->getType()); // too big shift is undef 1265 return UndefValue::get(C1->getType()); // too big shift is undef 1277 if (CI1->isZero()) return C1; 1282 } else if (ConstantFP *CFP1 = dyn_cast<ConstantFP>(C1)) { 1292 return ConstantFP::get(C1->getContext(), C3V); 1295 return ConstantFP::get(C1->getContext(), C3V); 1298 return ConstantFP::get(C1->getContext(), C3V); 1301 return ConstantFP::get(C1->getContext(), C3V); 1304 return ConstantFP::get(C1->getContext(), C3V); 1307 } else if (VectorType *VTy = dyn_cast<VectorType>(C1->getType())) { 1313 Constant *LHS = ConstantExpr::getExtractElement(C1, ExtractIdx); 1326 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { 1342 return ConstantFoldBinaryInstruction(Opcode, C2, C1); 1346 if (C1->getType()->isIntegerTy(1)) { 1350 return ConstantExpr::getXor(C1, C2); 1352 return ConstantExpr::getAnd(C1, C2); 1358 return C1; 1363 return C1; 1368 return ConstantInt::getFalse(C1->getContext());