[llvm-commits] [llvm] r166591 - in /llvm/trunk: examples/ExceptionDemo/ExceptionDemo.cpp include/llvm/Type.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp lib/Transforms/Instrumentation/GCOVProfiling.c
Rafael EspĂndola
rafael.espindola at gmail.com
Wed Oct 24 12:16:01 PDT 2012
On 24 October 2012 13:20, Micah Villmow <villmow at gmail.com> wrote:
> Author: mvillmow
> Date: Wed Oct 24 12:20:04 2012
> New Revision: 166591
>
> URL: http://llvm.org/viewvc/llvm-project?rev=166591&view=rev
> Log:
> Delete a directory that wasn't supposed to be checked in yet.
The patch does quiet a bit more than that :-)
> Removed:
> llvm/trunk/test/Other/AddressSpace/
> Modified:
> llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp
> llvm/trunk/include/llvm/Type.h
> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
> llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
> llvm/trunk/lib/Transforms/Instrumentation/ProfilingUtils.cpp
> llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
> llvm/trunk/lib/Transforms/Scalar/SROA.cpp
> llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
> llvm/trunk/lib/VMCore/Constants.cpp
> llvm/trunk/lib/VMCore/Type.cpp
> llvm/trunk/lib/VMCore/Verifier.cpp
>
> Modified: llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp (original)
> +++ llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp Wed Oct 24 12:20:04 2012
> @@ -1268,7 +1268,7 @@
> llvm::Value *unwindExceptionClass =
> builder.CreateLoad(builder.CreateStructGEP(
> builder.CreatePointerCast(unwindException,
> - ourUnwindExceptionType->getPointerTo()),
> + ourUnwindExceptionType->getPointerTo(0)),
> 0));
>
> // Branch to the externalExceptionBlock if the exception is foreign or
>
> Modified: llvm/trunk/include/llvm/Type.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Type.h?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Type.h (original)
> +++ llvm/trunk/include/llvm/Type.h Wed Oct 24 12:20:04 2012
> @@ -389,10 +389,16 @@
> static PointerType *getInt32PtrTy(LLVMContext &C, unsigned AS = 0);
> static PointerType *getInt64PtrTy(LLVMContext &C, unsigned AS = 0);
>
> - /// getPointerTo - Return a pointer to the current type. This is equivalent
> - /// to PointerType::get(Foo, AddrSpace).
> - PointerType *getPointerTo(unsigned AddrSpace = 0);
> + /// getPointerTo - Return a pointer to the current type for the given address space.
> + /// This is equivalent to PointerType::get(Foo, AddrSpace).
> + PointerType *getPointerTo(unsigned AddrSpace);
> +
> + /// getPointerTo - Return a pointer to the current type for the address space
> + /// space of the passed in type.
> + PointerType *getPointerTo(const Type *Ty);
>
> + /// getPointerTo - Retrun a pointer to the current type.
> + PointerType *getPointerTo();
> private:
> /// isSizedDerivedType - Derived types like structures and arrays are sized
> /// iff all of the members of the type are sized as well. Since asking for
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Oct 24 12:20:04 2012
> @@ -2068,7 +2068,7 @@
> // Also pass the return address of the remainder.
> SDValue FIPtr = DAG.CreateStackTemporary(RetVT);
> Entry.Node = FIPtr;
> - Entry.Ty = RetTy->getPointerTo();
> + Entry.Ty = RetTy->getPointerTo(0);
> Entry.isSExt = isSigned;
> Entry.isZExt = !isSigned;
> Args.push_back(Entry);
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Oct 24 12:20:04 2012
> @@ -2320,7 +2320,7 @@
>
> // Also pass the address of the overflow check.
> Entry.Node = Temp;
> - Entry.Ty = PtrTy->getPointerTo();
> + Entry.Ty = PtrTy->getPointerTo(0);
> Entry.isSExt = true;
> Entry.isZExt = false;
> Args.push_back(Entry);
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Wed Oct 24 12:20:04 2012
> @@ -586,8 +586,8 @@
> Type *Int32Ty = Type::getInt32Ty(*Ctx);
> Type *Int64Ty = Type::getInt64Ty(*Ctx);
> Type *Args[] = {
> - Int32Ty->getPointerTo(), // uint32_t *predecessor
> - Int64Ty->getPointerTo()->getPointerTo() // uint64_t **counters
> + Int32Ty->getPointerTo(Int32Ty), // uint32_t *predecessor
> + Int64Ty->getPointerTo(Int64Ty)->getPointerTo(Int64Ty) // uint64_t **counters
> };
> FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Ctx), Args, false);
> return M->getOrInsertFunction("__llvm_gcov_indirect_counter_increment", FTy);
> @@ -733,7 +733,8 @@
> Value *GEP = Builder.CreateGEP(Arg, ZExtPred);
> Value *Counter = Builder.CreateLoad(GEP, "counter");
> Cond = Builder.CreateICmpEQ(Counter,
> - Constant::getNullValue(Int64Ty->getPointerTo()));
> + Constant::getNullValue(
> + Int64Ty->getPointerTo(Counter->getType())));
> Builder.CreateCondBr(Cond, Exit, CounterEnd);
>
> // ++*counter;
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/ProfilingUtils.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ProfilingUtils.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/ProfilingUtils.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/ProfilingUtils.cpp Wed Oct 24 12:20:04 2012
> @@ -134,7 +134,8 @@
> // types.
> Type *GlobalDtorElems[2] = {
> Type::getInt32Ty(Mod->getContext()),
> - FunctionType::get(Type::getVoidTy(Mod->getContext()), false)->getPointerTo()
> + FunctionType::get(Type::getVoidTy(Mod->getContext()), false)
> + ->getPointerTo()
> };
> StructType *GlobalDtorElemTy =
> StructType::get(Mod->getContext(), GlobalDtorElems, false);
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp Wed Oct 24 12:20:04 2012
> @@ -375,7 +375,7 @@
> const size_t ByteSize = 1 << Idx;
> const size_t BitSize = ByteSize * 8;
> Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize);
> - Type *PtrTy = Ty->getPointerTo();
> + Type *PtrTy = Ty->getPointerTo(Addr->getType());
> Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
> createOrdering(&IRB, LI->getOrdering())};
> CallInst *C = CallInst::Create(TsanAtomicLoad[Idx],
> @@ -390,7 +390,7 @@
> const size_t ByteSize = 1 << Idx;
> const size_t BitSize = ByteSize * 8;
> Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize);
> - Type *PtrTy = Ty->getPointerTo();
> + Type *PtrTy = Ty->getPointerTo(Addr->getType());
> Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
> IRB.CreateIntCast(SI->getValueOperand(), Ty, false),
> createOrdering(&IRB, SI->getOrdering())};
>
> Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Wed Oct 24 12:20:04 2012
> @@ -2763,9 +2763,9 @@
> : II.getRawDest()->getType();
> if (!EmitMemCpy) {
> if (IsVectorElement)
> - OtherPtrTy = VecTy->getElementType()->getPointerTo();
> + OtherPtrTy = VecTy->getElementType()->getPointerTo(OtherPtrTy);
> else if (IntTy && !IsWholeAlloca)
> - OtherPtrTy = SubIntTy->getPointerTo();
> + OtherPtrTy = SubIntTy->getPointerTo(OtherPtrTy);
> else
> OtherPtrTy = NewAI.getType();
> }
>
> Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
> +++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Wed Oct 24 12:20:04 2012
> @@ -777,7 +777,7 @@
> GetElementPtrInst *Gep2 = cast<GetElementPtrInst>(Gep->clone());
> Gep2->setOperand(NumOperands - 1, LastIndex);
> Ptr = Builder.Insert(Gep2);
> - Ptr = Builder.CreateBitCast(Ptr, StTy->getPointerTo());
> + Ptr = Builder.CreateBitCast(Ptr, StTy->getPointerTo(Ptr->getType()));
> Value *Val = getVectorValue(SI->getValueOperand());
> Builder.CreateStore(Val, Ptr)->setAlignment(Alignment);
> break;
> @@ -806,7 +806,7 @@
> GetElementPtrInst *Gep2 = cast<GetElementPtrInst>(Gep->clone());
> Gep2->setOperand(NumOperands - 1, LastIndex);
> Ptr = Builder.Insert(Gep2);
> - Ptr = Builder.CreateBitCast(Ptr, RetTy->getPointerTo());
> + Ptr = Builder.CreateBitCast(Ptr, RetTy->getPointerTo(Ptr->getType()));
> LI = Builder.CreateLoad(Ptr);
> LI->setAlignment(Alignment);
> // Use this vector value for all users of the load.
>
> Modified: llvm/trunk/lib/VMCore/Constants.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/VMCore/Constants.cpp (original)
> +++ llvm/trunk/lib/VMCore/Constants.cpp Wed Oct 24 12:20:04 2012
> @@ -1673,7 +1673,7 @@
> // Note that a non-inbounds gep is used, as null isn't within any object.
> Type *AligningTy =
> StructType::get(Type::getInt1Ty(Ty->getContext()), Ty, NULL);
> - Constant *NullPtr = Constant::getNullValue(AligningTy->getPointerTo());
> + Constant *NullPtr = Constant::getNullValue(AligningTy->getPointerTo(Ty));
> Constant *Zero = ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0);
> Constant *One = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1);
> Constant *Indices[2] = { Zero, One };
>
> Modified: llvm/trunk/lib/VMCore/Type.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/VMCore/Type.cpp (original)
> +++ llvm/trunk/lib/VMCore/Type.cpp Wed Oct 24 12:20:04 2012
> @@ -779,6 +779,28 @@
> return PointerType::get(this, addrs);
> }
>
> +PointerType *Type::getPointerTo(const Type *Ty) {
> + unsigned AS = 0;
> + // For pointers, we return a new pointer based on the address space.
> + if (Ty->isPointerTy()) AS = Ty->getPointerAddressSpace();
> + // For vector of pointers, we return a new pointer based on the
> + // address space of the element pointer type.
> + if (Ty->isVectorTy())
> + AS = Ty->getVectorElementType()->getPointerAddressSpace();
> + // Otherwise return a pointer based on the default address space
> + // since we want a pointer to the current type without having
> + // a type that can give us the correct address space.
> + // An example of this occuring is that you want to get a pointer to
> + // all of the arguments in a function. However, the PointerType
> + // for a non-pointer type cannot be determined by the type, so
> + // the default value is used.
> + return getPointerTo(AS);
> +}
> +
> +PointerType *Type::getPointerTo() {
> + return getPointerTo(this);
> +}
> +
> bool PointerType::isValidElementType(Type *ElemTy) {
> return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
> !ElemTy->isMetadataTy();
>
> Modified: llvm/trunk/lib/VMCore/Verifier.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=166591&r1=166590&r2=166591&view=diff
> ==============================================================================
> --- llvm/trunk/lib/VMCore/Verifier.cpp (original)
> +++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Oct 24 12:20:04 2012
> @@ -434,7 +434,8 @@
> if (ArrayType *ATy = dyn_cast<ArrayType>(GV.getType())) {
> StructType *STy = dyn_cast<StructType>(ATy->getElementType());
> PointerType *FuncPtrTy =
> - FunctionType::get(Type::getVoidTy(*Context), false)->getPointerTo();
> + FunctionType::get(Type::getVoidTy(*Context), false)
> + ->getPointerTo(GV.getType());
> Assert1(STy && STy->getNumElements() == 2 &&
> STy->getTypeAtIndex(0u)->isIntegerTy(32) &&
> STy->getTypeAtIndex(1) == FuncPtrTy,
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list