[llvm-commits] [llvm] r126124 - in /llvm/trunk: lib/Transforms/Utils/Local.cpp unittests/Transforms/Utils/Local.cpp
Duncan Sands
baldrick at free.fr
Mon Feb 21 23:43:33 PST 2011
Hi Nick,
>> - if (PHINode *IP = dyn_cast<PHINode>(I))
>> - if (!PHIs.insert(IP)) {
>> - // Break the cycle and delete the PHI and its operands.
>> - IP->replaceAllUsesWith(UndefValue::get(IP->getType()));
>> - (void)RecursivelyDeleteTriviallyDeadInstructions(IP);
>> - Changed = true;
>> - break;
>> - }
>> - return Changed;
>> + if (!Visited.insert(I)) {
>> + // Break the cycle and delete the instruction and its operands.
>> + I->replaceAllUsesWith(UndefValue::get(I->getType()));
>> + return RecursivelyDeleteTriviallyDeadInstructions(I);
>
> return RecursivelyDeleteTriviallyDeadInstructions(I) || Changed; ?
I changed this to unconditionally return true shortly afterwards.
Note that the RAUW always makes a change because I is known to have at
least one use at this point.
Ciao, Duncan.
More information about the llvm-commits
mailing list