[llvm-commits] [llvm] r42075 - in /llvm/trunk: lib/Transforms/Scalar/LICM.cpp test/Transforms/LICM/2007-09-17-PrompteValue.ll
Dan Gohman
djg at cray.com
Tue Sep 18 07:02:12 PDT 2007
> + // If GEP base is NULL then the calculated address used by Store or
> + // Load instruction is invalid. Do not promote this value because
> + // it may expose load and store instruction that are covered by
> + // condition which may not yet folded.
> + if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V))
> + if (isa<ConstantPointerNull>(GEP->getOperand(0)))
> + PointerOk = false;
> +
It looks like there's a larger problem here. The testcase's loop body
may never be executed, so it isn't safe for LICM to hoist/sink
anything out to an unguarded location, null pointer constants or
otherwise.
Dan
--
Dan Gohman, Cray Inc.
More information about the llvm-commits
mailing list