I thought we already canonicalized the pseudo ordering, but clearly not.. Anyway., looks good to me. Btw, if you want to do another simplification, one that I've actually seen multiple times in the kernel is this one: if (val1 & BITx) val2 |= BITy; and turning it into val2 |= (val1 & BITx) .. shift left or right by (BITx-BITy); and while actually testing the above, I note that sparse seems to have problems with even simple if-conversion: #define BIT1 4 #define BIT2 8 int fn(int x, int y) { if (x & BIT1) y |= BIT2; return y; } linearizes to a nasty mess of actual phi nodes and conditional jumps rather than just a 'select' op. Never mind the actual unconditional version, of course. I didn't check why the if-conversion doesn't happen. Linus