How dietary selection affects genome evolution to define the optimal range of nutrient intake is a poorly understood question with medical relevance. We have addressed this question by analyzing Drosophila simulans and sechellia, recently diverged species with differential diet choice. D. sechellia larvae, specialized to a nutrient scarce diet, did not survive on sugar-rich conditions, while the generalist species D. simulans was sugar tolerant. Sugar tolerance in D. simulans was a tradeoff for performance on low-energy diet and was associated with global reprogramming of metabolic gene expression. Hybridization and phenotype-based introgression revealed the genomic regions of D. simulans that were sufficient for sugar tolerance. These regions included genes that are involved in mitochondrial ribosome biogenesis and intracellular signaling, such as PPP1R15/Gadd34 and SERCA, which contributed to sugar tolerance. In conclusion, genomic variation affecting genes involved in global metabolic control defines the optimal range for dietary macronutrient composition.