diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-27 22:18:51 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-27 22:18:51 +0000 |
| commit | fa25272db99c986f89dc8a856b2ce5ef6caba5d3 (patch) | |
| tree | 628d13f4ec8d649416185da97aaf319bd451c0ae | |
| parent | ff1b7ef31b35f777959cfbd18f515cad9a9c94cf (diff) | |
| download | bcm5719-llvm-fa25272db99c986f89dc8a856b2ce5ef6caba5d3.tar.gz bcm5719-llvm-fa25272db99c986f89dc8a856b2ce5ef6caba5d3.zip | |
Use type helper functions
llvm-svn: 191574
| -rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 9de5b22e1d1..bf929690ae7 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -313,8 +313,7 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, } // Don't attempt to analyze GEPs over unsized objects. - if (!cast<PointerType>(GEPOp->getOperand(0)->getType()) - ->getElementType()->isSized()) + if (!GEPOp->getOperand(0)->getType()->getPointerElementType()->isSized()) return V; // If we are lacking DataLayout information, we can't compute the offets of @@ -354,7 +353,7 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, // If the integer type is smaller than the pointer size, it is implicitly // sign extended to pointer size. - unsigned Width = cast<IntegerType>(Index->getType())->getBitWidth(); + unsigned Width = Index->getType()->getIntegerBitWidth(); if (TD->getPointerSizeInBits() > Width) Extension = EK_SignExt; diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index beb63e8d53d..0cd7b149d42 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1057,7 +1057,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { if (ParamPTy == 0 || !ParamPTy->getElementType()->isSized() || TD == 0) return false; - Type *CurElTy = cast<PointerType>(ActTy)->getElementType(); + Type *CurElTy = ActTy->getPointerElementType(); if (TD->getTypeAllocSize(CurElTy) != TD->getTypeAllocSize(ParamPTy->getElementType())) return false; diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 2c292ce29d0..402f8c33029 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -1782,8 +1782,7 @@ Instruction *InstCombiner::visitICmpInstWithCastAndCast(ICmpInst &ICI) { // Turn icmp (ptrtoint x), (ptrtoint/c) into a compare of the input if the // integer type is the same size as the pointer type. if (TD && LHSCI->getOpcode() == Instruction::PtrToInt && - TD->getPointerSizeInBits() == - cast<IntegerType>(DestTy)->getBitWidth()) { + TD->getPointerSizeInBits() == DestTy->getIntegerBitWidth()) { Value *RHSOp = 0; if (Constant *RHSC = dyn_cast<Constant>(ICI.getOperand(1))) { RHSOp = ConstantExpr::getIntToPtr(RHSC, SrcTy); |

