Revert r133285. Causing odd failures on Dragonegg.

llvm-svn: 133301
This commit is contained in:
Chad Rosier 2011-06-17 22:08:25 +00:00
parent 0c07bee8bd
commit c76b9d8c2f
1 changed files with 5 additions and 4 deletions

View File

@ -29,10 +29,6 @@ static Value *DecomposeSimpleLinearExpr(Value *Val, unsigned &Scale,
return ConstantInt::get(Val->getType(), 0);
}
// Insist that the amount-to-allocate not overflow.
OverflowingBinaryOperator *OBI = dyn_cast<OverflowingBinaryOperator>(Val);
if (OBI && !OBI->hasNoUnsignedWrap()) return 0;
if (BinaryOperator *I = dyn_cast<BinaryOperator>(Val)) {
if (ConstantInt *RHS = dyn_cast<ConstantInt>(I->getOperand(1))) {
if (I->getOpcode() == Instruction::Shl) {
@ -75,6 +71,11 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
// This requires TargetData to get the alloca alignment and size information.
if (!TD) return 0;
// Insist that the amount-to-allocate not overflow.
OverflowingBinaryOperator *OBI =
dyn_cast<OverflowingBinaryOperator>(AI.getOperand(0));
if (OBI && !(OBI->hasNoSignedWrap() || OBI->hasNoUnsignedWrap())) return 0;
const PointerType *PTy = cast<PointerType>(CI.getType());
BuilderTy AllocaBuilder(*Builder);