[PATCH] [SROA] Fold a PHI node if all its incoming values are the same

Jingyue Wu jingyue at google.com
Tue Jul 29 18:24:04 PDT 2014


Can anyone take a look at the latest diff? 

In the latest diff, I use SimplifyInstruction to fold both PHI nodes and select instructions. Doing so requires a minor fix in the logic of clobbering dead uses in select instructions: to clobber x/y in "select undef, x, y", we should change the condition from "undef" to 0/1. Otherwise, "select undef, undef, y" or "select undef, x, undef" can introduce more undefined behavior. This wasn't an issue in the old code, because the old code does not fold a select with undef condition.

http://reviews.llvm.org/D4659






More information about the llvm-commits mailing list