1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Remove a condition which is always true.

llvm-svn: 67089
This commit is contained in:
Chris Lattner 2009-03-17 17:55:15 +00:00
parent 3e355f6c0d
commit 43ae27a75e

View File

@ -7533,7 +7533,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
if (isa<ConstantInt>(NumElements))
Amt = Multiply(cast<ConstantInt>(NumElements), cast<ConstantInt>(Amt));
// otherwise multiply the amount and the number of elements
else if (Scale != 1) {
else {
Instruction *Tmp = BinaryOperator::CreateMul(Amt, NumElements, "tmp");
Amt = InsertNewInstBefore(Tmp, AI);
}
@ -10979,8 +10979,8 @@ Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) {
if (isa<AllocaInst>(AI) && AI.getAllocatedType()->isSized()) {
// If alloca'ing a zero byte object, replace the alloca with a null pointer.
// Note that we only do this for alloca's, because malloc should allocate and
// return a unique pointer, even for a zero byte allocation.
// Note that we only do this for alloca's, because malloc should allocate
// and return a unique pointer, even for a zero byte allocation.
if (TD->getTypePaddedSize(AI.getAllocatedType()) == 0)
return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));