[llvm-commits] [Review request] Recursively delete trivially dead conditions of constant folded terminators.

Chris Lattner clattner at apple.com
Sat May 21 21:05:59 PDT 2011


Looks great to me, please commit Frits, thanks!

On Mar 9, 2011, at 2:39 PM, Frits van Bommel wrote:

> The attached patch adds a parameter to ConstantFoldTerminator() that
> callers can use to ask it to also clean up the condition of any
> conditional terminator it folds to be unconditional, if that turns the
> condition into dead code. This just means it calls
> RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It
> defaults to the old behavior.
> 
> I also changed -simplifycfg and -jump-threading to use this to produce
> slightly better code without any extra cleanup passes (AFAICT this was
> the only place in -simplifycfg where now-dead conditions of replaced
> terminators weren't being cleaned up).
> The only other user of this function is -sccp, but I didn't read that
> thoroughly enough to figure out whether it might be holding pointers
> to instructions that could be deleted by this.
> <constantfoldterminator-dce-dead-cond.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list