The present invention provides pyrimidinones of the formula lid(see formula IId)that modulate the activity of phosphoinositide 3-kinases (PI3Ks) and areuseful in the treatment ofdiseases related to the activity of PI3Ks including, for example, inflammatorydisorders, immune-based disorders, cancer, and other diseases.