> + // 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. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits