diff options
| author | Eric Christopher <echristo@apple.com> | 2010-03-06 03:11:35 +0000 | 
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2010-03-06 03:11:35 +0000 | 
| commit | 75f0d6953a8492ec21f3b82489090a1152f1f516 (patch) | |
| tree | a8c459581e7bf09312a656ecdc31d11b4e4061cb | |
| parent | 621e06f9dfef66fdd65218c8bdc8936cc1d734e3 (diff) | |
| download | external_llvm-75f0d6953a8492ec21f3b82489090a1152f1f516.zip external_llvm-75f0d6953a8492ec21f3b82489090a1152f1f516.tar.gz external_llvm-75f0d6953a8492ec21f3b82489090a1152f1f516.tar.bz2 | |
Temporarily revert:
Log:
Transform @llvm.objectsize to integer if the argument is a result of malloc of known size.
Modified:
   llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
   llvm/trunk/test/Transforms/InstCombine/objsize.ll
It appears to be causing swb and nightly test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97866 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 10 | ||||
| -rw-r--r-- | test/Transforms/InstCombine/objsize.ll | 16 | 
2 files changed, 0 insertions, 26 deletions
| diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index 85c3895..a241f16 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -336,16 +336,6 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {          }          return ReplaceInstUsesWith(CI, ConstantInt::get(ReturnTy, AllocaSize));        } -    } else if (CallInst *MI = extractMallocCall(Op1)) { -      const Type* MallocType = getMallocAllocatedType(MI); -      // Get alloca size. -      if (MallocType->isSized()) { -        if (Value *NElems = getMallocArraySize(MI, TD, true)) { -          if (ConstantInt *NElements = dyn_cast<ConstantInt>(NElems)) -        return ReplaceInstUsesWith(CI, ConstantInt::get(ReturnTy, -               (NElements->getZExtValue() * TD->getTypeAllocSize(MallocType)))); -        } -      }      } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Op1)) {              // Only handle constant GEPs here.        if (CE->getOpcode() != Instruction::GetElementPtr) break; diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index 8bbfa8f..bf1a37f 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/test/Transforms/InstCombine/objsize.ll @@ -118,24 +118,8 @@ entry:    ret i32 0  } -@s = external global i8* - -define void @test5(i32 %n) nounwind ssp { -; CHECK: @test5 -entry: -  %0 = tail call noalias i8* @malloc(i32 20) nounwind -  %1 = tail call i32 @llvm.objectsize.i32(i8* %0, i1 false) -  %2 = load i8** @s, align 8 -; CHECK-NOT: @llvm.objectsize -; CHECK: @__memcpy_chk(i8* %0, i8* %1, i32 10, i32 20) -  %3 = tail call i8* @__memcpy_chk(i8* %0, i8* %2, i32 10, i32 %1) nounwind -  ret void -} -  declare i8* @__memset_chk(i8*, i32, i64, i64) nounwind -declare noalias i8* @malloc(i32) nounwind -  declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly  declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly | 
