[llvm-commits] [llvm] r126077 - in /llvm/trunk: lib/Transforms/Utils/Local.cpp test/Transforms/LoopStrengthReduce/pr2570.ll unittests/Transforms/Utils/Local.cpp

Duncan Sands baldrick at free.fr
Sun Feb 20 01:08:36 PST 2011


Hi Nick,

> -bool
> -llvm::RecursivelyDeleteDeadPHINode(PHINode *PN) {
> +bool llvm::RecursivelyDeleteDeadPHINode(PHINode *PN) {
>     // We can remove a PHI if it is on a cycle in the def-use graph
>     // where each node in the cycle has degree one, i.e. only one use,
>     // and is an instruction with no side effects.
> -  if (!PN->hasOneUse())
> +  if (!areAllUsesEqual(PN))
>       return false;

I know that it is not the fault of this patch, but it looks like
RecursivelyDeleteDeadPHINode will not delete phi nodes that have no uses.
Isn't that silly?

Ciao, Duncan.



More information about the llvm-commits mailing list