mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-16 14:26:17 +00:00
Use type helper functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user