[llvm-commits] [llvm] r53032 - in /llvm/trunk: lib/Analysis/MemoryDependenceAnalysis.cpp lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/2008-07-02-Unreachable.ll

Chris Lattner clattner at apple.com
Wed Jul 2 11:04:20 PDT 2008


On Jul 2, 2008, at 10:20 AM, Owen Anderson wrote:

> Author: resistor
> Date: Wed Jul  2 12:20:16 2008
> New Revision: 53032
>
> URL: http://llvm.org/viewvc/llvm-project?rev=53032&view=rev
> Log:
> A better fix for PR2503 that doesn't pessimize GVN in the presence  
> of unreachable blocks.

Cool.

> +  if (!getAnalysis<DominatorTree>().isReachableFromEntry(BB)) {
> +    Phis[BB] = UndefValue::get(orig->getType());
> +    return UndefValue::get(orig->getType());

how about:

  return Phis[BB] = UndefValue::get(orig->getType());

To avoid the redundant call?

-Chris




More information about the llvm-commits mailing list