Lines Matching defs:TrueVal

210 Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,
214 if (Instruction *TVI = dyn_cast<Instruction>(TrueVal)) {
251 !isa<Constant>(TrueVal)) {
254 if ((SFO & 1) && TrueVal == FVI->getOperand(0)) {
256 } else if ((SFO & 2) && TrueVal == FVI->getOperand(1)) {
270 TrueVal, NewSel);
361 Value *TrueVal = SI.getTrueValue();
396 if ((CmpLHS == TrueVal && AdjustedRHS == FalseVal) ||
397 (CmpLHS == FalseVal && AdjustedRHS == TrueVal))
411 if (match(TrueVal, m_SExt(m_Specific(CmpLHS))) &&
413 CmpLHS = TrueVal;
416 sextRHS == TrueVal) {
425 if (match(TrueVal, m_ZExt(m_Specific(CmpLHS))) &&
427 CmpLHS = TrueVal;
430 zextRHS == TrueVal) {
442 std::swap(FalseVal, TrueVal);
446 SI.setOperand(1, TrueVal);
465 if (TrueVal->getType() == Ty) {
469 C1 = dyn_cast<ConstantInt>(TrueVal);
473 C2 = dyn_cast<ConstantInt>(TrueVal);
494 if (SimplifyWithOpReplaced(FalseVal, CmpLHS, CmpRHS, TD, TLI) == TrueVal ||
495 SimplifyWithOpReplaced(FalseVal, CmpRHS, CmpLHS, TD, TLI) == TrueVal)
497 if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, TD, TLI) == FalseVal ||
498 SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, TD, TLI) == FalseVal)
501 if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, TD, TLI) == FalseVal ||
502 SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, TD, TLI) == FalseVal)
503 return ReplaceInstUsesWith(SI, TrueVal);
504 if (SimplifyWithOpReplaced(FalseVal, CmpLHS, CmpRHS, TD, TLI) == TrueVal ||
505 SimplifyWithOpReplaced(FalseVal, CmpRHS, CmpLHS, TD, TLI) == TrueVal)
506 return ReplaceInstUsesWith(SI, TrueVal);
512 if (CmpLHS == TrueVal && Pred == ICmpInst::ICMP_EQ) {
595 static Value *foldSelectICmpAnd(const SelectInst &SI, ConstantInt *TrueVal,
615 if (!TrueVal->isZero() && !FalseVal->isZero()) {
616 if ((TrueVal->getValue() - FalseVal->getValue()).isPowerOf2())
618 else if ((FalseVal->getValue() - TrueVal->getValue()).isPowerOf2())
619 Offset = TrueVal;
623 // Adjust TrueVal and FalseVal to the offset.
624 TrueVal = ConstantInt::get(Builder->getContext(),
625 TrueVal->getValue() - Offset->getValue());
632 (!TrueVal->getValue().isPowerOf2() &&
638 ConstantInt *ValC = !TrueVal->isZero() ? TrueVal : FalseVal;
650 bool ShouldNotVal = !TrueVal->isZero();
663 Value *TrueVal = SI.getTrueValue();
666 if (Value *V = SimplifySelectInst(CondVal, TrueVal, FalseVal, TD))
670 if (ConstantInt *C = dyn_cast<ConstantInt>(TrueVal)) {
681 return BinaryOperator::CreateAnd(CondVal, TrueVal);
685 return BinaryOperator::CreateOr(NotCond, TrueVal);
690 if (CondVal == TrueVal)
693 return BinaryOperator::CreateAnd(CondVal, TrueVal);
697 if (match(TrueVal, m_Not(m_Specific(CondVal))))
698 return BinaryOperator::CreateAnd(TrueVal, FalseVal);
700 return BinaryOperator::CreateOr(TrueVal, FalseVal);
704 if (ConstantInt *TrueValC = dyn_cast<ConstantInt>(TrueVal))
732 if (FCI->getOperand(0) == TrueVal && FCI->getOperand(1) == FalseVal) {
739 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) &&
751 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) &&
755 return ReplaceInstUsesWith(SI, TrueVal);
759 } else if (FCI->getOperand(0) == FalseVal && FCI->getOperand(1) == TrueVal){
766 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) &&
778 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) &&
782 return ReplaceInstUsesWith(SI, TrueVal);
794 if (Instruction *TI = dyn_cast<Instruction>(TrueVal))
854 if (Instruction *FoldI = FoldSelectIntoOp(SI, TrueVal, FalseVal))
881 if (CanSelectOperandBeMappingIntoPredBlock(TrueVal, SI) &&
886 if (SelectInst *TrueSI = dyn_cast<SelectInst>(TrueVal)) {
906 SI.setOperand(2, TrueVal);
934 Value *V = Builder->CreateShuffleVector(TrueVal, FalseVal, MaskVal);