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

Lines Matching refs:GEPLHS

801 /// Converts (CMP GEPLHS, RHS) if this change would make RHS a constant.
803 /// between GEPLHS and RHS.
804 static Instruction *transformToIndexedCompare(GEPOperator *GEPLHS, Value *RHS,
808 if (GEPLHS->getType()->isVectorTy())
811 if (!GEPLHS->hasAllConstantIndices())
815 if (GEPLHS->getType() != RHS->getType())
819 std::tie(PtrBase, Index) = getAsConstantIndexedAddress(GEPLHS, DL);
844 Instruction *InstCombiner::foldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
860 Value *PtrBase = GEPLHS->getOperand(0);
862 if (PtrBase == RHS && GEPLHS->isInBounds() &&
863 !GEPLHS->getType()->isVectorTy()) {
868 Value *Offset = evaluateGEPOffsetExpression(GEPLHS, *this, DL);
872 Offset = EmitGEPOffset(GEPLHS);
877 if (GEPLHS->isInBounds() && ICmpInst::isEquality(Cond) &&
898 auto *Base = GEPLHS->getPointerOperand();
899 if (GEPLHS->getType()->isVectorTy() && Base->getType()->isPointerTy()) {
900 int NumElts = cast<VectorType>(GEPLHS->getType())->getNumElements();
910 bool IndicesTheSame = GEPLHS->getNumOperands()==GEPRHS->getNumOperands();
911 IndicesTheSame &= GEPLHS->getOperand(0)->getType() ==
914 for (unsigned i = 1, e = GEPLHS->getNumOperands(); i != e; ++i)
915 if (GEPLHS->getOperand(i) != GEPRHS->getOperand(i)) {
921 Type *BaseType = GEPLHS->getOperand(0)->getType();
923 return new ICmpInst(Cond, GEPLHS->getOperand(0), GEPRHS->getOperand(0));
929 if (GEPLHS->isInBounds() && GEPRHS->isInBounds() &&
930 (GEPLHS->hasAllConstantIndices() || GEPLHS->hasOneUse()) &&
934 !GEPLHS->getType()->isVectorTy()) {
935 Value *LOffset = EmitGEPOffset(GEPLHS);
959 return transformToIndexedCompare(GEPLHS, RHS, Cond, DL);
964 if (!GEPLHS->getType()->isVectorTy() && GEPLHS->hasAllZeroIndices())
965 return foldGEPICmp(GEPRHS, GEPLHS->getOperand(0),
971 return foldGEPICmp(GEPLHS, GEPRHS->getOperand(0), Cond, I);
973 bool GEPsInBounds = GEPLHS->isInBounds() && GEPRHS->isInBounds();
974 if (GEPLHS->getNumOperands() == GEPRHS->getNumOperands()) {
979 if (GEPLHS->getOperand(i) != GEPRHS->getOperand(i)) {
980 Type *LHSType = GEPLHS->getOperand(i)->getType();
985 (GEPLHS->getType()->isVectorTy() &&
1001 Value *LHSV = GEPLHS->getOperand(DiffOperand);
1010 if (GEPsInBounds && (isa<ConstantExpr>(GEPLHS) || GEPLHS->hasOneUse()) &&
1013 Value *L = EmitGEPOffset(GEPLHS);
1021 return transformToIndexedCompare(GEPLHS, RHS, Cond, DL);