[llvm] r194347 - Use type form of getIntPtrType.
Matt Arsenault
Matthew.Arsenault at amd.com
Sat Nov 9 20:46:57 PST 2013
Author: arsenm
Date: Sat Nov 9 22:46:57 2013
New Revision: 194347
URL: http://llvm.org/viewvc/llvm-project?rev=194347&view=rev
Log:
Use type form of getIntPtrType.
This should be inconsequential and is work
towards removing the default address space
arguments.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=194347&r1=194346&r2=194347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Sat Nov 9 22:46:57 2013
@@ -417,7 +417,7 @@ void AsmPrinter::EmitGlobalVariable(cons
// - __tlv_bootstrap - used to make sure support exists
// - spare pointer, used when mapped by the runtime
// - pointer to mangled symbol above with initializer
- unsigned PtrSize = DL->getPointerSizeInBits()/8;
+ unsigned PtrSize = DL->getPointerTypeSize(GV->getType());
OutStreamer.EmitSymbolValue(GetExternalSymbolSymbol("_tlv_bootstrap"),
PtrSize);
OutStreamer.EmitIntValue(0, PtrSize);
Modified: llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp?rev=194347&r1=194346&r2=194347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp Sat Nov 9 22:46:57 2013
@@ -485,11 +485,12 @@ void IntrinsicLowering::LowerIntrinsicCa
break;
}
case Intrinsic::memset: {
- Type *IntPtr = TD.getIntPtrType(Context);
+ Value *Op0 = CI->getArgOperand(0);
+ Type *IntPtr = TD.getIntPtrType(Op0->getType());
Value *Size = Builder.CreateIntCast(CI->getArgOperand(2), IntPtr,
/* isSigned */ false);
Value *Ops[3];
- Ops[0] = CI->getArgOperand(0);
+ Ops[0] = Op0;
// Extend the amount to i32.
Ops[1] = Builder.CreateIntCast(CI->getArgOperand(1),
Type::getInt32Ty(Context),
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp?rev=194347&r1=194346&r2=194347&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp Sat Nov 9 22:46:57 2013
@@ -1047,7 +1047,7 @@ struct MemSetOpt : public LibCallOptimiz
if (FT->getNumParams() != 3 || FT->getReturnType() != FT->getParamType(0) ||
!FT->getParamType(0)->isPointerTy() ||
!FT->getParamType(1)->isIntegerTy() ||
- FT->getParamType(2) != TD->getIntPtrType(*Context))
+ FT->getParamType(2) != TD->getIntPtrType(FT->getParamType(0)))
return 0;
// memset(p, v, n) -> llvm.memset(p, v, n, 1)
More information about the llvm-commits
mailing list