[llvm-commits] [llvm] r122715 - in /llvm/trunk: lib/Transforms/Scalar/EarlyCSE.cpp test/Transforms/EarlyCSE/ test/Transforms/EarlyCSE/basic.ll test/Transforms/EarlyCSE/dg.exp

Dan Gohman gohman at apple.com
Mon Jan 3 15:15:21 PST 2011


On Jan 2, 2011, at 3:04 PM, Chris Lattner wrote:
> 
> +    // See if the instruction has an available value.  If so, use it.
> +    if (Instruction *V = AvailableValues->lookup(InstValue::get(Inst))) {
> +      Inst->replaceAllUsesWith(V);
> +      Inst->eraseFromParent();
> +      Changed = true;
> +      continue;
> +    }

Hi Chris,

Since optional flags such as nsw, inbounds, etc. are not currently being hashed,
this code could replace a value with another value with a proper superset of
flags, which is not valid in general. One way to fix this would be to call
intersectOptionalDataWith here.

Dan





More information about the llvm-commits mailing list