• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/InstCombine/

Lines Matching refs:Trunc

192   case Instruction::Trunc:
285 (CI.getOpcode() == Instruction::Trunc &&
425 case Instruction::Trunc:
462 static Instruction *foldVecTruncToExtElt(TruncInst &Trunc, InstCombiner &IC) {
463 Value *TruncOp = Trunc.getOperand(0);
464 Type *DestType = Trunc.getType();
501 Instruction *InstCombiner::narrowRotate(TruncInst &Trunc) {
502 assert((isa<VectorType>(Trunc.getSrcTy()) ||
503 shouldChangeType(Trunc.getSrcTy(), Trunc.getType())) &&
508 Type *DestTy = Trunc.getType();
516 if (!match(Trunc.getOperand(0), m_OneUse(m_Or(m_Value(Or0), m_Value(Or1)))))
564 unsigned WideWidth = Trunc.getSrcTy()->getScalarSizeInBits();
566 if (!MaskedValueIsZero(ShVal, HiBitMask, 0, &Trunc))
578 Function *F = Intrinsic::getDeclaration(Trunc.getModule(), IID, DestTy);
585 Instruction *InstCombiner::narrowBinOp(TruncInst &Trunc) {
586 Type *SrcTy = Trunc.getSrcTy();
587 Type *DestTy = Trunc.getType();
592 if (!match(Trunc.getOperand(0), m_OneUse(m_BinOp(BinOp))))
634 if (Instruction *NarrowOr = narrowRotate(Trunc))
643 static Instruction *shrinkSplatShuffle(TruncInst &Trunc,
645 auto *Shuf = dyn_cast<ShuffleVectorInst>(Trunc.getOperand(0));
650 Constant *NarrowUndef = UndefValue::get(Trunc.getType());
651 Value *NarrowOp = Builder.CreateTrunc(Shuf->getOperand(0), Trunc.getType());
663 static Instruction *shrinkInsertElt(CastInst &Trunc,
665 Instruction::CastOps Opcode = Trunc.getOpcode();
666 assert((Opcode == Instruction::Trunc || Opcode == Instruction::FPTrunc) &&
669 auto *InsElt = dyn_cast<InsertElementInst>(Trunc.getOperand(0));
673 Type *DestTy = Trunc.getType();
690 Instruction *InstCombiner::visitTrunc(TruncInst &Trunc) {
691 if (Instruction *Result = commonCastTransforms(Trunc))
694 Value *Src = Trunc.getOperand(0);
695 Type *DestTy = Trunc.getType(), *SrcTy = Src->getType();
705 canEvaluateTruncated(Src, DestTy, *this, &Trunc)) {
712 << Trunc << '\n');
715 return replaceInstUsesWith(Trunc, Res);
726 canEvaluateTruncated(Src, NewDestTy, *this, &Trunc)) {
730 << Trunc << '\n');
748 if (SimplifyDemandedInstructionBits(Trunc))
749 return &Trunc;
801 return replaceInstUsesWith(Trunc, Constant::getNullValue(DestTy));
835 if (Instruction *I = narrowBinOp(Trunc))
838 if (Instruction *I = shrinkSplatShuffle(Trunc, Builder))
841 if (Instruction *I = shrinkInsertElt(Trunc, Builder))
862 if (Instruction *I = foldVecTruncToExtElt(Trunc, *this))
1046 case Instruction::Trunc: // zext(trunc(x)) -> trunc(x) or zext(x)
1218 Value *Trunc = Builder.CreateTrunc(A, CI.getType());
1220 return BinaryOperator::CreateAnd(Trunc,
1221 ConstantInt::get(Trunc->getType(),
1377 case Instruction::Trunc: // sext(trunc(x)) -> trunc(x) or sext(x)