[PATCH] Transform OR of SELECTs to SELECT of ORs

Duncan Sands baldrick at free.fr
Fri Feb 15 21:05:35 PST 2013


Hi Muhammad,

On 01/02/13 14:59, Muhammad Tauqir wrote:
> More descriptively, the transform is:
> (or (bool?A:B),(bool?C:D)) --> (bool?(or A,C):(or B,D))
>
> By the time the OR is visited, both the SELECTs have been visited and not optimized and the OR itself hasn't been transformed so we do this transform in the hopes that the new ORs will be optimized.

you could do this transform only if instsimplify says that at least one of
"or A,C", "or B,D" will simplify.

In which case this doesn't have much to do with "or", it's a completely
general binop transform that might be worth doing for every type of binop.

I think Shuxin already proposed something like this for another binop, but
I lost track of what happened.

Ciao, Duncan.



More information about the llvm-commits mailing list