llvm.org GIT mirror llvm / 1608769
Add support for vectors of pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145801 91177308-0d34-0410-b5e6-96231b3b80d8 Nadav Rotem 7 years ago
26 changed file(s) with 633 addition(s) and 73 deletion(s). Raw diff Collapse all Expand all
21882188
21892189
21902190

The number of elements is a constant integer value larger than 0; elementtype

2191 may be any integer or floating point type. Vectors of size zero are not
2192 allowed, and pointers are not allowed as the element type.

2191 may be any integer or floating point type, or a pointer to these types.
2192 Vectors of size zero are not allowed.

21932193
21942194
Examples:
21952195
22042204
22052205 <2 x i64>
22062206 Vector of 2 64-bit integer values.
2207
2208
2209 <4 x i64*>
2210 Vector of 4 pointers to 64-bit integer values.
22072211
22082212
22092213
50685072

                  
                
50695073 <result> = getelementptr <pty>* <ptrval>{, <ty> <idx>}*
50705074 <result> = getelementptr inbounds <pty>* <ptrval>{, <ty> <idx>}*
5075 <result> = getelementptr <ptr vector> ptrval, <vector index type> idx
50715076
50725077
50735078
Overview:
50765081 It performs address calculation only and does not access memory.

50775082
50785083
Arguments:
5079

The first argument is always a pointer, and forms the basis of the

5084

The first argument is always a pointer or a vector of pointers,

5085 and forms the basis of the
50805086 calculation. The remaining arguments are indices that indicate which of the
50815087 elements of the aggregate object are indexed. The interpretation of each
50825088 index is dependent on the type being indexed into. The first index always
51615167 precise signed arithmetic are not an in bounds address of that
51625168 allocated object. The in bounds addresses for an allocated object
51635169 are all the addresses that point into the object, plus the address one
5164 byte past the end.

5170 byte past the end.
5171 In cases where the base is a vector of pointers the inbounds keyword
5172 applies to each of the computations element-wise.

51655173
51665174

If the inbounds keyword is not present, the offsets are added to

51675175 the base address with silently-wrapping two's complement arithmetic. If the
51885196 %iptr = getelementptr [10 x i32]* @arr, i16 0, i16 0
51895197
51905198
5199

In cases where the pointer argument is a vector of pointers, only a

5200 single index may be used, and the number of vector elements has to be
5201 the same. For example:

5202

                  
                
5203 %A = getelementptr <4 x i8*> %ptrs, <4 x i64> %offsets,
5204
5205
51915206
51925207
51935208
55605575
55615576
55625577
Overview:
5563

The 'ptrtoint' instruction converts the pointer value to

5564 the integer type ty2.

5578

The 'ptrtoint' instruction converts the pointer or a vector of

5579 pointers value to
5580 the integer (or vector of integers) type ty2.

55655581
55665582
Arguments:
55675583

The 'ptrtoint' instruction takes a value to cast, which

5568 must be a pointer value, and a type to cast it to
5569 ty2, which must be an integer type.

5584 must be a a value of type pointer or a vector of
5585 pointers, and a type to cast it to
5586 ty2, which must be an integer or a vector
5587 of integers type.

55705588
55715589
Semantics:
55725590

The 'ptrtoint' instruction converts value to integer type

55795597
55805598
Example:
55815599

                  
                
5582 %X = ptrtoint i32* %X to i8 ; yields truncation on 32-bit architecture
5583 %Y = ptrtoint i32* %x to i64 ; yields zero extension on 32-bit architecture
5600 %X = ptrtoint i32* %P to i8 ; yields truncation on 32-bit architecture
5601 %Y = ptrtoint i32* %P to i64 ; yields zero extension on 32-bit architecture
5602 %Z = ptrtoint <4 x i32*> %P to <4 x i64>; yields vector zero extension for a vector of addresses on 32-bit architecture
55845603
55855604
55865605
56195638 %X = inttoptr i32 255 to i32* ; yields zero extension on 64-bit architecture
56205639 %Y = inttoptr i32 255 to i32* ; yields no-op on 32-bit architecture
56215640 %Z = inttoptr i64 0 to i32* ; yields truncation on 32-bit architecture
5641 %Z = inttoptr <4 x i32> %G to <4 x i8*>; yields truncation of vector G to four pointers
56225642
56235643
56245644
56535673

The 'bitcast' instruction converts value to type

56545674 ty2. It is always a no-op cast because no bits change with
56555675 this conversion. The conversion is done as if the value had been
5656 stored to memory and read back as type ty2. Pointer types may only
5657 be converted to other pointer types with this instruction. To convert
5676 stored to memory and read back as type ty2.
5677 Pointer (or vector of pointers) types may only be converted to other pointer
5678 (or vector of pointers) types with this instruction. To convert
56585679 pointers to other types, use the inttoptr or
56595680 ptrtoint instructions first.

56605681
56625683

                  
                
56635684 %X = bitcast i8 255 to i8 ; yields i8 :-1
56645685 %Y = bitcast i32* %x to sint* ; yields sint*:%x
5665 %Z = bitcast <2 x int> %V to i64; ; yields i64: %V
5686 %Z = bitcast <2 x int> %V to i64; ; yields i64: %V
5687 %Z = bitcast <2 x i32*> %V to <2 x i64*> ; yields <2 x i64*>
56665688
56675689
56685690
56935715
56945716
Overview:
56955717

The 'icmp' instruction returns a boolean value or a vector of

5696 boolean values based on comparison of its two integer, integer vector, or
5697 pointer operands.

5718 boolean values based on comparison of its two integer, integer vector,
5719 pointer, or pointer vector operands.

56985720
56995721
Arguments:
57005722

The 'icmp' instruction takes three operands. The first operand is

373373 ///
374374 static VectorType *getInteger(VectorType *VTy) {
375375 unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
376 assert(EltBits && "Element size must be of a non-zero size");
376377 Type *EltTy = IntegerType::get(VTy->getContext(), EltBits);
377378 return VectorType::get(EltTy, VTy->getNumElements());
378379 }
407408 unsigned getNumElements() const { return NumElements; }
408409
409410 /// @brief Return the number of bits in the Vector type.
411 /// Returns zero when the vector is a vector of pointers.
410412 unsigned getBitWidth() const {
411413 return NumElements * getElementType()->getPrimitiveSizeInBits();
412414 }
775775 static Type *getIndexedType(Type *Ptr, ArrayRef IdxList);
776776 static Type *getIndexedType(Type *Ptr, ArrayRef IdxList);
777777
778 /// getIndexedType - Returns the address space used by the GEP pointer.
779 ///
780 static unsigned getAddressSpace(Value *Ptr);
781
778782 inline op_iterator idx_begin() { return op_begin()+1; }
779783 inline const_op_iterator idx_begin() const { return op_begin()+1; }
780784 inline op_iterator idx_end() { return op_end(); }
787791 return getOperand(0);
788792 }
789793 static unsigned getPointerOperandIndex() {
790 return 0U; // get index for modifying correct operand
794 return 0U; // get index for modifying correct operand.
791795 }
792796
793797 unsigned getPointerAddressSpace() const {
796800
797801 /// getPointerOperandType - Method to return the pointer operand as a
798802 /// PointerType.
799 PointerType *getPointerOperandType() const {
800 return reinterpret_cast(getPointerOperand()->getType());
801 }
802
803 Type *getPointerOperandType() const {
804 return getPointerOperand()->getType();
805 }
806
807 /// GetGEPReturnType - Returns the pointer type returned by the GEP
808 /// instruction, which may be a vector of pointers.
809 static Type *getGEPReturnType(Value *Ptr, ArrayRef IdxList) {
810 Type *PtrTy = PointerType::get(checkGEPType(
811 getIndexedType(Ptr->getType(), IdxList)),
812 getAddressSpace(Ptr));
813 // Vector GEP
814 if (Ptr->getType()->isVectorTy()) {
815 unsigned NumElem = cast(Ptr->getType())->getNumElements();
816 return VectorType::get(PtrTy, NumElem);
817 }
818
819 // Scalar GEP
820 return PtrTy;
821 }
803822
804823 unsigned getNumIndices() const { // Note: always non-negative
805824 return getNumOperands() - 1;
846865 unsigned Values,
847866 const Twine &NameStr,
848867 Instruction *InsertBefore)
849 : Instruction(PointerType::get(checkGEPType(
850 getIndexedType(Ptr->getType(), IdxList)),
851 cast(Ptr->getType())
852 ->getAddressSpace()),
868 : Instruction(getGEPReturnType(Ptr, IdxList),
853869 GetElementPtr,
854870 OperandTraits::op_end(this) - Values,
855871 Values, InsertBefore) {
860876 unsigned Values,
861877 const Twine &NameStr,
862878 BasicBlock *InsertAtEnd)
863 : Instruction(PointerType::get(checkGEPType(
864 getIndexedType(Ptr->getType(), IdxList)),
865 cast(Ptr->getType())
866 ->getAddressSpace()),
879 : Instruction(getGEPReturnType(Ptr, IdxList),
867880 GetElementPtr,
868881 OperandTraits::op_end(this) - Values,
869882 Values, InsertAtEnd) {
904917 "Both operands to ICmp instruction are not of the same type!");
905918 // Check that the operands are the right type
906919 assert((getOperand(0)->getType()->isIntOrIntVectorTy() ||
907 getOperand(0)->getType()->isPointerTy()) &&
920 getOperand(0)->getType()->getScalarType()->isPointerTy()) &&
908921 "Invalid operand types for ICmp instruction");
909922 }
910923
944957 "Both operands to ICmp instruction are not of the same type!");
945958 // Check that the operands are the right type
946959 assert((getOperand(0)->getType()->isIntOrIntVectorTy() ||
947 getOperand(0)->getType()->isPointerTy()) &&
960 getOperand(0)->getType()->getScalarType()->isPointerTy()) &&
948961 "Invalid operand types for ICmp instruction");
949962 }
950963
260260
261261 /// getPointerOperandType - Method to return the pointer operand as a
262262 /// PointerType.
263 PointerType *getPointerOperandType() const {
264 return reinterpret_cast(getPointerOperand()->getType());
263 Type *getPointerOperandType() const {
264 return getPointerOperand()->getType();
265265 }
266266
267267 unsigned getNumIndices() const { // Note: always non-negative
519519 /// AllowUnknown is true, this will return MVT::Other for types with no EVT
520520 /// counterpart (e.g. structs), otherwise it will assert.
521521 EVT getValueType(Type *Ty, bool AllowUnknown = false) const {
522 EVT VT = EVT::getEVT(Ty, AllowUnknown);
523 return VT == MVT::iPTR ? PointerTy : VT;
522 // Lower scalar pointers to native pointer types.
523 if (Ty->isPointerTy()) return PointerTy;
524
525 if (Ty->isVectorTy()) {
526 VectorType *VTy = cast(Ty);
527 Type *Elm = VTy->getElementType();
528 // Lower vectors of pointers to native pointer types.
529 if (Elm->isPointerTy())
530 Elm = EVT(PointerTy).getTypeForEVT(Ty->getContext());
531 return EVT::getVectorVT(Ty->getContext(), EVT::getEVT(Elm, false),
532 VTy->getNumElements());
533 }
534 return EVT::getEVT(Ty, AllowUnknown);
524535 }
525536
526537 /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
271271 /// getScalarType - If this is a vector type, return the element type,
272272 /// otherwise return 'this'.
273273 Type *getScalarType();
274
275 /// getNumElements - If this is a vector type, return the number of elements,
276 /// otherwise return zero.
277 unsigned getNumElements();
274278
275279 //===--------------------------------------------------------------------===//
276280 // Type Iteration support.
579579 Type *ResultTy, const TargetData *TD,
580580 const TargetLibraryInfo *TLI) {
581581 Constant *Ptr = Ops[0];
582 if (!TD || !cast(Ptr->getType())->getElementType()->isSized())
582 if (!TD || !cast(Ptr->getType())->getElementType()->isSized() ||
583 !Ptr->getType()->isPointerTy())
583584 return 0;
584585
585586 Type *IntPtrTy = TD->getIntPtrType(Ptr->getContext());
17631763 // also a case of comparing two zero-extended values.
17641764 if (RExt == CI && MaxRecurse)
17651765 if (Value *V = SimplifyICmpInst(ICmpInst::getUnsignedPredicate(Pred),
1766 SrcOp, Trunc, TD, TLI, DT, MaxRecurse-1))
1766 SrcOp, Trunc, TD, TLI, DT, MaxRecurse-1))
17671767 return V;
17681768
17691769 // Otherwise the upper bits of LHS are zero while RHS has a non-zero bit
23582358 Value *llvm::SimplifyGEPInst(ArrayRef Ops, const TargetData *TD,
23592359 const DominatorTree *) {
23602360 // The type of the GEP pointer operand.
2361 PointerType *PtrTy = cast(Ops[0]->getType());
2361 PointerType *PtrTy = dyn_cast(Ops[0]->getType());
2362 // The GEP pointer operand is not a pointer, it's a vector of pointers.
2363 if (!PtrTy)
2364 return 0;
23622365
23632366 // getelementptr P -> P.
23642367 if (Ops.size() == 1)
6262 assert(V && "No Value?");
6363 assert(Depth <= MaxDepth && "Limit Search Depth");
6464 unsigned BitWidth = Mask.getBitWidth();
65 assert((V->getType()->isIntOrIntVectorTy() || V->getType()->isPointerTy())
66 && "Not integer or pointer type!");
65 assert((V->getType()->isIntOrIntVectorTy() ||
66 V->getType()->getScalarType()->isPointerTy()) &&
67 "Not integer or pointer type!");
6768 assert((!TD ||
6869 TD->getTypeSizeInBits(V->getType()->getScalarType()) == BitWidth) &&
6970 (!V->getType()->isIntOrIntVectorTy() ||
7071 V->getType()->getScalarSizeInBits() == BitWidth) &&
71 KnownZero.getBitWidth() == BitWidth &&
72 KnownZero.getBitWidth() == BitWidth &&
7273 KnownOne.getBitWidth() == BitWidth &&
7374 "V, Mask, KnownOne and KnownZero should have same BitWidth");
7475
15561557 Value *llvm::GetPointerBaseWithConstantOffset(Value *Ptr, int64_t &Offset,
15571558 const TargetData &TD) {
15581559 Operator *PtrOp = dyn_cast(Ptr);
1559 if (PtrOp == 0) return Ptr;
1560 if (PtrOp == 0 || Ptr->getType()->isVectorTy())
1561 return Ptr;
15601562
15611563 // Just look through bitcasts.
15621564 if (PtrOp->getOpcode() == Instruction::BitCast)
16061606 if ((unsigned)Size != Size)
16071607 return Error(SizeLoc, "size too large for vector");
16081608 if (!VectorType::isValidElementType(EltTy))
1609 return Error(TypeLoc, "vector element type must be fp or integer");
1609 return Error(TypeLoc,
1610 "vector element type must be fp, integer or a pointer to these types");
16101611 Result = VectorType::get(EltTy, unsigned(Size));
16111612 } else {
16121613 if (!ArrayType::isValidElementType(EltTy))
19651966 return Error(ID.Loc, "constant vector must not be empty");
19661967
19671968 if (!Elts[0]->getType()->isIntegerTy() &&
1968 !Elts[0]->getType()->isFloatingPointTy())
1969 !Elts[0]->getType()->isFloatingPointTy() &&
1970 !Elts[0]->getType()->isPointerTy())
19691971 return Error(FirstEltLoc,
1970 "vector elements must have integer or floating point type");
1972 "vector elements must have integer, pointer or floating point type");
19711973
19721974 // Verify that all the vector elements have the same type.
19731975 for (unsigned i = 1, e = Elts.size(); i != e; ++i)
21592161 } else {
21602162 assert(Opc == Instruction::ICmp && "Unexpected opcode for CmpInst!");
21612163 if (!Val0->getType()->isIntOrIntVectorTy() &&
2162 !Val0->getType()->isPointerTy())
2164 !Val0->getType()->getScalarType()->isPointerTy())
21632165 return Error(ID.Loc, "icmp requires pointer or integer operands");
21642166 ID.ConstantVal = ConstantExpr::getICmp(Pred, Val0, Val1);
21652167 }
22932295 return true;
22942296
22952297 if (Opc == Instruction::GetElementPtr) {
2296 if (Elts.size() == 0 || !Elts[0]->getType()->isPointerTy())
2298 if (Elts.size() == 0 ||
2299 !Elts[0]->getType()->getScalarType()->isPointerTy())
22972300 return Error(ID.Loc, "getelementptr requires pointer operand");
22982301
22992302 ArrayRef Indices(Elts.begin() + 1, Elts.end());
33283331 } else {
33293332 assert(Opc == Instruction::ICmp && "Unknown opcode for CmpInst!");
33303333 if (!LHS->getType()->isIntOrIntVectorTy() &&
3331 !LHS->getType()->isPointerTy())
3334 !LHS->getType()->getScalarType()->isPointerTy())
33323335 return Error(Loc, "icmp requires integer operands");
33333336 Inst = new ICmpInst(CmpInst::Predicate(Pred), LHS, RHS);
33343337 }
38763879 /// ParseGetElementPtr
38773880 /// ::= 'getelementptr' 'inbounds'? TypeAndValue (',' TypeAndValue)*
38783881 int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
3879 Value *Ptr, *Val; LocTy Loc, EltLoc;
3882 Value *Ptr = 0;
3883 Value *Val = 0;
3884 LocTy Loc, EltLoc;
38803885
38813886 bool InBounds = EatIfPresent(lltok::kw_inbounds);
38823887
38833888 if (ParseTypeAndValue(Ptr, Loc, PFS)) return true;
38843889
3885 if (!Ptr->getType()->isPointerTy())
3890 if (!Ptr->getType()->getScalarType()->isPointerTy())
38863891 return Error(Loc, "base of getelementptr must be a pointer");
38873892
38883893 SmallVector Indices;
38933898 break;
38943899 }
38953900 if (ParseTypeAndValue(Val, EltLoc, PFS)) return true;
3896 if (!Val->getType()->isIntegerTy())
3901 if (!Val->getType()->getScalarType()->isIntegerTy())
38973902 return Error(EltLoc, "getelementptr index must be an integer");
3903 if (Val->getType()->isVectorTy() != Ptr->getType()->isVectorTy())
3904 return Error(EltLoc, "getelementptr index type missmatch");
3905 if (Val->getType()->isVectorTy()) {
3906 unsigned ValNumEl = cast(Val->getType())->getNumElements();
3907 unsigned PtrNumEl = cast(Ptr->getType())->getNumElements();
3908 if (ValNumEl != PtrNumEl)
3909 return Error(EltLoc,
3910 "getelementptr vector index has a wrong number of elements");
3911 }
38983912 Indices.push_back(Val);
38993913 }
3914
3915 if (Val && Val->getType()->isVectorTy() && Indices.size() != 1)
3916 return Error(EltLoc, "vector getelementptrs must have a single index");
39003917
39013918 if (!GetElementPtrInst::getIndexedType(Ptr->getType(), Indices))
39023919 return Error(Loc, "invalid getelementptr indices");
30983098 unsigned Amt = ElementSize.logBase2();
30993099 IdxN = DAG.getNode(ISD::SHL, getCurDebugLoc(),
31003100 N.getValueType(), IdxN,
3101 DAG.getConstant(Amt, TLI.getPointerTy()));
3101 DAG.getConstant(Amt, IdxN.getValueType()));
31023102 } else {
31033103 SDValue Scale = DAG.getConstant(ElementSize, TLI.getPointerTy());
31043104 IdxN = DAG.getNode(ISD::MUL, getCurDebugLoc(),
264264 // Get the current byte offset into the thing. Use the original
265265 // operand in case we're looking through a bitcast.
266266 SmallVector Ops(GEP->idx_begin(), GEP->idx_end());
267 if (!GEP->getPointerOperandType()->isPointerTy())
268 return 0;
267269 Offset = TD->getIndexedOffset(GEP->getPointerOperandType(), Ops);
268270
269271 Op1 = GEP->getPointerOperand()->stripPointerCasts();
830830 MadeChange = true;
831831 }
832832
833 if ((*I)->getType() != IntPtrTy) {
833 Type *IndexTy = (*I)->getType();
834 if (IndexTy != IntPtrTy && !IndexTy->isVectorTy()) {
834835 // If we are using a wider index than needed for this platform, shrink
835836 // it to what we need. If narrower, sign-extend it to what we need.
836837 // This explicit cast can make subsequent optimizations more obvious.
913914
914915 // Handle gep(bitcast x) and gep(gep x, 0, 0, 0).
915916 Value *StrippedPtr = PtrOp->stripPointerCasts();
916 PointerType *StrippedPtrTy =cast(StrippedPtr->getType());
917 PointerType *StrippedPtrTy = dyn_cast(StrippedPtr->getType());
918 // We do not handle pointer-vector geps here
919 if (!StrippedPtr)
920 return 0;
921
917922 if (StrippedPtr != PtrOp &&
918923 StrippedPtrTy->getAddressSpace() == GEP.getPointerAddressSpace()) {
919924
177177 // base of a recurrence. This handles the case in which SCEV expansion
178178 // converts a pointer type recurrence into a nonrecurrent pointer base
179179 // indexed by an integer recurrence.
180
181 // If the GEP base pointer is a vector of pointers, abort.
182 if (!FromPtr->getType()->isPointerTy() || !ToPtr->getType()->isPointerTy())
183 return false;
184
180185 const SCEV *FromBase = SE->getPointerBase(SE->getSCEV(FromPtr));
181186 const SCEV *ToBase = SE->getPointerBase(SE->getSCEV(ToPtr));
182187 if (FromBase == ToBase)
452452
453453 // Compute the offset that this GEP adds to the pointer.
454454 SmallVector Indices(GEP->op_begin()+1, GEP->op_end());
455 if (!GEP->getPointerOperandType()->isPointerTy())
456 return false;
455457 uint64_t GEPOffset = TD.getIndexedOffset(GEP->getPointerOperandType(),
456458 Indices);
457459 // See if all uses can be converted.
13971397 }
13981398
13991399 Constant *ConstantExpr::getPtrToInt(Constant *C, Type *DstTy) {
1400 assert(C->getType()->isPointerTy() && "PtrToInt source must be pointer");
1401 assert(DstTy->isIntegerTy() && "PtrToInt destination must be integral");
1400 assert(C->getType()->getScalarType()->isPointerTy() &&
1401 "PtrToInt source must be pointer or pointer vector");
1402 assert(DstTy->getScalarType()->isIntegerTy() &&
1403 "PtrToInt destination must be integer or integer vector");
1404 assert(C->getType()->getNumElements() == DstTy->getNumElements() &&
1405 "Invalid cast between a different number of vector elements");
14021406 return getFoldedCast(Instruction::PtrToInt, C, DstTy);
14031407 }
14041408
14051409 Constant *ConstantExpr::getIntToPtr(Constant *C, Type *DstTy) {
1406 assert(C->getType()->isIntegerTy() && "IntToPtr source must be integral");
1407 assert(DstTy->isPointerTy() && "IntToPtr destination must be a pointer");
1410 assert(C->getType()->getScalarType()->isIntegerTy() &&
1411 "IntToPtr source must be integer or integer vector");
1412 assert(DstTy->getScalarType()->isPointerTy() &&
1413 "IntToPtr destination must be a pointer or pointer vector");
1414 assert(C->getType()->getNumElements() == DstTy->getNumElements() &&
1415 "Invalid cast between a different number of vector elements");
14081416 return getFoldedCast(Instruction::IntToPtr, C, DstTy);
14091417 }
14101418
13581358 ///
13591359 template
13601360 static Type *getIndexedTypeInternal(Type *Ptr, ArrayRef IdxList) {
1361 if (Ptr->isVectorTy()) {
1362 assert(IdxList.size() == 1 &&
1363 "GEP with vector pointers must have a single index");
1364 PointerType *PTy = dyn_cast(
1365 cast(Ptr)->getElementType());
1366 assert(PTy && "Gep with invalid vector pointer found");
1367 return PTy->getElementType();
1368 }
1369
13611370 PointerType *PTy = dyn_cast(Ptr);
13621371 if (!PTy) return 0; // Type isn't a pointer type!
13631372 Type *Agg = PTy->getElementType();
13651374 // Handle the special case of the empty set index set, which is always valid.
13661375 if (IdxList.empty())
13671376 return Agg;
1368
1377
13691378 // If there is at least one index, the top level type must be sized, otherwise
13701379 // it cannot be 'stepped over'.
13711380 if (!Agg->isSized())
13931402
13941403 Type *GetElementPtrInst::getIndexedType(Type *Ptr, ArrayRef IdxList) {
13951404 return getIndexedTypeInternal(Ptr, IdxList);
1405 }
1406
1407 unsigned GetElementPtrInst::getAddressSpace(Value *Ptr) {
1408 Type *Ty = Ptr->getType();
1409
1410 if (VectorType *VTy = dyn_cast(Ty))
1411 Ty = VTy->getElementType();
1412
1413 if (PointerType *PTy = dyn_cast(Ty))
1414 return PTy->getAddressSpace();
1415
1416 assert(false && "Invalid GEP pointer type");
1417 return 0;
13961418 }
13971419
13981420 /// hasAllZeroIndices - Return true if all of the indices of this GEP are
26532675 return SrcTy->isFPOrFPVectorTy() && DstTy->isIntOrIntVectorTy() &&
26542676 SrcLength == DstLength;
26552677 case Instruction::PtrToInt:
2656 return SrcTy->isPointerTy() && DstTy->isIntegerTy();
2678 if (SrcTy->getNumElements() != DstTy->getNumElements())
2679 return false;
2680 return SrcTy->getScalarType()->isPointerTy() &&
2681 DstTy->getScalarType()->isIntegerTy();
26572682 case Instruction::IntToPtr:
2658 return SrcTy->isIntegerTy() && DstTy->isPointerTy();
2683 if (SrcTy->getNumElements() != DstTy->getNumElements())
2684 return false;
2685 return SrcTy->getScalarType()->isIntegerTy() &&
2686 DstTy->getScalarType()->isPointerTy();
26592687 case Instruction::BitCast:
26602688 // BitCast implies a no-op cast of type only. No bits change.
26612689 // However, you can't cast pointers to anything but pointers.
4343 if (VectorType *VTy = dyn_cast(this))
4444 return VTy->getElementType();
4545 return this;
46 }
47
48 /// getNumElements - If this is a vector type, return the number of elements,
49 /// otherwise return zero.
50 unsigned Type::getNumElements() {
51 if (VectorType *VTy = dyn_cast(this))
52 return VTy->getNumElements();
53 return 0;
4654 }
4755
4856 /// isIntegerTy - Return true if this is an IntegerType of the specified width.
663671 }
664672
665673 bool VectorType::isValidElementType(Type *ElemTy) {
674 if (PointerType *PTy = dyn_cast(ElemTy))
675 ElemTy = PTy->getElementType();
666676 return ElemTy->isIntegerTy() || ElemTy->isFloatingPointTy();
667677 }
668678
10341034 Type *SrcTy = I.getOperand(0)->getType();
10351035 Type *DestTy = I.getType();
10361036
1037 Assert1(SrcTy->isPointerTy(), "PtrToInt source must be pointer", &I);
1038 Assert1(DestTy->isIntegerTy(), "PtrToInt result must be integral", &I);
1037 Assert1(SrcTy->getScalarType()->isPointerTy(),
1038 "PtrToInt source must be pointer", &I);
1039 Assert1(DestTy->getScalarType()->isIntegerTy(),
1040 "PtrToInt result must be integral", &I);
1041 Assert1(SrcTy->isVectorTy() == DestTy->isVectorTy(),
1042 "PtrToInt type mismatch", &I);
1043
1044 if (SrcTy->isVectorTy()) {
1045 VectorType *VSrc = dyn_cast(SrcTy);
1046 VectorType *VDest = dyn_cast(DestTy);
1047 Assert1(VSrc->getNumElements() == VDest->getNumElements(),
1048 "PtrToInt Vector width mismatch", &I);
1049 }
10391050
10401051 visitInstruction(I);
10411052 }
10451056 Type *SrcTy = I.getOperand(0)->getType();
10461057 Type *DestTy = I.getType();
10471058
1048 Assert1(SrcTy->isIntegerTy(), "IntToPtr source must be an integral", &I);
1049 Assert1(DestTy->isPointerTy(), "IntToPtr result must be a pointer",&I);
1050
1059 Assert1(SrcTy->getScalarType()->isIntegerTy(),
1060 "IntToPtr source must be an integral", &I);
1061 Assert1(DestTy->getScalarType()->isPointerTy(),
1062 "IntToPtr result must be a pointer",&I);
1063 Assert1(SrcTy->isVectorTy() == DestTy->isVectorTy(),
1064 "IntToPtr type mismatch", &I);
1065 if (SrcTy->isVectorTy()) {
1066 VectorType *VSrc = dyn_cast(SrcTy);
1067 VectorType *VDest = dyn_cast(DestTy);
1068 Assert1(VSrc->getNumElements() == VDest->getNumElements(),
1069 "IntToPtr Vector width mismatch", &I);
1070 }
10511071 visitInstruction(I);
10521072 }
10531073
12441264 Assert1(Op0Ty == Op1Ty,
12451265 "Both operands to ICmp instruction are not of the same type!", &IC);
12461266 // Check that the operands are the right type
1247 Assert1(Op0Ty->isIntOrIntVectorTy() || Op0Ty->isPointerTy(),
1267 Assert1(Op0Ty->isIntOrIntVectorTy() || Op0Ty->getScalarType()->isPointerTy(),
12481268 "Invalid operand types for ICmp instruction", &IC);
12491269 // Check that the predicate is valid.
12501270 Assert1(IC.getPredicate() >= CmpInst::FIRST_ICMP_PREDICATE &&
12941314 }
12951315
12961316 void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
1297 Assert1(cast(GEP.getOperand(0)->getType())
1298 ->getElementType()->isSized(),
1317 Type *TargetTy = GEP.getPointerOperandType();
1318 if (VectorType *VTy = dyn_cast(TargetTy))
1319 TargetTy = VTy->getElementType();
1320
1321 Assert1(dyn_cast(TargetTy),
1322 "GEP base pointer is not a vector or a vector of pointers", &GEP);
1323 Assert1(cast(TargetTy)->getElementType()->isSized(),
12991324 "GEP into unsized type!", &GEP);
1300
1325
13011326 SmallVector Idxs(GEP.idx_begin(), GEP.idx_end());
13021327 Type *ElTy =
1303 GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(), Idxs);
1328 GetElementPtrInst::getIndexedType(GEP.getPointerOperandType(), Idxs);
13041329 Assert1(ElTy, "Invalid indices for GEP pointer type!", &GEP);
1305 Assert2(GEP.getType()->isPointerTy() &&
1306 cast(GEP.getType())->getElementType() == ElTy,
1307 "GEP is not of right type for indices!", &GEP, ElTy);
1330
1331 if (GEP.getPointerOperandType()->isPointerTy()) {
1332 // Validate GEPs with scalar indices.
1333 Assert2(GEP.getType()->isPointerTy() &&
1334 cast(GEP.getType())->getElementType() == ElTy,
1335 "GEP is not of right type for indices!", &GEP, ElTy);
1336 } else {
1337 // Validate GEPs with a vector index.
1338 Assert1(Idxs.size() == 1, "Invalid number of indices!", &GEP);
1339 Value *Index = Idxs[0];
1340 Type *IndexTy = Index->getType();
1341 Assert1(IndexTy->isVectorTy(),
1342 "Vector GEP must have vector indices!", &GEP);
1343 Assert1(GEP.getType()->isVectorTy(),
1344 "Vector GEP must return a vector value", &GEP);
1345 Type *ElemPtr = cast(GEP.getType())->getElementType();
1346 Assert1(ElemPtr->isPointerTy(),
1347 "Vector GEP pointer operand is not a pointer!", &GEP);
1348 unsigned IndexWidth = cast(IndexTy)->getNumElements();
1349 unsigned GepWidth = cast(GEP.getType())->getNumElements();
1350 Assert1(IndexWidth == GepWidth, "Invalid GEP index vector width", &GEP);
1351 Assert1(ElTy == cast(ElemPtr)->getElementType(),
1352 "Vector GEP type does not match pointer type!", &GEP);
1353 }
13081354 visitInstruction(GEP);
13091355 }
13101356
0 ; RUN: llc < %s -march=x86 -mcpu=corei7 | FileCheck %s
1 ; RUN: opt -instsimplify %s -disable-output
2
3 ;CHECK: SHUFF0
4 define <8 x i32*> @SHUFF0(<4 x i32*> %ptrv) nounwind {
5 entry:
6 %G = shufflevector <4 x i32*> %ptrv, <4 x i32*> %ptrv, <8 x i32>
7 ;CHECK: pshufd
8 ret <8 x i32*> %G
9 ;CHECK: ret
10 }
11
12 ;CHECK: SHUFF1
13 define <4 x i32*> @SHUFF1(<4 x i32*> %ptrv) nounwind {
14 entry:
15 %G = shufflevector <4 x i32*> %ptrv, <4 x i32*> %ptrv, <4 x i32>
16 ;CHECK: pshufd
17 ret <4 x i32*> %G
18 ;CHECK: ret
19 }
20
21 ;CHECK: SHUFF3
22 define <4 x i8*> @SHUFF3(<4 x i8*> %ptrv) nounwind {
23 entry:
24 %G = shufflevector <4 x i8*> %ptrv, <4 x i8*> undef, <4 x i32>
25 ;CHECK: pshufd
26 ret <4 x i8*> %G
27 ;CHECK: ret
28 }
29
30 ;CHECK: LOAD0
31 define <4 x i8*> @LOAD0(<4 x i8*>* %p) nounwind {
32 entry:
33 %G = load <4 x i8*>* %p
34 ;CHECK: movaps
35 ret <4 x i8*> %G
36 ;CHECK: ret
37 }
38
39 ;CHECK: LOAD1
40 define <4 x i8*> @LOAD1(<4 x i8*>* %p) nounwind {
41 entry:
42 %G = load <4 x i8*>* %p
43 ;CHECK: movdqa
44 ;CHECK: pshufd
45 ;CHECK: movdqa
46 %T = shufflevector <4 x i8*> %G, <4 x i8*> %G, <4 x i32>
47 store <4 x i8*> %T, <4 x i8*>* %p
48 ret <4 x i8*> %G
49 ;CHECK: ret
50 }
51
52 ;CHECK: LOAD2
53 define <4 x i8*> @LOAD2(<4 x i8*>* %p) nounwind {
54 entry:
55 %I = alloca <4 x i8*>
56 ;CHECK: sub
57 %G = load <4 x i8*>* %p
58 ;CHECK: movaps
59 store <4 x i8*> %G, <4 x i8*>* %I
60 ;CHECK: movaps
61 %Z = load <4 x i8*>* %I
62 ret <4 x i8*> %Z
63 ;CHECK: add
64 ;CHECK: ret
65 }
66
67 ;CHECK: INT2PTR0
68 define <4 x i32> @INT2PTR0(<4 x i8*>* %p) nounwind {
69 entry:
70 %G = load <4 x i8*>* %p
71 ;CHECK: movl
72 ;CHECK: movaps
73 %K = ptrtoint <4 x i8*> %G to <4 x i32>
74 ;CHECK: ret
75 ret <4 x i32> %K
76 }
77
78 ;CHECK: INT2PTR1
79 define <4 x i32*> @INT2PTR1(<4 x i8>* %p) nounwind {
80 entry:
81 %G = load <4 x i8>* %p
82 ;CHECK: movl
83 ;CHECK: movd
84 ;CHECK: pshufb
85 ;CHECK: pand
86 %K = inttoptr <4 x i8> %G to <4 x i32*>
87 ;CHECK: ret
88 ret <4 x i32*> %K
89 }
90
91 ;CHECK: BITCAST0
92 define <4 x i32*> @BITCAST0(<4 x i8*>* %p) nounwind {
93 entry:
94 %G = load <4 x i8*>* %p
95 ;CHECK: movl
96 %T = bitcast <4 x i8*> %G to <4 x i32*>
97 ;CHECK: movaps
98 ;CHECK: ret
99 ret <4 x i32*> %T
100 }
101
102 ;CHECK: BITCAST1
103 define <2 x i32*> @BITCAST1(<2 x i8*>* %p) nounwind {
104 entry:
105 %G = load <2 x i8*>* %p
106 ;CHECK: movl
107 ;CHECK: movd
108 ;CHECK: pinsrd
109 %T = bitcast <2 x i8*> %G to <2 x i32*>
110 ;CHECK: ret
111 ret <2 x i32*> %T
112 }
113
114 ;CHECK: ICMP0
115 define <4 x i32> @ICMP0(<4 x i8*>* %p0, <4 x i8*>* %p1) nounwind {
116 entry:
117 %g0 = load <4 x i8*>* %p0
118 %g1 = load <4 x i8*>* %p1
119 %k = icmp sgt <4 x i8*> %g0, %g1
120 ;CHECK: pcmpgtd
121 %j = select <4 x i1> %k, <4 x i32> , <4 x i32>
122 ret <4 x i32> %j
123 ;CHECK: ret
124 }
125
126 ;CHECK: ICMP1
127 define <4 x i32> @ICMP1(<4 x i8*>* %p0, <4 x i8*>* %p1) nounwind {
128 entry:
129 %g0 = load <4 x i8*>* %p0
130 %g1 = load <4 x i8*>* %p1
131 %k = icmp eq <4 x i8*> %g0, %g1
132 ;CHECK: pcmpeqd
133 %j = select <4 x i1> %k, <4 x i32> , <4 x i32>
134 ret <4 x i32> %j
135 ;CHECK: ret
136 }
137
0 ; RUN: llc < %s -march=x86 -mcpu=corei7-avx | FileCheck %s
1 ; RUN: opt -instsimplify %s -disable-output
2
3 ;CHECK: AGEP0
4 define <4 x i32*> @AGEP0(i32* %ptr) nounwind {
5 entry:
6 %vecinit.i = insertelement <4 x i32*> undef, i32* %ptr, i32 0
7 %vecinit2.i = insertelement <4 x i32*> %vecinit.i, i32* %ptr, i32 1
8 %vecinit4.i = insertelement <4 x i32*> %vecinit2.i, i32* %ptr, i32 2
9 %vecinit6.i = insertelement <4 x i32*> %vecinit4.i, i32* %ptr, i32 3
10 ;CHECK: pslld
11 ;CHECK: padd
12 %A2 = getelementptr <4 x i32*> %vecinit6.i, <4 x i32>
13 ;CHECK: pslld
14 ;CHECK: padd
15 %A3 = getelementptr <4 x i32*> %A2, <4 x i32>
16 ret <4 x i32*> %A3
17 ;CHECK: ret
18 }
19
20 ;CHECK: AGEP1
21 define i32 @AGEP1(<4 x i32*> %param) nounwind {
22 entry:
23 ;CHECK: pslld
24 ;CHECK: padd
25 %A2 = getelementptr <4 x i32*> %param, <4 x i32>
26 %k = extractelement <4 x i32*> %A2, i32 3
27 %v = load i32* %k
28 ret i32 %v
29 ;CHECK: ret
30 }
31
32 ;CHECK: AGEP2
33 define i32 @AGEP2(<4 x i32*> %param, <4 x i32> %off) nounwind {
34 entry:
35 ;CHECK: pslld
36 ;CHECK: padd
37 %A2 = getelementptr <4 x i32*> %param, <4 x i32> %off
38 %k = extractelement <4 x i32*> %A2, i32 3
39 %v = load i32* %k
40 ret i32 %v
41 ;CHECK: ret
42 }
43
44 ;CHECK: AGEP3
45 define <4 x i32*> @AGEP3(<4 x i32*> %param, <4 x i32> %off) nounwind {
46 entry:
47 ;CHECK: pslld
48 ;CHECK: padd
49 %A2 = getelementptr <4 x i32*> %param, <4 x i32> %off
50 %v = alloca i32
51 %k = insertelement <4 x i32*> %A2, i32* %v, i32 3
52 ret <4 x i32*> %k
53 ;CHECK: ret
54 }
55
56 ;CHECK: AGEP4
57 define <4 x i8*> @AGEP4(<4 x i8*> %param, <4 x i32> %off) nounwind {
58 entry:
59 ;CHECK: pslld
60 ;CHECK: padd
61 %A = getelementptr <4 x i8*> %param, <4 x i32> %off
62 ret <4 x i8*> %A
63 ;CHECK: ret
64 }
65
66 ;CHECK: AGEP5
67 define <4 x i8*> @AGEP5(<4 x i8*> %param, <4 x i8> %off) nounwind {
68 entry:
69 ;CHECK: pslld
70 ;CHECK: padd
71 %A = getelementptr <4 x i8*> %param, <4 x i8> %off
72 ret <4 x i8*> %A
73 ;CHECK: ret
74 }
75
76
0 ; RUN: llvm-as %s -disable-output
1 @G = constant <3 x i64> ptrtoint (<3 x i8*> to <3 x i64>)
2
3 @G1 = global i8 zeroinitializer
4 @g = constant <2 x i8*> getelementptr (<2 x i8*> , <2 x i32> )
5
6 @t = constant <2 x i1> icmp ((<2 x i32> ptrtoint (<2 x i8*> zeroinitializer to <2 x i32>), <2 x i32> zeroinitializer )
7
0 ; RUN: opt -instcombine -S -o - %s | llvm-as
1 ; RUN: opt -instcombine -globalopt -S -o - %s | llvm-as
2 @G1 = global i32 zeroinitializer
3 @G2 = global i32 zeroinitializer
4 @g = global <2 x i32*> zeroinitializer
5 %0 = type { i32, void ()* }
6 @llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @test }]
7 define internal void @test() {
8 %A = insertelement <2 x i32*> undef, i32* @G1, i32 0
9 %B = insertelement <2 x i32*> %A, i32* @G2, i32 1
10 store <2 x i32*> %B, <2 x i32*>* @g
11 ret void
12 }
13
0 ; RUN: opt -instcombine %s -disable-output
1 ; RUN: opt -instsimplify %s -disable-output
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
4
5 @G1 = global i8 zeroinitializer
6
7 define <2 x i1> @test(<2 x i8*> %a, <2 x i8*> %b) {
8 %A = icmp eq <2 x i8*> %a, %b
9 ret <2 x i1> %A
10 }
11
12 define <2 x i1> @test2(<2 x i8*> %a) {
13 %A = inttoptr <2 x i32> to <2 x i8*>
14 %B = icmp ult <2 x i8*> %A, zeroinitializer
15 ret <2 x i1> %B
16 }
17
18 define <2 x i1> @test3(<2 x i8*> %a) {
19 %g = getelementptr <2 x i8*> %a, <2 x i32>
20 %B = icmp ult <2 x i8*> %g, zeroinitializer
21 ret <2 x i1> %B
22 }
23
24 define <1 x i1> @test4(<1 x i8*> %a) {
25 %g = getelementptr <1 x i8*> %a, <1 x i32>
26 %B = icmp ult <1 x i8*> %g, zeroinitializer
27 ret <1 x i1> %B
28 }
29
30 define <2 x i1> @test5(<2 x i8*> %a) {
31 %w = getelementptr <2 x i8*> %a, <2 x i32> zeroinitializer
32 %e = getelementptr <2 x i8*> %w, <2 x i32>
33 %g = getelementptr <2 x i8*> %e, <2 x i32>
34 %B = icmp ult <2 x i8*> %g, zeroinitializer
35 ret <2 x i1> %B
36 }
0 ;RUN: opt -instsimplify %s -disable-output
1 declare void @helper(<2 x i8*>)
2 define void @test(<2 x i8*> %a) {
3 %A = getelementptr <2 x i8*> %a, <2 x i32>
4 call void @helper(<2 x i8*> %A)
5 ret void
6 }
7
1212 #include "llvm/DerivedTypes.h"
1313 #include "llvm/LLVMContext.h"
1414 #include "llvm/ADT/STLExtras.h"
15 #include "llvm/Analysis/ValueTracking.h"
16 #include "llvm/Target/TargetData.h"
1517 #include "gtest/gtest.h"
1618
1719 namespace llvm {
128130 EXPECT_EQ(CastInst::SExt, CastInst::getCastOpcode(c8, true, V8x64Ty, true));
129131 }
130132
133
134
135 TEST(InstructionsTest, VectorGep) {
136 LLVMContext &C(getGlobalContext());
137
138 // Type Definitions
139 PointerType *Ptri8Ty = PointerType::get(IntegerType::get(C, 8), 0);
140 PointerType *Ptri32Ty = PointerType::get(IntegerType::get(C, 8), 0);
141
142 VectorType *V2xi8PTy = VectorType::get(Ptri8Ty, 2);
143 VectorType *V2xi32PTy = VectorType::get(Ptri32Ty, 2);
144
145 // Test different aspects of the vector-of-pointers type
146 // and GEPs which use this type.
147 ConstantInt *Ci32a = ConstantInt::get(C, APInt(32, 1492));
148 ConstantInt *Ci32b = ConstantInt::get(C, APInt(32, 1948));
149 std::vector ConstVa(2, Ci32a);
150 std::vector ConstVb(2, Ci32b);
151 Constant *C2xi32a = ConstantVector::get(ConstVa);
152 Constant *C2xi32b = ConstantVector::get(ConstVb);
153
154 CastInst *PtrVecA = new IntToPtrInst(C2xi32a, V2xi32PTy);
155 CastInst *PtrVecB = new IntToPtrInst(C2xi32b, V2xi32PTy);
156
157 ICmpInst *ICmp0 = new ICmpInst(ICmpInst::ICMP_SGT, PtrVecA, PtrVecB);
158 ICmpInst *ICmp1 = new ICmpInst(ICmpInst::ICMP_ULT, PtrVecA, PtrVecB);
159 EXPECT_NE(ICmp0, ICmp1); // suppress warning.
160
161 GetElementPtrInst *Gep0 = GetElementPtrInst::Create(PtrVecA, C2xi32a);
162 GetElementPtrInst *Gep1 = GetElementPtrInst::Create(PtrVecA, C2xi32b);
163 GetElementPtrInst *Gep2 = GetElementPtrInst::Create(PtrVecB, C2xi32a);
164 GetElementPtrInst *Gep3 = GetElementPtrInst::Create(PtrVecB, C2xi32b);
165
166 CastInst *BTC0 = new BitCastInst(Gep0, V2xi8PTy);
167 CastInst *BTC1 = new BitCastInst(Gep1, V2xi8PTy);
168 CastInst *BTC2 = new BitCastInst(Gep2, V2xi8PTy);
169 CastInst *BTC3 = new BitCastInst(Gep3, V2xi8PTy);
170
171 Value *S0 = BTC0->stripPointerCasts();
172 Value *S1 = BTC1->stripPointerCasts();
173 Value *S2 = BTC2->stripPointerCasts();
174 Value *S3 = BTC3->stripPointerCasts();
175
176 EXPECT_NE(S0, Gep0);
177 EXPECT_NE(S1, Gep1);
178 EXPECT_NE(S2, Gep2);
179 EXPECT_NE(S3, Gep3);
180
181 int64_t Offset;
182 TargetData TD("e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3"
183 "2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80"
184 ":128:128-n8:16:32:64-S128");
185 // Make sure we don't crash
186 GetPointerBaseWithConstantOffset(Gep0, Offset, TD);
187 GetPointerBaseWithConstantOffset(Gep1, Offset, TD);
188 GetPointerBaseWithConstantOffset(Gep2, Offset, TD);
189 GetPointerBaseWithConstantOffset(Gep3, Offset, TD);
190
191 // Gep of Geps
192 GetElementPtrInst *GepII0 = GetElementPtrInst::Create(Gep0, C2xi32b);
193 GetElementPtrInst *GepII1 = GetElementPtrInst::Create(Gep1, C2xi32a);
194 GetElementPtrInst *GepII2 = GetElementPtrInst::Create(Gep2, C2xi32b);
195 GetElementPtrInst *GepII3 = GetElementPtrInst::Create(Gep3, C2xi32a);
196
197 EXPECT_EQ(GepII0->getNumIndices(), 1u);
198 EXPECT_EQ(GepII1->getNumIndices(), 1u);
199 EXPECT_EQ(GepII2->getNumIndices(), 1u);
200 EXPECT_EQ(GepII3->getNumIndices(), 1u);
201
202 EXPECT_FALSE(GepII0->hasAllZeroIndices());
203 EXPECT_FALSE(GepII1->hasAllZeroIndices());
204 EXPECT_FALSE(GepII2->hasAllZeroIndices());
205 EXPECT_FALSE(GepII3->hasAllZeroIndices());
206
207 delete GepII0;
208 delete GepII1;
209 delete GepII2;
210 delete GepII3;
211
212 delete BTC0;
213 delete BTC1;
214 delete BTC2;
215 delete BTC3;
216
217 delete Gep0;
218 delete Gep1;
219 delete Gep2;
220 delete Gep3;
221
222 delete ICmp0;
223 delete ICmp1;
224 delete PtrVecA;
225 delete PtrVecB;
226 }
227
131228 } // end anonymous namespace
132229 } // end namespace llvm