[llvm-commits] [llvm] r122548 - in /llvm/trunk: lib/Transforms/Scalar/MemCpyOptimizer.cpp test/Transforms/MemCpyOpt/memcpy-to-memset.ll
Duncan Sands
baldrick at free.fr
Sun Dec 26 03:53:40 PST 2010
Hi Benjamin,
> @@ -38,6 +40,13 @@
> /// i16 0xF0F0, double 0.0 etc. If the value can't be handled with a repeated
> /// byte store (e.g. i16 0x1234), return null.
> static Value *isBytewiseValue(Value *V) {
> + // Look through constant globals.
> + if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
> + if (GV->mayBeOverridden() || !GV->isConstant() || !GV->hasInitializer())
> + return 0;
this test could be simplified using GV->hasDefinitiveInitializer().
Ciao, Duncan.
More information about the llvm-commits
mailing list