Revert r235451 since it is attached to a wrong Differential Revision. Sorry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Wei Mi
2015-04-21 22:56:09 +00:00
parent 73a5fa9ad6
commit 480fc70c43
4 changed files with 22 additions and 55 deletions

View File

@@ -1467,11 +1467,6 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
// normalized.
if (SO1->getType() != GO1->getType())
return nullptr;
// Only do the combine when GO1 and SO1 are both constants. Only in
// this case, we are sure the cost after the merge is never more than
// that before the merge.
if (!isa<Constant>(GO1) || !isa<Constant>(SO1))
return nullptr;
Sum = Builder->CreateAdd(SO1, GO1, PtrOp->getName()+".sum");
}