mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
reduce indentation by using early exits, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62350 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
99ec3538b8
commit
1b8eaf5109
@ -11145,10 +11145,14 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) {
|
|||||||
Value *CastOp = CI->getOperand(0);
|
Value *CastOp = CI->getOperand(0);
|
||||||
|
|
||||||
const Type *DestPTy = cast<PointerType>(CI->getType())->getElementType();
|
const Type *DestPTy = cast<PointerType>(CI->getType())->getElementType();
|
||||||
if (const PointerType *SrcTy = dyn_cast<PointerType>(CastOp->getType())) {
|
const PointerType *SrcTy = dyn_cast<PointerType>(CastOp->getType());
|
||||||
|
if (SrcTy == 0) return 0;
|
||||||
|
|
||||||
const Type *SrcPTy = SrcTy->getElementType();
|
const Type *SrcPTy = SrcTy->getElementType();
|
||||||
|
|
||||||
if (DestPTy->isInteger() || isa<PointerType>(DestPTy)) {
|
if (!DestPTy->isInteger() && !isa<PointerType>(DestPTy))
|
||||||
|
return 0;
|
||||||
|
|
||||||
// If the source is an array, the code below will not succeed. Check to
|
// If the source is an array, the code below will not succeed. Check to
|
||||||
// see if a trivial 'gep P, 0, 0' will help matters. Only do this for
|
// see if a trivial 'gep P, 0, 0' will help matters. Only do this for
|
||||||
// constants.
|
// constants.
|
||||||
@ -11162,9 +11166,12 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) {
|
|||||||
SrcPTy = SrcTy->getElementType();
|
SrcPTy = SrcTy->getElementType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((SrcPTy->isInteger() || isa<PointerType>(SrcPTy)) &&
|
if (!SrcPTy->isInteger() && !isa<PointerType>(SrcPTy))
|
||||||
IC.getTargetData().getTypeSizeInBits(SrcPTy) ==
|
return 0;
|
||||||
IC.getTargetData().getTypeSizeInBits(DestPTy)) {
|
|
||||||
|
if (IC.getTargetData().getTypeSizeInBits(SrcPTy) !=
|
||||||
|
IC.getTargetData().getTypeSizeInBits(DestPTy))
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Okay, we are casting from one integer or pointer type to another of
|
// Okay, we are casting from one integer or pointer type to another of
|
||||||
// the same size. Instead of casting the pointer before
|
// the same size. Instead of casting the pointer before
|
||||||
@ -11189,10 +11196,6 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) {
|
|||||||
SI);
|
SI);
|
||||||
return new StoreInst(NewCast, CastOp);
|
return new StoreInst(NewCast, CastOp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// equivalentAddressValues - Test if A and B will obviously have the same
|
/// equivalentAddressValues - Test if A and B will obviously have the same
|
||||||
/// value. This includes recognizing that %t0 and %t1 will have the same
|
/// value. This includes recognizing that %t0 and %t1 will have the same
|
||||||
|
Loading…
x
Reference in New Issue
Block a user