cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107972 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif 2010-07-09 15:01:36 +00:00
parent 1d3ae029c4
commit fc36c0f21f

View File

@ -715,9 +715,10 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
static bool IsOnlyNullComparedAndFreed(const Value &V) {
for (Value::const_use_iterator UI = V.use_begin(), UE = V.use_end();
UI != UE; ++UI) {
if (isFreeCall(*UI))
const User *U = *UI;
if (isFreeCall(U))
continue;
if (const ICmpInst *ICI = dyn_cast<ICmpInst>(*UI))
if (const ICmpInst *ICI = dyn_cast<ICmpInst>(U))
if (ICI->isEquality() && isa<ConstantPointerNull>(ICI->getOperand(1)))
continue;
return false;